ci(windows): use MSYS2's bash, not the WSL stub

Windows Subsystem for Linux has no installed distributions.

ninja starts the launcher through CreateProcess, which resolves a bare "bash"
against the Windows PATH and finds C:\Windows\System32\bash.exe -- the WSL
launcher, not the shell this job runs in. Every compile died there.

The MSYS2 bash is now named explicitly, and both it and the script are passed
through cygpath -m so CMake, ninja and bash all read the same path without
backslash escaping.
This commit is contained in:
jolavillette 2026-08-15 12:07:24 +02:00
parent a57060be5b
commit 5365ecfa3c

View File

@ -93,17 +93,23 @@ jobs:
chmod +x "$RUNNER_TEMP/cxx-launcher.sh"
- name: CMake configure
run: >
cmake -G Ninja -B Build-cmake -S .
"-DCMAKE_CXX_COMPILER_LAUNCHER=bash;$RUNNER_TEMP/cxx-launcher.sh"
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_BUILD_TYPE=Release
-DRS_RNPLIB=ON -DRS_JSON_API=ON -DRS_WEBUI=OFF
-DRS_SQLCIPHER=ON -DRS_BITDHT=ON
-DRS_BRODCAST_DISCOVERY=ON -DRS_MINIUPNPC=ON
-DRS_FORUM_DEEP_INDEX=OFF
-DCMAKE_C_FLAGS="-include string.h -include stdint.h"
-DCMAKE_CXX_FLAGS="-include cstring -include cstdint -Wno-template-body"
run: |
# Plain "bash" would be resolved by CreateProcess to Windows' own
# C:\Windows\System32\bash.exe -- the WSL stub, which answers
# "Windows Subsystem for Linux has no installed distributions".
# Name the MSYS2 one, in a path CMake and ninja can both use.
BASH_EXE="$(cygpath -m "$(command -v bash)")"
LAUNCHER="$(cygpath -m "$RUNNER_TEMP/cxx-launcher.sh")"
cmake -G Ninja -B Build-cmake -S . \
"-DCMAKE_CXX_COMPILER_LAUNCHER=$BASH_EXE;$LAUNCHER" \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DRS_RNPLIB=ON -DRS_JSON_API=ON -DRS_WEBUI=OFF \
-DRS_SQLCIPHER=ON -DRS_BITDHT=ON \
-DRS_BRODCAST_DISCOVERY=ON -DRS_MINIUPNPC=ON \
-DRS_FORUM_DEEP_INDEX=OFF \
-DCMAKE_C_FLAGS="-include string.h -include stdint.h" \
-DCMAKE_CXX_FLAGS="-include cstring -include cstdint -Wno-template-body"
- name: CMake build
run: cmake --build Build-cmake -j3