From c7656153898e863870b0b768bc1042a729ebb569 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 15 Aug 2026 11:25:43 +0200 Subject: [PATCH] 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