From 252070ed3a24ebf92a934b4a07a5f7c4f1e3eca4 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 09:51:47 +0200 Subject: [PATCH 01/11] ci: build libretroshare with CMake, on its own This repository has no CI that compiles anything. Its only build workflow is a copy of the super-project's Windows qmake job, which cannot work here -- it checks out submodule paths that exist only in the super-project -- and has failed all of its last 40 runs, on master and on every pull request. The green mark next to it comes from the GitLab mirror, not from a build. CMake makes an actual CI possible for the first time: libretroshare has a top level CMakeLists.txt of its own, project(retroshare), and pulls what it needs through FetchContent -- rnp, OpenPGP-SDK, BitDHT, rapidjson, restbed, udp-discovery-cpp. So it configures and builds with no super-project, no submodules and no graft: a checkout, the system libraries, configure, build. None of that is possible with qmake, where libretroshare/src/libretroshare.pro is only a subproject of RetroShare.pro. Options follow the Linux CMake job of the super-project, minus what does not exist here (GUI, service, friendserver, plugins), and otherwise keep the values a normal build uses so the CI compiles what people ship. RS_JSON_API is turned on explicitly because it defaults to OFF here, and it is both the most breakage-prone part of the tree and the reason restbed is fetched at all. The broken qmake workflow is left untouched: replacing it is a separate decision, and this one stands on its own. --- .github/workflows/ubuntu-cmake.yml | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/ubuntu-cmake.yml diff --git a/.github/workflows/ubuntu-cmake.yml b/.github/workflows/ubuntu-cmake.yml new file mode 100644 index 000000000..06eed484c --- /dev/null +++ b/.github/workflows/ubuntu-cmake.yml @@ -0,0 +1,70 @@ +# Ubuntu CMake CI for libretroshare on its own. +# +# libretroshare has a top level CMakeLists.txt of its own -- project(retroshare) +# -- and pulls what it needs through FetchContent: rnp, OpenPGP-SDK, BitDHT, +# rapidjson, restbed, udp-discovery-cpp. So it configures and builds without the +# RetroShare super-project, without submodules and without any graft. Only the +# system libraries below have to be installed. +# +# Options mirror the Linux CMake job of the super-project, minus everything that +# does not exist in this repository: no GUI, no service, no friendserver, no +# plugins. Everything else is left at the value a normal build uses, so the CI +# compiles what people actually ship -- RS_MINIUPNPC in particular defaults to +# ON, and switching it off to save one package would leave that code untested. +# +# Two deliberate departures: RS_JSON_API is OFF by default here and is turned +# on, since it is the part of the tree most exposed to breakage and the reason +# restbed is fetched at all; RS_WEBUI stays off, as it only serves files the +# super-project provides. +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: Ubuntu CMake C/C++ CI + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Ubuntu / CMake + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install dependencies + run: > + sudo apt-get update && + sudo apt-get install -y + build-essential g++ cmake ninja-build pkg-config git + libssl-dev zlib1g-dev libbz2-dev libjson-c-dev + libsqlcipher-dev libminiupnpc-dev + doxygen python3 + + - name: CMake configure + run: > + cmake -G Ninja -B Build-cmake -S . + -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 + + - name: CMake build + run: cmake --build Build-cmake -j$(nproc) From c7656153898e863870b0b768bc1042a729ebb569 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:25:43 +0200 Subject: [PATCH 02/11] ci: same CMake build on Windows UCRT64 Linux alone would leave the platform where portability actually breaks untested -- and it is the one the dead qmake workflow was aimed at. Same standalone build as the Ubuntu job, same RS_* option set, so a failure on one and not the other means a portability problem rather than a difference in what was configured. What differs is what has to: pacman instead of apt, and the two -include flags the super-project's Windows job also carries, since librnp uses strlen and the fixed width integer types without including and , which this toolchain refuses. No Qt packages here: this repository builds no GUI. macOS is deliberately left out for now. Its counterpart in the super-project is mostly Homebrew flag harvesting for Qt5, ffmpeg and speex -- GUI and VOIP dependencies that libretroshare does not use -- so it would be a rewrite rather than a transposition, with little to catch that Linux does not. --- .github/workflows/windows-cmake.yml | 82 +++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/windows-cmake.yml diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml new file mode 100644 index 000000000..41744af11 --- /dev/null +++ b/.github/workflows/windows-cmake.yml @@ -0,0 +1,82 @@ +# Windows (MSYS2 / UCRT64) CMake CI for libretroshare on its own. +# +# Same standalone build as ubuntu-cmake.yml: libretroshare has its own top level +# CMakeLists.txt and pulls rnp, OpenPGP-SDK, BitDHT, rapidjson, restbed and +# udp-discovery-cpp through FetchContent, so no super-project and no submodules +# are involved. Only the MSYS2 packages below are installed. +# +# Windows earns its own job rather than a matrix entry: it is where portability +# breaks first, its dependencies come from pacman rather than apt, and it needs +# the two -include flags below, which the super-project's Windows job also +# carries -- librnp uses strlen and the fixed width integer types without +# including and , which this toolchain refuses. +# +# No Qt packages: this repository builds no GUI. +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: Windows UCRT64 CMake C/C++ CI + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Windows UCRT64 / CMake + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup MSYS2 (UCRT64) + uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0 + with: + msystem: UCRT64 + update: true + install: >- + base-devel + git + mingw-w64-ucrt-x86_64-toolchain + mingw-w64-ucrt-x86_64-cmake + mingw-w64-ucrt-x86_64-ninja + mingw-w64-ucrt-x86_64-python + mingw-w64-ucrt-x86_64-doxygen + mingw-w64-ucrt-x86_64-openssl + mingw-w64-ucrt-x86_64-sqlcipher + mingw-w64-ucrt-x86_64-miniupnpc + mingw-w64-ucrt-x86_64-json-c + mingw-w64-ucrt-x86_64-bzip2 + mingw-w64-ucrt-x86_64-zlib + + - name: CMake configure + run: > + cmake -G Ninja -B Build-cmake -S . + -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 From d22307623b3053303910823e059d7e75a1b17923 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:37:27 +0200 Subject: [PATCH 03/11] ci: same CMake build on macOS Third and last platform, same standalone build and the same RS_* option set as Ubuntu and Windows, so a failure on one of them points at portability rather than at a difference in what was configured. What differs is Homebrew: most of these formulae are keg-only, so their headers and libraries are not on the default search paths. Same treatment as the super-project's macOS job -- every opt/* include and lib directory harvested into the compiler and linker flags, and the prefixes exposed to find_package() through CMAKE_PREFIX_PATH. None of the GUI formulae the super-project installs are here: no Qt, no ffmpeg, no speex. This repository builds no interface, and libretroshare does not use Qt at all -- which is also why there is no Qt5/Qt6 split in these three jobs. --- .github/workflows/macos-cmake.yml | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/macos-cmake.yml diff --git a/.github/workflows/macos-cmake.yml b/.github/workflows/macos-cmake.yml new file mode 100644 index 000000000..3a289091e --- /dev/null +++ b/.github/workflows/macos-cmake.yml @@ -0,0 +1,75 @@ +# macOS CMake CI for libretroshare on its own. +# +# Same standalone build as the Ubuntu and Windows jobs: libretroshare has its +# own top level CMakeLists.txt and pulls rnp, OpenPGP-SDK, BitDHT, rapidjson, +# restbed and udp-discovery-cpp through FetchContent, so no super-project and no +# submodules are involved. Only the Homebrew formulae below are installed, and +# none of the GUI ones the super-project needs -- this repository builds no +# interface. +# +# Homebrew keeps most of these keg-only, so their headers and libraries are not +# on the default search paths. Same treatment as the super-project's macOS job: +# harvest every opt/* include and lib directory into the compiler and linker +# flags, and expose the prefixes to find_package() through CMAKE_PREFIX_PATH. +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: macOS CMake C/C++ CI + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: macOS / CMake + runs-on: macos-latest + defaults: + run: + shell: bash + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Homebrew dependencies + run: > + brew install + cmake ninja pkg-config + openssl@3 sqlcipher miniupnpc json-c + bzip2 zlib doxygen + + - name: CMake configure + run: | + HB="$(brew --prefix)" + IFLAGS="-I$HB/include"; for d in "$HB"/opt/*/include; do IFLAGS="$IFLAGS -I$d"; done + LFLAGS="-L$HB/lib"; for d in "$HB"/opt/*/lib; do LFLAGS="$LFLAGS -L$d"; done + PREFIX="$HB"; for d in "$HB"/opt/*; do PREFIX="$PREFIX;$d"; done + cmake -G Ninja -B Build-cmake -S . \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="$PREFIX" \ + -DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)" \ + -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="$IFLAGS" -DCMAKE_CXX_FLAGS="$IFLAGS" \ + -DCMAKE_EXE_LINKER_FLAGS="$LFLAGS" \ + -DCMAKE_SHARED_LINKER_FLAGS="$LFLAGS" \ + -DCMAKE_MODULE_LINKER_FLAGS="$LFLAGS" + + - name: CMake build + run: cmake --build Build-cmake -j$(sysctl -n hw.ncpu) From a09ea85b4238917e5dfd51580139ceb6720c798e Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:39:19 +0200 Subject: [PATCH 04/11] ci: install Botan, which rnp needs First run: all three jobs stopped at configure with Could NOT find Botan (missing: BOTAN_LIBRARY BOTAN_INCLUDE_DIR) Botan is not a dependency of libretroshare -- it appears in none of its find_package calls, which is why it was missing from these lists -- but rnp requires it, and rnp is pulled in by FetchContent as soon as RS_RNPLIB is on. The super-project's CIs install it for the same reason. libbotan-2-dev, mingw-w64-ucrt-x86_64-libbotan, botan@2. --- .github/workflows/macos-cmake.yml | 2 +- .github/workflows/ubuntu-cmake.yml | 2 +- .github/workflows/windows-cmake.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-cmake.yml b/.github/workflows/macos-cmake.yml index 3a289091e..f05e46cd8 100644 --- a/.github/workflows/macos-cmake.yml +++ b/.github/workflows/macos-cmake.yml @@ -49,7 +49,7 @@ jobs: run: > brew install cmake ninja pkg-config - openssl@3 sqlcipher miniupnpc json-c + openssl@3 botan@2 sqlcipher miniupnpc json-c bzip2 zlib doxygen - name: CMake configure diff --git a/.github/workflows/ubuntu-cmake.yml b/.github/workflows/ubuntu-cmake.yml index 06eed484c..789129de5 100644 --- a/.github/workflows/ubuntu-cmake.yml +++ b/.github/workflows/ubuntu-cmake.yml @@ -52,7 +52,7 @@ jobs: sudo apt-get update && sudo apt-get install -y build-essential g++ cmake ninja-build pkg-config git - libssl-dev zlib1g-dev libbz2-dev libjson-c-dev + libssl-dev zlib1g-dev libbz2-dev libjson-c-dev libbotan-2-dev libsqlcipher-dev libminiupnpc-dev doxygen python3 diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index 41744af11..2798a7728 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -60,6 +60,7 @@ jobs: mingw-w64-ucrt-x86_64-python mingw-w64-ucrt-x86_64-doxygen mingw-w64-ucrt-x86_64-openssl + mingw-w64-ucrt-x86_64-libbotan mingw-w64-ucrt-x86_64-sqlcipher mingw-w64-ucrt-x86_64-miniupnpc mingw-w64-ucrt-x86_64-json-c From 1b67abdf96a84a157dd9901868f14130c73f77a9 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:41:41 +0200 Subject: [PATCH 05/11] ci(macos): give the restbed patch step a GNU sed The restbed FetchContent block patches the fetched CMakeLists with sed -i -e "s|/wd4251||g" ... which is GNU syntax. BSD sed, the one macOS ships, reads what follows -i as a backup suffix, so it takes "-e" as a filename and stops with sed: -e: No such file or directory The super-project never runs into this: it carries restbed as a submodule, so the add_subdirectory branch is taken and FetchContent -- with its patch step -- never runs. The standalone build has no submodule and always goes through FetchContent, which is why this surfaces here and nowhere else. Fixed by putting Homebrew's GNU sed first in PATH for the configure step, rather than by touching CMakeLists.txt. --- .github/workflows/macos-cmake.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos-cmake.yml b/.github/workflows/macos-cmake.yml index f05e46cd8..59694ba95 100644 --- a/.github/workflows/macos-cmake.yml +++ b/.github/workflows/macos-cmake.yml @@ -50,10 +50,17 @@ jobs: brew install cmake ninja pkg-config openssl@3 botan@2 sqlcipher miniupnpc json-c - bzip2 zlib doxygen + bzip2 zlib doxygen gnu-sed + # The restbed patch step of CMakeLists.txt runs `sed -i -e ...`, which is + # GNU syntax: BSD sed reads the argument after -i as a backup suffix and + # fails with "sed: -e: No such file or directory". The super-project never + # hits it -- it has restbed as a submodule and takes the add_subdirectory + # branch instead of FetchContent -- so this only shows up in the standalone + # build. Put GNU sed first in PATH rather than patch the CMakeLists. - name: CMake configure run: | + export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH" HB="$(brew --prefix)" IFLAGS="-I$HB/include"; for d in "$HB"/opt/*/include; do IFLAGS="$IFLAGS -I$d"; done LFLAGS="-L$HB/lib"; for d in "$HB"/opt/*/lib; do LFLAGS="$LFLAGS -L$d"; done From 5bcde96d2a4b026bc9d0728115373adbe71288b1 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:42:52 +0200 Subject: [PATCH 06/11] ci: install rapidjson from the system Build stopped on every file that includes rsjson.h: rapidjson/document.h: No such file or directory and the compile line carried no -I for it. CMakeLists.txt resolves rapidjson in three steps: find_path in the system, then ../supportlibs/rapidjson, then FetchContent. The third branch calls FetchContent_MakeAvailable(rapidjson) and stops there -- it never adds an include directory for what it just downloaded, so nothing reaches the compiler. The super-project always takes the second branch, its submodule being present, which is why this only shows up in a standalone build. Installing the system package makes the first branch match, which is also what the super-project's other CIs do: rapidjson-dev, mingw-w64-ucrt-x86_64-rapidjson, rapidjson. --- .github/workflows/macos-cmake.yml | 2 +- .github/workflows/ubuntu-cmake.yml | 2 +- .github/workflows/windows-cmake.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-cmake.yml b/.github/workflows/macos-cmake.yml index 59694ba95..b50b6d6c1 100644 --- a/.github/workflows/macos-cmake.yml +++ b/.github/workflows/macos-cmake.yml @@ -50,7 +50,7 @@ jobs: brew install cmake ninja pkg-config openssl@3 botan@2 sqlcipher miniupnpc json-c - bzip2 zlib doxygen gnu-sed + bzip2 zlib doxygen gnu-sed rapidjson # The restbed patch step of CMakeLists.txt runs `sed -i -e ...`, which is # GNU syntax: BSD sed reads the argument after -i as a backup suffix and diff --git a/.github/workflows/ubuntu-cmake.yml b/.github/workflows/ubuntu-cmake.yml index 789129de5..be748347e 100644 --- a/.github/workflows/ubuntu-cmake.yml +++ b/.github/workflows/ubuntu-cmake.yml @@ -52,7 +52,7 @@ jobs: sudo apt-get update && sudo apt-get install -y build-essential g++ cmake ninja-build pkg-config git - libssl-dev zlib1g-dev libbz2-dev libjson-c-dev libbotan-2-dev + libssl-dev zlib1g-dev libbz2-dev libjson-c-dev libbotan-2-dev rapidjson-dev libsqlcipher-dev libminiupnpc-dev doxygen python3 diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index 2798a7728..72d20abfe 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -61,6 +61,7 @@ jobs: mingw-w64-ucrt-x86_64-doxygen mingw-w64-ucrt-x86_64-openssl mingw-w64-ucrt-x86_64-libbotan + mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-sqlcipher mingw-w64-ucrt-x86_64-miniupnpc mingw-w64-ucrt-x86_64-json-c From 3bbabde96bab6eb8f93872ef14701397d630781d Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:49:17 +0200 Subject: [PATCH 07/11] ci(windows): stop udp-discovery-cpp being compiled as C++98 c++0x_warning.h:32: error: This file requires compiler and library support for the ISO C++ 2011 standard udp-discovery-cpp asks CMake for C++98, so the sub-build is compiled with -std=gnu++98, and its own sources then include headers that need C++11. The UCRT64 toolchain refuses; the older GCC on the Ubuntu runner lets it through, which is why only Windows stops here. Two reasons it does not happen in the super-project: it carries udp-discovery-cpp as a submodule pinned at f3a3103, so the add_subdirectory branch is taken -- and the FetchContent branch used by a standalone build asks for GIT_TAG "origin/master", the moving tip of a third party project. That is worth reporting on its own: this build follows whatever that repository does today. CMAKE_CXX98_*_COMPILE_OPTION is what CMake emits when a target asks for C++98. Remapping it to gnu++17 leaves every other target untouched, and keeps this out of CMakeLists.txt. --- .github/workflows/windows-cmake.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index 72d20abfe..f5755f3eb 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -77,6 +77,8 @@ jobs: -DRS_SQLCIPHER=ON -DRS_BITDHT=ON -DRS_BRODCAST_DISCOVERY=ON -DRS_MINIUPNPC=ON -DRS_FORUM_DEEP_INDEX=OFF + -DCMAKE_CXX98_STANDARD_COMPILE_OPTION=-std=gnu++17 + -DCMAKE_CXX98_EXTENSION_COMPILE_OPTION=-std=gnu++17 -DCMAKE_C_FLAGS="-include string.h -include stdint.h" -DCMAKE_CXX_FLAGS="-include cstring -include cstdint -Wno-template-body" From 569666321cf10db45083de5ac1867c45a3761606 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:56:23 +0200 Subject: [PATCH 08/11] ci(windows): rewrite -std=gnu++98 through a compiler launcher The previous attempt passed CMAKE_CXX98_STANDARD_COMPILE_OPTION on the command line. It had no effect: CMake sets that variable itself while detecting the compiler, after the cache is read, so it overwrote what was given. The flag comes from udp-discovery-cpp, which does set_property(TARGET udp-discovery PROPERTY CXX_STANDARD 98) a target property, which nothing outside its own CMakeLists can override -- while its sources include headers that need C++11. The UCRT64 toolchain refuses it; the older GCC on the Ubuntu runner does not, which is why this is a Windows only step. CMAKE_CXX_COMPILER_LAUNCHER prefixes every compile command, so a three line script can rewrite that one flag and forward the rest untouched. Nothing else in the build sees a difference, and CMakeLists.txt stays as it is. Tested locally on the generated script. The real fix belongs upstream: FetchContent asks for GIT_TAG "origin/master" of that third party project, so this build follows whatever it does today. --- .github/workflows/windows-cmake.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index f5755f3eb..73eb9f1b3 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -68,17 +68,36 @@ jobs: mingw-w64-ucrt-x86_64-bzip2 mingw-w64-ucrt-x86_64-zlib + # udp-discovery-cpp sets CXX_STANDARD 98 as a target property, which no + # command line option can override, and its own sources then include + # headers that need C++11. This launcher rewrites that one flag and + # forwards everything else untouched, so nothing else in the build is + # affected and CMakeLists.txt stays as it is. + - name: Compiler launcher rewriting -std=gnu++98 + run: | + cat > "$RUNNER_TEMP/cxx-launcher.sh" <<'SH' + #!/usr/bin/env bash + args=() + for a in "$@"; do + case "$a" in + -std=gnu++98|-std=c++98) a="-std=gnu++17" ;; + esac + args+=("$a") + done + exec "${args[@]}" + SH + chmod +x "$RUNNER_TEMP/cxx-launcher.sh" + - name: CMake configure run: > cmake -G Ninja -B Build-cmake -S . + -DCMAKE_CXX_COMPILER_LAUNCHER="$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_CXX98_STANDARD_COMPILE_OPTION=-std=gnu++17 - -DCMAKE_CXX98_EXTENSION_COMPILE_OPTION=-std=gnu++17 -DCMAKE_C_FLAGS="-include string.h -include stdint.h" -DCMAKE_CXX_FLAGS="-include cstring -include cstdint -Wno-template-body" From a57060be5b2a54348aa6b195006ef531364102c7 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 12:01:08 +0200 Subject: [PATCH 09/11] ci(windows): call the launcher through bash ninja: fatal: CreateProcess: %1 is not a valid Win32 application The launcher was reached, but ninja starts it with CreateProcess, which cannot run a .sh: the shebang means nothing to Windows. CMAKE_CXX_COMPILER_LAUNCHER takes a ;-separated list, so naming bash explicitly puts a real executable first and the script becomes its argument. --- .github/workflows/windows-cmake.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index 73eb9f1b3..3d43b7e91 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -73,6 +73,10 @@ jobs: # headers that need C++11. This launcher rewrites that one flag and # forwards everything else untouched, so nothing else in the build is # affected and CMakeLists.txt stays as it is. + # + # Invoked as "bash;