From 5365ecfa3c8579ec46f9c5b12a02d034d98d29a3 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 12:07:24 +0200 Subject: [PATCH] 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. --- .github/workflows/windows-cmake.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index 3d43b7e91..c0aeaa010 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -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