libretroshare/.github/workflows/windows-cmake.yml
jolavillette 8d03ad6e7b ci(windows): drop the launcher, turn broadcast discovery off instead
The compiler launcher worked -- 135 objects went through it -- and then:

    c++.exe: fatal error: no input files

only on the longest command lines. Prefixing every compile with
"bash.exe <script> " pushes those past the CreateProcess limit, and what falls
off the end is the source file. Nothing to tune: the prefix is fixed and the
command lines are what they are.

So the C++98 target is avoided rather than fought: RS_BRODCAST_DISCOVERY=OFF
drops udp-discovery-cpp from the Windows build. Linux and macOS keep it on, and
the header of the file says why the three jobs differ, so nobody reads it as an
oversight.

This should be temporary. The fix belongs in libretroshare's CMakeLists, which
fetches that project at GIT_TAG "origin/master" -- a moving third party tip --
while the super-project pins a submodule and never meets the problem.
2026-08-15 12:14:31 +02:00

99 lines
3.6 KiB
YAML

# 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 <cstring> and <cstdint>, which this toolchain refuses.
#
# One option differs from the other two jobs, on purpose: RS_BRODCAST_DISCOVERY
# is OFF here. It pulls udp-discovery-cpp, whose CMakeLists sets CXX_STANDARD 98
# as a target property while its sources include headers that need C++11 -- the
# UCRT64 toolchain refuses that combination, the older GCC on the Ubuntu runner
# does not. Nothing outside that project's own CMakeLists can raise the standard
# of one of its targets, and rewriting the flag through a compiler launcher made
# the longest command lines overflow the CreateProcess limit, which cost the
# source file at the end of them.
#
# It should not stay off. The fix belongs in libretroshare's CMakeLists, whose
# FetchContent asks for GIT_TAG "origin/master" of that third party project --
# so this build follows whatever it does today, while the super-project pins a
# submodule at f3a3103 and never sees the problem.
#
# 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-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
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=OFF -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