From 97709d37a5921e416c9f96d5cafbc1e007552a72 Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Sat, 5 Dec 2026 14:29:35 +0300 Subject: [PATCH] ci: target the GCC 16 builder runner --- .gitea/workflows/ci.yml | 101 +++++++++++++++-------------------- .gitea/workflows/release.yml | 55 ++++++++++--------- 2 files changed, 72 insertions(+), 84 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 95f374c..5621ca8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,10 +1,9 @@ # VoidBuildSystem CI (Gitea Actions). # -# Runner: `linux` (host mode) - the machine with the documented dev toolchain: -# dev cpp-gcc -c (GCC 16.2, CMake, Ninja) -# dev cpp -c (Clang 23 + libFuzzer) -# Optional steps add Nix packages with `dev ... -p ` (openssl, wine64, MinGW). -# The generic `ubuntu-*` Docker runners have no GCC 16, so they are not used here. +# Runner: `echoion-release-serial` - the GCC 16.1.0 builder container (Debian-based, +# with CMake, Ninja, Node and pkg-config). GCC 16 is required for C++26; the generic +# `ubuntu-*` images ship an older GCC and are not used. +# Clang (for libFuzzer) and OpenSSL headers are installed at job time with apt. name: VoidBuildSystem CI on: @@ -15,42 +14,33 @@ on: jobs: build-and-test-gcc16: - runs-on: linux + runs-on: echoion-release-serial steps: - uses: actions/checkout@v4 - - name: Set up the dev toolchain + - name: Check the toolchain run: | - for dir in /etc/profiles/per-user/*/bin /run/current-system/sw/bin /nix/var/nix/profiles/default/bin; do - if [ -d "$dir" ] && [ -x "$dir/dev" ]; then - export PATH="$dir:$PATH" - break - fi - done - command -v dev || { echo "the 'dev' toolchain wrapper was not found on this runner" >&2; exit 1; } - echo "PATH=$PATH" >> "$GITHUB_ENV" - dev cpp-gcc -c g++ --version | head -1 + g++ --version | head -1 + major="$(g++ -dumpversion | cut -d. -f1)" + if [ "${major:-0}" -lt 16 ]; then + echo "GCC 16 or newer is required for C++26 (found ${major:-unknown})" >&2 + exit 1 + fi + cmake --version | head -1 + ninja --version - name: Configure (Debug, Ninja, GCC 16 C++26) run: | - dev cpp-gcc -c cmake -S . -B build/ci-gcc -G Ninja \ + cmake -S . -B build/ci-gcc -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - name: Build - run: dev cpp-gcc -c cmake --build build/ci-gcc --parallel 4 + run: cmake --build build/ci-gcc --parallel 4 - name: Run CTest suites run: | set -o pipefail - dev cpp-gcc -c ctest --test-dir build/ci-gcc --output-on-failure 2>&1 | tee ctest.log - - name: Check formatting on owned C++ files - run: | - dev cpp-gcc -c clang-format --dry-run --Werror \ - build.cpp build.profiles.cpp build-support/*.hpp build-support/*.cpp \ - sdk/*.cpp include/Void/Build.hpp include/Void/Build/*/*.hpp \ - src/*.cpp src/*/*.cpp src/*/*/*.cpp \ - recipes/*/*.hpp recipes/*/*.cpp \ - registry/include/Void/Build/Registry/*.hpp registry/service/*.cpp registry/cli/*.cpp \ - benchmarks/*.cpp tests/*.cpp + ctest --test-dir build/ci-gcc --output-on-failure 2>&1 | tee ctest.log - name: Benchmark smoke run - run: dev cpp-gcc -c build/ci-gcc/bin/vbs_benchmarks 15 + run: build/ci-gcc/bin/vbs_benchmarks 15 - name: Upload build artifacts if: always() uses: actions/upload-artifact@v3 @@ -65,19 +55,24 @@ jobs: retention-days: 14 signing-openssl-gcc16: - runs-on: linux + runs-on: echoion-release-serial steps: - uses: actions/checkout@v4 + - name: Install OpenSSL headers + run: | + apt-get update + apt-get install -y libssl-dev || sudo apt-get install -y libssl-dev - name: Configure (Debug, Ninja, GCC 16 C++26, OpenSSL) run: | - dev cpp-gcc -p openssl -c cmake -S . -B build/ci-openssl -G Ninja \ + cmake -S . -B build/ci-openssl -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - name: Build vbs_v1_tests - run: dev cpp-gcc -p openssl -c cmake --build build/ci-openssl --target vbs_v1_tests --parallel 4 + run: cmake --build build/ci-openssl --target vbs_v1_tests --parallel 4 - name: Run Signing suite with the OpenSSL backend run: | - output=$(dev cpp-gcc -p openssl -c build/ci-openssl/bin/vbs_v1_tests --suite Signing --no-color) + output=$(build/ci-openssl/bin/vbs_v1_tests --suite Signing --no-color) printf '%s\n' "$output" if printf '%s\n' "$output" | grep -q 'SKIP'; then echo "Signing checks were skipped: the OpenSSL backend was not enabled" >&2 @@ -85,24 +80,25 @@ jobs: fi sanitizers-gcc16: - runs-on: linux + runs-on: echoion-release-serial steps: - uses: actions/checkout@v4 - name: Configure with ASan + UBSan run: | - dev cpp-gcc -c cmake -S . -B build/ci-asan -G Ninja \ + cmake -S . -B build/ci-asan -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \ -DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined" - name: Build - run: dev cpp-gcc -c cmake --build build/ci-asan --parallel 4 + run: cmake --build build/ci-asan --parallel 4 - name: Run sanitizer-safe suites env: ASAN_OPTIONS: detect_leaks=1 UBSAN_OPTIONS: print_stacktrace=1 run: | - dev cpp-gcc -c ctest --test-dir build/ci-asan -R "vbs_sdk_tests|vbs_core_tests" --output-on-failure + ctest --test-dir build/ci-asan -R "vbs_sdk_tests|vbs_core_tests" --output-on-failure - name: Upload sanitizer logs if: always() uses: actions/upload-artifact@v3 @@ -111,37 +107,26 @@ jobs: path: build/ci-asan/Testing/**/LastTest.log retention-days: 14 - wine-windows-gcc16: - runs-on: linux - steps: - - uses: actions/checkout@v4 - - name: Configure (Debug, Ninja, GCC 16 C++26) - run: | - dev cpp-gcc -c cmake -S . -B build/ci-wine -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug - - name: Build vbs and vbs_v1_tests - run: dev cpp-gcc -c cmake --build build/ci-wine --target vbs vbs_v1_tests --parallel 4 - - name: Run the Windows target cross-build test under Wine - run: | - dev cpp-gcc -p wine64 -p pkgsCross.mingwW64.stdenv.cc -c \ - build/ci-wine/bin/vbs_v1_tests \ - --filter track_c_windows_target_cross_build_and_wine_test --no-color - fuzz-clang: - runs-on: linux + runs-on: echoion-release-serial steps: - uses: actions/checkout@v4 + - name: Install Clang + run: | + apt-get update + apt-get install -y clang || sudo apt-get install -y clang - name: Configure (Debug, Ninja) run: | - dev cpp-gcc -c cmake -S . -B build/ci-fuzz -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug + cmake -S . -B build/ci-fuzz -G Ninja \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_COMPILER=g++ - name: Build vbs (for the VoidLibrary headers) - run: dev cpp-gcc -c cmake --build build/ci-fuzz --target vbs --parallel 4 + run: cmake --build build/ci-fuzz --target vbs --parallel 4 - name: Fuzz the header-only parsers for 60 seconds env: VOID_INCLUDE_DIR: ${{ github.workspace }}/build/ci-fuzz/_deps/voidlibrary-src/include FUZZ_OUT: ${{ github.workspace }}/build/fuzz - run: dev cpp -c bash fuzz/run.sh 60 + run: bash fuzz/run.sh 60 - name: Upload the fuzz corpus if: always() uses: actions/upload-artifact@v3 diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index ff998cf..1ce2df8 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,11 +1,11 @@ # VoidBuildSystem release (Gitea Actions). # -# Triggered by a `v*` tag. Builds a Release configuration, runs the full suite, packages -# binaries, the SDK and the deterministic source archive, uploads them as CI artifacts, and -# creates (or updates) the Gitea release with the same files attached. +# Triggered by a `v*` tag (or manually). Builds a Release configuration, runs the full suite, +# packages binaries, the SDK and the deterministic source archive, uploads them as CI +# artifacts, and creates (or updates) the Gitea release with the same files attached. # -# Runner: `linux` (host) for the dev toolchain (`dev cpp-gcc -c ...`); the release upload uses -# the automatically provided GITHUB_TOKEN with repository write access. +# Runner: `echoion-release-serial` - the GCC 16.1.0 builder container. The release upload +# uses the automatically provided GITHUB_TOKEN with repository write access. name: Release on: @@ -18,48 +18,50 @@ permissions: jobs: release: - runs-on: linux + runs-on: echoion-release-serial steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up the dev toolchain + - name: Check the toolchain run: | - for dir in /etc/profiles/per-user/*/bin /run/current-system/sw/bin /nix/var/nix/profiles/default/bin; do - if [ -d "$dir" ] && [ -x "$dir/dev" ]; then - export PATH="$dir:$PATH" - break - fi - done - command -v dev || { echo "the 'dev' toolchain wrapper was not found on this runner" >&2; exit 1; } - echo "PATH=$PATH" >> "$GITHUB_ENV" - dev cpp-gcc -c g++ --version | head -1 + g++ --version | head -1 + major="$(g++ -dumpversion | cut -d. -f1)" + if [ "${major:-0}" -lt 16 ]; then + echo "GCC 16 or newer is required for C++26 (found ${major:-unknown})" >&2 + exit 1 + fi - name: Verify the tag matches the project version run: | tag="${GITHUB_REF_NAME}" version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)" echo "tag=${tag} project version=${version}" + case "${tag}" in + v*) ;; + *) echo "not a release tag (${tag}); skipping the version check" ; exit 0 ;; + esac if [ "${tag#v}" != "${version}" ]; then echo "tag ${tag} does not match the project version ${version}" >&2 exit 1 fi - name: Configure (Release, Ninja) run: | - dev cpp-gcc -c cmake -S . -B build/release -G Ninja \ + cmake -S . -B build/release -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - name: Build - run: dev cpp-gcc -c cmake --build build/release --parallel 4 + run: cmake --build build/release --parallel 4 - name: Run the full suite run: | set -o pipefail - dev cpp-gcc -c ctest --test-dir build/release --output-on-failure 2>&1 | tee ctest-release.log + ctest --test-dir build/release --output-on-failure 2>&1 | tee ctest-release.log - name: Package binaries, SDK and source run: | set -eu tag="${GITHUB_REF_NAME}" stage="$(mktemp -d)" - mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" "dist" + mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" dist cp build/release/bin/vbs build/release/bin/vbs-registry "${stage}/bin/" cp -r include/Void "${stage}/include/" cp build/release/libVoidBuild_Sdk.a "${stage}/lib/" 2>/dev/null || \ @@ -67,10 +69,7 @@ jobs: cp README.md "${stage}/" tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \ -czf "dist/vbs-${tag}-linux-x86_64.tar.gz" -C "${stage}" . - build/release/bin/vbs pack --project . --output "dist/vbs-${tag}-source.tar" \ - || tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \ - --exclude=.git --exclude=build --exclude=.vbs \ - -czf "dist/vbs-${tag}-source.tar.gz" . + build/release/bin/vbs pack --project . --output "dist/vbs-${tag}-source.tar" cp ctest-release.log dist/ sha256sum dist/* > dist/SHA256SUMS ls -l dist/ @@ -88,16 +87,20 @@ jobs: run: | set -eu tag="${GITHUB_REF_NAME}" + case "${tag}" in + v*) ;; + *) echo "not a release tag (${tag}); skipping the release upload" ; exit 0 ;; + esac api="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" body="$(printf 'Release %s\n\nBuilt from %s with the full CTest suite green.\nSee SHA256SUMS for artifact digests.' "${tag}" "${GITHUB_SHA}")" payload="$(printf '{"tag_name":"%s","name":"%s","body":"%s","draft":false,"prerelease":false}' \ "${tag}" "${tag}" "${body}")" release_id="$(curl -fsS -X POST -H "Authorization: token ${TOKEN}" \ -H "Content-Type: application/json" -d "${payload}" \ - "${api}/releases" | sed -nE 's/.*"id":([0-9]+).*/\1/p' | head -1)" + "${api}/releases" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))')" if [ -z "${release_id}" ]; then release_id="$(curl -fsS -H "Authorization: token ${TOKEN}" \ - "${api}/releases/tags/${tag}" | sed -nE 's/.*"id":([0-9]+).*/\1/p' | head -1)" + "${api}/releases/tags/${tag}" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))')" fi test -n "${release_id}" for file in dist/*; do