From 7b8d671f5271d56ea00b102ced8239759d8b190c Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Thu, 30 Apr 2026 15:07:52 +0700 Subject: [PATCH 01/17] ci: add -Dcoverage_tool=gcov|llvm option, wire native llvm-cov in matrix introduces native llvm source-based coverage as an alternative to the existing gcov + gcovr pipeline. driven by a new -Dcoverage_tool cache variable (default 'gcov' for backwards compat; 'llvm' enables -fprofile-instr-generate / -fcoverage-mapping + llvm-profdata + llvm-cov). cmake: - RippledSettings.cmake: add coverage_tool with validation - RippledInterface.cmake: split coverage compile/link flags by tool - RippledCov.cmake: dispatch to the new helper when tool=llvm - CodeCoverageLLVM.cmake (new): setup_target_for_coverage_llvm() driving profraw -> profdata -> export with format-aware output (lcov/json/txt/html) ci: - new clang-20 llvm-cov coverage matrix row (apt.llvm.org bootstrap for clang >= 19 since 24.04 default repos cap at clang-18) - conditional install of llvm-N vs gcovr based on coverage_tool - artifact + codecov upload generalised to coverage.lcov | coverage.xml - coverage cmake-args switched to *_FLAGS_DEBUG so the build action's stdlib flag isn't clobbered temp (revert before merging to dev): - matrix narrowed to just the llvm-cov row on non-main refs so we can iterate without burning runners - 'coverage-llm' added to push trigger for direct-push CI runs --- .github/workflows/xahau-ga-nix.yml | 86 ++++++++++++++--- cmake/CodeCoverageLLVM.cmake | 149 +++++++++++++++++++++++++++++ cmake/RippledCov.cmake | 15 +++ cmake/RippledInterface.cmake | 10 +- cmake/RippledSettings.cmake | 11 ++- 5 files changed, 252 insertions(+), 19 deletions(-) create mode 100644 cmake/CodeCoverageLLVM.cmake diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index a2636bbb82..c614a3b348 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -2,7 +2,9 @@ name: Nix - GA Runner on: push: - branches: ["dev", "candidate", "release"] + # TEMP: coverage-llm added so direct pushes to the branch fire CI while + # we iterate on the llvm-cov pipeline. Revert before merging to dev. + branches: ["dev", "candidate", "release", "coverage-llm"] pull_request: branches: ["**"] types: [opened, synchronize, reopened, labeled, unlabeled] @@ -80,7 +82,25 @@ jobs: "compiler_version": 13, "stdlib": "default", "configuration": "Debug", - "job_type": "coverage" + "job_type": "coverage", + "coverage_tool": "gcov", + "coverage_format": "xml" + }, + { + # Latest stable Clang for the most accurate source-based + # coverage mapping (newer language features, fewer bugs in + # llvm-cov region inference). Pulled from apt.llvm.org since + # Ubuntu 24.04 default repos cap at clang-18. + "compiler_id": "clang-20-libcxx", + "compiler": "clang", + "cc": "clang-20", + "cxx": "clang++-20", + "compiler_version": 20, + "stdlib": "libcxx", + "configuration": "Debug", + "job_type": "coverage", + "coverage_tool": "llvm", + "coverage_format": "lcov" }, { "compiler_id": "clang-14-libstdcxx-gcc11", @@ -132,7 +152,8 @@ jobs: minimal_matrix = [ full_matrix[1], # gcc-13 (middle-ground gcc) full_matrix[2], # gcc-13 coverage - full_matrix[3] # clang-14 (mature, stable clang) + full_matrix[3], # clang-20 llvm-cov coverage + full_matrix[4] # clang-14 (mature, stable clang) ] # Determine which matrix to use based on the target branch @@ -215,6 +236,14 @@ jobs: print(f"Using MINIMAL matrix (3 configs) - feature branch/PR") matrix = minimal_matrix + # TEMP (coverage-llm branch): narrow the matrix to just the new + # clang-20 llvm-cov coverage row so we can iterate on it without + # burning runners on the rest. Guarded so it can't accidentally + # apply to dev/candidate/release - revert before merging anyway. + if ref not in main_branches and base_ref not in ["dev", "candidate", "release"]: + matrix = [e for e in matrix if e.get("coverage_tool") == "llvm"] + print(f"TEMP override: matrix narrowed to {len(matrix)} llvm-cov row(s)") + # Add runs_on based on job_type for entry in matrix: if entry.get("job_type") == "coverage": @@ -260,6 +289,19 @@ jobs: apt-get update apt-get install -y software-properties-common add-apt-repository ppa:ubuntu-toolchain-r/test -y + + # apt.llvm.org for Clang versions newer than what Ubuntu 24.04 ships + # (24.04 default repos cap at clang-18). The bootstrap script adds + # the LLVM apt source for the requested version and runs apt-get update. + if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.compiler_version }}" -ge 19 ]; then + apt-get install -y wget gnupg lsb-release + wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh + chmod +x /tmp/llvm.sh + # `all` installs clang + libllvm + lldb + lld + the llvm-N package + # (which provides llvm-profdata-N / llvm-cov-N for coverage runs). + /tmp/llvm.sh ${{ matrix.compiler_version }} all + fi + apt-get update apt-get install -y git python3 python-is-python3 pipx pipx ensurepath @@ -332,10 +374,16 @@ jobs: pipx install "conan>=2.0,<3" echo "$HOME/.local/bin" >> $GITHUB_PATH - # Install gcovr for coverage jobs + # Install coverage tooling if [ "${{ matrix.job_type }}" = "coverage" ]; then - pipx install "gcovr>=7,<9" apt-get install -y curl lcov + if [ "${{ matrix.coverage_tool }}" = "llvm" ]; then + # Native LLVM source-based coverage: llvm-profdata + llvm-cov. + # The clang-N package doesn't pull these in; the llvm-N package does. + apt-get install -y "llvm-${{ matrix.compiler_version }}" + else + pipx install "gcovr>=7,<9" + fi fi - name: Check environment @@ -348,10 +396,15 @@ jobs: which ${{ matrix.cxx }} && ${{ matrix.cxx }} --version || echo "${{ matrix.cxx }} not found" which ccache && ccache --version || echo "ccache not found" - # Check gcovr for coverage jobs + # Check coverage tooling if [ "${{ matrix.job_type }}" = "coverage" ]; then - which gcov && gcov --version || echo "gcov not found" - which gcovr && gcovr --version || echo "gcovr not found" + if [ "${{ matrix.coverage_tool }}" = "llvm" ]; then + which "llvm-profdata-${{ matrix.compiler_version }}" && "llvm-profdata-${{ matrix.compiler_version }}" --version || echo "llvm-profdata not found" + which "llvm-cov-${{ matrix.compiler_version }}" && "llvm-cov-${{ matrix.compiler_version }}" --version || echo "llvm-cov not found" + else + which gcov && gcov --version || echo "gcov not found" + which gcovr && gcovr --version || echo "gcovr not found" + fi fi echo "---- Full Environment ----" @@ -410,8 +463,9 @@ jobs: cache_version: ${{ env.CACHE_VERSION }} main_branch: ${{ env.MAIN_BRANCH_NAME }} stdlib: ${{ matrix.stdlib }} - # Coverage builds are slower due to instrumentation; use fewer parallel jobs to avoid flakiness - cmake-args: '-Dcoverage=ON -Dcoverage_format=xml -Dcoverage_test_parallelism=$(($(nproc)/2)) -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_CXX_FLAGS="-O0" -DCMAKE_C_FLAGS="-O0"' + # Coverage builds are slower due to instrumentation; use fewer parallel jobs to avoid flakiness. + # Use *_FLAGS_DEBUG so the build action's stdlib flag (e.g. -stdlib=libc++) in CMAKE_CXX_FLAGS isn't clobbered. + cmake-args: '-Dcoverage=ON -Dcoverage_tool=${{ matrix.coverage_tool }} -Dcoverage_format=${{ matrix.coverage_format }} -Dcoverage_test_parallelism=$(($(nproc)/2)) -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_CXX_FLAGS_DEBUG="-g -O0" -DCMAKE_C_FLAGS_DEBUG="-g -O0"' cmake-target: 'coverage' ccache_max_size: '100G' @@ -443,22 +497,26 @@ jobs: - name: Move coverage report if: matrix.job_type == 'coverage' shell: bash + env: + COVERAGE_FILE: ${{ matrix.coverage_tool == 'llvm' && 'coverage.lcov' || 'coverage.xml' }} run: | - mv "${{ env.build_dir }}/coverage.xml" ./ + mv "${{ env.build_dir }}/${COVERAGE_FILE}" ./ + echo "COVERAGE_FILE=${COVERAGE_FILE}" >> "$GITHUB_ENV" - name: Archive coverage report if: matrix.job_type == 'coverage' uses: actions/upload-artifact@v4 with: - name: coverage.xml - path: coverage.xml + name: ${{ env.COVERAGE_FILE }}-${{ matrix.compiler_id }} + path: ${{ env.COVERAGE_FILE }} retention-days: 30 - name: Upload coverage report if: matrix.job_type == 'coverage' uses: codecov/codecov-action@v5 with: - files: coverage.xml + files: ${{ env.COVERAGE_FILE }} + flags: ${{ matrix.coverage_tool }} fail_ci_if_error: true disable_search: true verbose: true diff --git a/cmake/CodeCoverageLLVM.cmake b/cmake/CodeCoverageLLVM.cmake new file mode 100644 index 0000000000..b89098f615 --- /dev/null +++ b/cmake/CodeCoverageLLVM.cmake @@ -0,0 +1,149 @@ +#[===================================================================[ + Native LLVM source-based code coverage helper. + + Drives the -fprofile-instr-generate / -fcoverage-mapping pipeline: + 1. Run instrumented binary with LLVM_PROFILE_FILE=...%m-%p.profraw + 2. llvm-profdata merge -sparse -> coverage.profdata + 3. llvm-cov export/show/report -> final report + + Output filename per coverage_format: + lcov -> coverage.lcov + json -> coverage.json + txt | text -> coverage.txt + html | html-details -> /index.html +#]===================================================================] + +include(CMakeParseArguments) + +# Locate llvm-profdata / llvm-cov, preferring versioned variants matching the +# Clang we're building with so we don't accidentally pair clang-20 with +# llvm-cov-14 (profile format mismatch -> hard failure). +function(_find_llvm_cov_tools) + if(LLVM_PROFDATA_PATH AND LLVM_COV_PATH) + return() + endif() + + string(REGEX MATCH "^[0-9]+" _major "${CMAKE_CXX_COMPILER_VERSION}") + + set(_pd_names llvm-profdata) + set(_cov_names llvm-cov) + if(_major) + list(PREPEND _pd_names "llvm-profdata-${_major}") + list(PREPEND _cov_names "llvm-cov-${_major}") + endif() + + if(APPLE) + execute_process(COMMAND xcrun -f llvm-profdata + OUTPUT_VARIABLE _pd_xcrun OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET RESULT_VARIABLE _pd_rc) + if(_pd_rc EQUAL 0 AND _pd_xcrun) + set(LLVM_PROFDATA_PATH "${_pd_xcrun}" CACHE FILEPATH "llvm-profdata" FORCE) + endif() + execute_process(COMMAND xcrun -f llvm-cov + OUTPUT_VARIABLE _cov_xcrun OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET RESULT_VARIABLE _cov_rc) + if(_cov_rc EQUAL 0 AND _cov_xcrun) + set(LLVM_COV_PATH "${_cov_xcrun}" CACHE FILEPATH "llvm-cov" FORCE) + endif() + endif() + + if(NOT LLVM_PROFDATA_PATH) + find_program(LLVM_PROFDATA_PATH NAMES ${_pd_names}) + endif() + if(NOT LLVM_COV_PATH) + find_program(LLVM_COV_PATH NAMES ${_cov_names}) + endif() +endfunction() + +function(setup_target_for_coverage_llvm) + set(oneValueArgs NAME FORMAT BASE_DIRECTORY) + set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) + cmake_parse_arguments(Cov "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + _find_llvm_cov_tools() + if(NOT LLVM_PROFDATA_PATH) + message(FATAL_ERROR "llvm-profdata not found (needed for coverage_tool=llvm)") + endif() + if(NOT LLVM_COV_PATH) + message(FATAL_ERROR "llvm-cov not found (needed for coverage_tool=llvm)") + endif() + + if(NOT Cov_FORMAT) + set(Cov_FORMAT lcov) + endif() + + set(_profraw_dir "${PROJECT_BINARY_DIR}/${Cov_NAME}-profraw") + set(_profdata "${PROJECT_BINARY_DIR}/${Cov_NAME}.profdata") + + # Resolve binary path: accept either an absolute path or a bare target name + # (resolved against PROJECT_BINARY_DIR). + list(GET Cov_EXECUTABLE 0 _exec_name) + if(IS_ABSOLUTE "${_exec_name}") + set(_binary "${_exec_name}") + else() + set(_binary "${PROJECT_BINARY_DIR}/${_exec_name}") + endif() + + # llvm-cov takes a single -ignore-filename-regex; OR our excludes together. + set(_ignore_regex "") + foreach(EXC IN LISTS Cov_EXCLUDE) + if(_ignore_regex) + string(APPEND _ignore_regex "|") + endif() + string(APPEND _ignore_regex "${EXC}") + endforeach() + set(_filter "") + if(_ignore_regex) + set(_filter "-ignore-filename-regex='${_ignore_regex}'") + endif() + + # Pick llvm-cov subcommand + output file for the requested format. Each + # branch builds a single shell command string that we'll hand to bash -c. + if(Cov_FORMAT STREQUAL "lcov") + set(_output "${PROJECT_BINARY_DIR}/coverage.lcov") + set(_report_sh "${LLVM_COV_PATH} export -instr-profile='${_profdata}' -format=lcov ${_filter} '${_binary}' > '${_output}'") + elseif(Cov_FORMAT STREQUAL "json") + set(_output "${PROJECT_BINARY_DIR}/coverage.json") + set(_report_sh "${LLVM_COV_PATH} export -instr-profile='${_profdata}' -format=text ${_filter} '${_binary}' > '${_output}'") + elseif(Cov_FORMAT STREQUAL "txt" OR Cov_FORMAT STREQUAL "text") + set(_output "${PROJECT_BINARY_DIR}/coverage.txt") + set(_report_sh "${LLVM_COV_PATH} report -instr-profile='${_profdata}' ${_filter} '${_binary}' > '${_output}'") + elseif(Cov_FORMAT STREQUAL "html" OR Cov_FORMAT STREQUAL "html-details") + set(_output "${PROJECT_BINARY_DIR}/${Cov_NAME}/index.html") + set(_report_sh "${LLVM_COV_PATH} show -instr-profile='${_profdata}' -format=html -output-dir='${PROJECT_BINARY_DIR}/${Cov_NAME}' ${_filter} '${_binary}'") + else() + message(FATAL_ERROR "coverage_tool=llvm: unsupported coverage_format '${Cov_FORMAT}' (use lcov|json|txt|html)") + endif() + + set(_merge_sh "${LLVM_PROFDATA_PATH} merge -sparse -o '${_profdata}' '${_profraw_dir}'/*.profraw") + + if(CODE_COVERAGE_VERBOSE) + message(STATUS "[coverage:llvm] binary: ${_binary}") + message(STATUS "[coverage:llvm] profraw: ${_profraw_dir}") + message(STATUS "[coverage:llvm] profdata: ${_profdata}") + message(STATUS "[coverage:llvm] format: ${Cov_FORMAT}") + message(STATUS "[coverage:llvm] output: ${_output}") + if(_ignore_regex) + message(STATUS "[coverage:llvm] ignore: ${_ignore_regex}") + endif() + message(STATUS "[coverage:llvm] merge: ${_merge_sh}") + message(STATUS "[coverage:llvm] report: ${_report_sh}") + endif() + + # %m: hash of the binary, %p: pid. Wipe the dir up front so stale profraw + # files can't leak into a fresh merge. + add_custom_target(${Cov_NAME} + COMMAND ${CMAKE_COMMAND} -E rm -rf "${_profraw_dir}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${_profraw_dir}" + COMMAND ${CMAKE_COMMAND} -E env + "LLVM_PROFILE_FILE=${_profraw_dir}/rippled-%m-%p.profraw" + ${Cov_EXECUTABLE} ${Cov_EXECUTABLE_ARGS} + COMMAND bash -c "${_merge_sh}" + COMMAND bash -c "${_report_sh}" + BYPRODUCTS ${_output} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${Cov_DEPENDENCIES} + VERBATIM + COMMENT "Running llvm-cov (${Cov_FORMAT}) -> ${_output}" + ) +endfunction() diff --git a/cmake/RippledCov.cmake b/cmake/RippledCov.cmake index 3c48bb1c14..02ce3c6ada 100644 --- a/cmake/RippledCov.cmake +++ b/cmake/RippledCov.cmake @@ -11,6 +11,21 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") return() endif() +if(coverage_tool STREQUAL "llvm") + include(CodeCoverageLLVM) + + setup_target_for_coverage_llvm( + NAME coverage + FORMAT ${coverage_format} + EXECUTABLE rippled + EXECUTABLE_ARGS --unittest$<$:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log + EXCLUDE "src/test" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb" + DEPENDENCIES rippled + ) + return() +endif() + +# coverage_tool == "gcov" (default): existing gcovr-driven pipeline. include(CodeCoverage) # The instructions for these commands come from the `CodeCoverage` module, diff --git a/cmake/RippledInterface.cmake b/cmake/RippledInterface.cmake index 93a973ac73..44495ef499 100644 --- a/cmake/RippledInterface.cmake +++ b/cmake/RippledInterface.cmake @@ -28,15 +28,17 @@ target_compile_options (opts $<$,$>:-Wsuggest-override> $<$:-Wno-maybe-uninitialized> $<$:-fno-omit-frame-pointer> - $<$,$>:-g --coverage -fprofile-abs-path> - $<$,$>:-g --coverage> + $<$,$,$>:-g --coverage -fprofile-abs-path> + $<$,$,$>:-g --coverage> + $<$,$,$>:-g -fprofile-instr-generate -fcoverage-mapping> $<$:-pg> $<$,$>:-p>) target_link_libraries (opts INTERFACE - $<$,$>:-g --coverage -fprofile-abs-path> - $<$,$>:-g --coverage> + $<$,$,$>:-g --coverage -fprofile-abs-path> + $<$,$,$>:-g --coverage> + $<$,$,$>:-g -fprofile-instr-generate -fcoverage-mapping> $<$:-pg> $<$,$>:-p>) diff --git a/cmake/RippledSettings.cmake b/cmake/RippledSettings.cmake index 58877e1885..68f6c49eab 100644 --- a/cmake/RippledSettings.cmake +++ b/cmake/RippledSettings.cmake @@ -29,8 +29,17 @@ if(is_gcc OR is_clang) "Unit tests parallelism for the purpose of coverage report.") set(coverage_format "html-details" CACHE STRING "Output format of the coverage report.") + set(coverage_tool "gcov" CACHE STRING + "Coverage instrumentation tool: 'gcov' (default, gcc/clang via --coverage + gcovr) or 'llvm' (clang only, native source-based coverage via -fprofile-instr-generate).") + set_property(CACHE coverage_tool PROPERTY STRINGS "gcov" "llvm") + if(NOT coverage_tool MATCHES "^(gcov|llvm)$") + message(FATAL_ERROR "coverage_tool must be 'gcov' or 'llvm', got '${coverage_tool}'") + endif() + if(coverage AND coverage_tool STREQUAL "llvm" AND NOT is_clang) + message(FATAL_ERROR "coverage_tool=llvm requires Clang (got ${CMAKE_CXX_COMPILER_ID})") + endif() set(coverage_extra_args "" CACHE STRING - "Additional arguments to pass to gcovr.") + "Additional arguments to pass to gcovr (gcov tool only).") set(coverage_test "" CACHE STRING "On gcc & clang, the specific unit test(s) to run for coverage. Default is all tests.") if(coverage_test AND NOT coverage) From 94a62f5572e20bb3ef6210862abb48d39c7fec50 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Thu, 30 Apr 2026 15:13:47 +0700 Subject: [PATCH 02/17] ci: drop coverage-llm from push triggers, PR trigger covers it --- .github/workflows/xahau-ga-nix.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index c614a3b348..683d80c55f 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -2,9 +2,7 @@ name: Nix - GA Runner on: push: - # TEMP: coverage-llm added so direct pushes to the branch fire CI while - # we iterate on the llvm-cov pipeline. Revert before merging to dev. - branches: ["dev", "candidate", "release", "coverage-llm"] + branches: ["dev", "candidate", "release"] pull_request: branches: ["**"] types: [opened, synchronize, reopened, labeled, unlabeled] From 8d609f9cf33717547d345cbeabf651ea4cb5ca38 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Thu, 30 Apr 2026 15:15:46 +0700 Subject: [PATCH 03/17] ci: actually narrow matrix to just the llvm-cov row prior guard checked base_ref against ['dev','candidate','release'] which excluded the very PR we're iterating on. drop the guard - this branch is for iteration only and must be reverted before merging anyway. --- .github/workflows/xahau-ga-nix.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index 683d80c55f..940b31b794 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -236,11 +236,9 @@ jobs: # TEMP (coverage-llm branch): narrow the matrix to just the new # clang-20 llvm-cov coverage row so we can iterate on it without - # burning runners on the rest. Guarded so it can't accidentally - # apply to dev/candidate/release - revert before merging anyway. - if ref not in main_branches and base_ref not in ["dev", "candidate", "release"]: - matrix = [e for e in matrix if e.get("coverage_tool") == "llvm"] - print(f"TEMP override: matrix narrowed to {len(matrix)} llvm-cov row(s)") + # burning runners on the rest. MUST be reverted before merging. + matrix = [e for e in matrix if e.get("coverage_tool") == "llvm"] + print(f"TEMP override: matrix narrowed to {len(matrix)} llvm-cov row(s)") # Add runs_on based on job_type for entry in matrix: From 43a37afb512a694d7c25263f5ec63c8985fe0079 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Thu, 30 Apr 2026 15:20:03 +0700 Subject: [PATCH 04/17] ci(deps): apply Wno-missing-template-arg-list workaround to Linux clang grpc 1.50.1 hits -Werror=missing-template-arg-list-after-template-kw on clang-19+. macOS clang already had this workaround in the conan profile; mirror it to the Linux branch, gated on compiler==clang. --- .github/actions/xahau-ga-dependencies/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/xahau-ga-dependencies/action.yml b/.github/actions/xahau-ga-dependencies/action.yml index 8da022fe54..d9f0bcbf7d 100644 --- a/.github/actions/xahau-ga-dependencies/action.yml +++ b/.github/actions/xahau-ga-dependencies/action.yml @@ -116,6 +116,14 @@ runs: [conf] tools.build:compiler_executables={"c": "/usr/bin/${{ inputs.cc }}", "cpp": "/usr/bin/${{ inputs.cxx }}"} EOF + + # gRPC 1.50.1 trips clang-19+ -Werror=missing-template-arg-list-after-template-kw. + # Same workaround as the macOS branch below, but only for clang where the flag exists. + if [ "${{ inputs.compiler }}" = "clang" ]; then + cat >> ~/.conan2/profiles/default < Date: Thu, 30 Apr 2026 15:25:07 +0700 Subject: [PATCH 05/17] ci(temp): disable all workflows except Nix GA on this branch renames every non-nix workflow to .yml.disabled so they stop firing on PR pushes while we iterate on the llvm-cov coverage row. MUST be reverted before merging to dev. --- .../{build-in-docker.yml => build-in-docker.yml.disabled} | 0 .../{check-genesis-hooks.yml => check-genesis-hooks.yml.disabled} | 0 .github/workflows/{clang-format.yml => clang-format.yml.disabled} | 0 .../{guard-checker-build.yml => guard-checker-build.yml.disabled} | 0 .../{instrumentation.yml => instrumentation.yml.disabled} | 0 .github/workflows/{levelization.yml => levelization.yml.disabled} | 0 ...enerated-headers.yml => verify-generated-headers.yml.disabled} | 0 .../workflows/{xahau-ga-macos.yml => xahau-ga-macos.yml.disabled} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-in-docker.yml => build-in-docker.yml.disabled} (100%) rename .github/workflows/{check-genesis-hooks.yml => check-genesis-hooks.yml.disabled} (100%) rename .github/workflows/{clang-format.yml => clang-format.yml.disabled} (100%) rename .github/workflows/{guard-checker-build.yml => guard-checker-build.yml.disabled} (100%) rename .github/workflows/{instrumentation.yml => instrumentation.yml.disabled} (100%) rename .github/workflows/{levelization.yml => levelization.yml.disabled} (100%) rename .github/workflows/{verify-generated-headers.yml => verify-generated-headers.yml.disabled} (100%) rename .github/workflows/{xahau-ga-macos.yml => xahau-ga-macos.yml.disabled} (100%) diff --git a/.github/workflows/build-in-docker.yml b/.github/workflows/build-in-docker.yml.disabled similarity index 100% rename from .github/workflows/build-in-docker.yml rename to .github/workflows/build-in-docker.yml.disabled diff --git a/.github/workflows/check-genesis-hooks.yml b/.github/workflows/check-genesis-hooks.yml.disabled similarity index 100% rename from .github/workflows/check-genesis-hooks.yml rename to .github/workflows/check-genesis-hooks.yml.disabled diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml.disabled similarity index 100% rename from .github/workflows/clang-format.yml rename to .github/workflows/clang-format.yml.disabled diff --git a/.github/workflows/guard-checker-build.yml b/.github/workflows/guard-checker-build.yml.disabled similarity index 100% rename from .github/workflows/guard-checker-build.yml rename to .github/workflows/guard-checker-build.yml.disabled diff --git a/.github/workflows/instrumentation.yml b/.github/workflows/instrumentation.yml.disabled similarity index 100% rename from .github/workflows/instrumentation.yml rename to .github/workflows/instrumentation.yml.disabled diff --git a/.github/workflows/levelization.yml b/.github/workflows/levelization.yml.disabled similarity index 100% rename from .github/workflows/levelization.yml rename to .github/workflows/levelization.yml.disabled diff --git a/.github/workflows/verify-generated-headers.yml b/.github/workflows/verify-generated-headers.yml.disabled similarity index 100% rename from .github/workflows/verify-generated-headers.yml rename to .github/workflows/verify-generated-headers.yml.disabled diff --git a/.github/workflows/xahau-ga-macos.yml b/.github/workflows/xahau-ga-macos.yml.disabled similarity index 100% rename from .github/workflows/xahau-ga-macos.yml rename to .github/workflows/xahau-ga-macos.yml.disabled From 51cd3ddf252735bb42c1d57c6f0dcac1dd2cb7da Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Thu, 30 Apr 2026 15:53:45 +0700 Subject: [PATCH 06/17] fix(cov): use absolute binary path in llvm-cov run command bare 'rippled' wasn't on PATH and the build dir isn't '.', so the profile-collection step failed with 'No such file or directory'. splice the resolved absolute path back into Cov_EXECUTABLE before the run command consumes it. --- cmake/CodeCoverageLLVM.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/CodeCoverageLLVM.cmake b/cmake/CodeCoverageLLVM.cmake index b89098f615..b438ea6e98 100644 --- a/cmake/CodeCoverageLLVM.cmake +++ b/cmake/CodeCoverageLLVM.cmake @@ -76,12 +76,16 @@ function(setup_target_for_coverage_llvm) set(_profdata "${PROJECT_BINARY_DIR}/${Cov_NAME}.profdata") # Resolve binary path: accept either an absolute path or a bare target name - # (resolved against PROJECT_BINARY_DIR). + # (resolved against PROJECT_BINARY_DIR). Splice the resolved path back into + # Cov_EXECUTABLE so the run command invokes it via absolute path - bare + # names aren't on PATH and the build dir isn't `.` either. list(GET Cov_EXECUTABLE 0 _exec_name) if(IS_ABSOLUTE "${_exec_name}") set(_binary "${_exec_name}") else() set(_binary "${PROJECT_BINARY_DIR}/${_exec_name}") + list(REMOVE_AT Cov_EXECUTABLE 0) + list(PREPEND Cov_EXECUTABLE "${_binary}") endif() # llvm-cov takes a single -ignore-filename-regex; OR our excludes together. From 5b4a6703ead03623d023518138e5e12d7cb08ad6 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 08:57:30 +0700 Subject: [PATCH 07/17] ci(deps): replace hardcoded grpc workaround with matrix-driven conan_deps_cxxflags new dependencies action input `conan_deps_cxxflags` (json list, default '[]') drives `tools.build:cxxflags` in the conan profile. clearly named to indicate the flags only apply to conan dependency builds, not the rippled build itself. removes the per-os/per-compiler hardcoded workaround (linux clang conditional + unconditional macOS block) that used to set the same flag in two places kept-in-sync by hand. call sites: - xahau-ga-nix.yml: clang-20 coverage row gets the -Wno-missing-template-arg-list-after-template-kw workaround for grpc 1.50.1 - xahau-ga-macos.yml.disabled: same flag plumbed through (preserves prior behaviour when re-enabled) drop the workaround entries when grpc is bumped past the fix. --- .../actions/xahau-ga-dependencies/action.yml | 34 +++++++++---------- .github/workflows/xahau-ga-macos.yml.disabled | 3 ++ .github/workflows/xahau-ga-nix.yml | 7 +++- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/actions/xahau-ga-dependencies/action.yml b/.github/actions/xahau-ga-dependencies/action.yml index d9f0bcbf7d..3864a77c5a 100644 --- a/.github/actions/xahau-ga-dependencies/action.yml +++ b/.github/actions/xahau-ga-dependencies/action.yml @@ -50,6 +50,10 @@ inputs: options: - libstdcxx - libcxx + conan_deps_cxxflags: + description: 'Extra cxxflags applied to Conan dependency builds only (NOT the rippled build). JSON list, e.g. ["-Wno-foo","-Wno-bar"]. Maps to Conan tools.build:cxxflags.' + required: false + default: '[]' outputs: cache-hit: @@ -105,7 +109,12 @@ runs: os=${{ inputs.os }} EOF - # Add buildenv and conf sections for Linux (not needed for macOS) + # [buildenv] + [conf] sections. + # Linux pins compiler executables; macOS uses the system toolchain. + # conan_deps_cxxflags (matrix-driven) optionally adds tools.build:cxxflags + # for Conan dependency builds only - typically grpc workarounds for + # newer clang's stricter diagnostics. Does NOT affect the rippled build. + NEED_CONF=0 if [ "${{ inputs.os }}" = "Linux" ] && [ -n "${{ inputs.cc }}" ]; then cat >> ~/.conan2/profiles/default <> ~/.conan2/profiles/default <> ~/.conan2/profiles/default <> ~/.conan2/profiles/default + echo "[conf]" >> ~/.conan2/profiles/default + fi + echo 'tools.build:cxxflags=${{ inputs.conan_deps_cxxflags }}' >> ~/.conan2/profiles/default fi # Display profile for verification diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml.disabled index 65d5470934..4748abdeda 100644 --- a/.github/workflows/xahau-ga-macos.yml.disabled +++ b/.github/workflows/xahau-ga-macos.yml.disabled @@ -107,6 +107,9 @@ jobs: compiler: apple-clang compiler_version: ${{ steps.detect-compiler.outputs.compiler_version }} stdlib: libcxx + # grpc 1.50.1 trips this on newer Apple Clang (clang-19+ frontend). + # Drop when grpc is bumped past the fix. + conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' - name: Build uses: ./.github/actions/xahau-ga-build diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index 940b31b794..3130e84b86 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -98,7 +98,11 @@ jobs: "configuration": "Debug", "job_type": "coverage", "coverage_tool": "llvm", - "coverage_format": "lcov" + "coverage_format": "lcov", + # grpc 1.50.1 uses `Foo::template Bar(...)` without an + # angle-bracket arg list; clang-19+ promoted that to + # -Werror. Drop when grpc is bumped past the fix. + "conan_deps_cxxflags": ["-Wno-missing-template-arg-list-after-template-kw"] }, { "compiler_id": "clang-14-libstdcxx-gcc11", @@ -427,6 +431,7 @@ jobs: cc: ${{ matrix.cc }} cxx: ${{ matrix.cxx }} stdlib: ${{ matrix.stdlib }} + conan_deps_cxxflags: ${{ matrix.conan_deps_cxxflags && toJson(matrix.conan_deps_cxxflags) || '[]' }} gha_cache_enabled: 'false' # Disable caching for self hosted runner - name: Build From fe162a99a99755dc4f80b66d95a7252fd3d51a03 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:24:20 +0700 Subject: [PATCH 08/17] fix(cov): tighten coverage_tool=llvm validation + macOS tool discovery two bugs caught in review: - RippledSettings.cmake: the clang-only guard for coverage_tool=llvm ran before coverage_test could auto-enable coverage. so '-Dcoverage_tool=llvm -Dcoverage_test=Foo' on a gcc build slipped past the guard and produced an instrumentation/tool mismatch. move the guard after the auto-enable block. - CodeCoverageLLVM.cmake: _find_llvm_cov_tools unconditionally preferred xcrun's tools on APPLE, which on a homebrew clang-N build would pair the user's clang with xcode's llvm-cov - exactly the version mismatch the helper is trying to avoid. gate the xcrun branch on CMAKE_CXX_COMPILER_ID == AppleClang. --- cmake/CodeCoverageLLVM.cmake | 5 ++++- cmake/RippledSettings.cmake | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/CodeCoverageLLVM.cmake b/cmake/CodeCoverageLLVM.cmake index b438ea6e98..f986ec6252 100644 --- a/cmake/CodeCoverageLLVM.cmake +++ b/cmake/CodeCoverageLLVM.cmake @@ -32,7 +32,10 @@ function(_find_llvm_cov_tools) list(PREPEND _cov_names "llvm-cov-${_major}") endif() - if(APPLE) + # Only delegate to xcrun when the *compiler* is AppleClang. On macOS with + # Homebrew/system clang-N, xcrun would resolve to Xcode's llvm tools which + # could be a different version - exactly the mismatch we want to avoid. + if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") execute_process(COMMAND xcrun -f llvm-profdata OUTPUT_VARIABLE _pd_xcrun OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET RESULT_VARIABLE _pd_rc) diff --git a/cmake/RippledSettings.cmake b/cmake/RippledSettings.cmake index 68f6c49eab..f3c52b4863 100644 --- a/cmake/RippledSettings.cmake +++ b/cmake/RippledSettings.cmake @@ -35,9 +35,6 @@ if(is_gcc OR is_clang) if(NOT coverage_tool MATCHES "^(gcov|llvm)$") message(FATAL_ERROR "coverage_tool must be 'gcov' or 'llvm', got '${coverage_tool}'") endif() - if(coverage AND coverage_tool STREQUAL "llvm" AND NOT is_clang) - message(FATAL_ERROR "coverage_tool=llvm requires Clang (got ${CMAKE_CXX_COMPILER_ID})") - endif() set(coverage_extra_args "" CACHE STRING "Additional arguments to pass to gcovr (gcov tool only).") set(coverage_test "" CACHE STRING @@ -45,6 +42,12 @@ if(is_gcc OR is_clang) if(coverage_test AND NOT coverage) set(coverage ON CACHE BOOL "gcc/clang only" FORCE) endif() + # Validate after coverage_test may have flipped coverage on, otherwise + # `-Dcoverage_tool=llvm -Dcoverage_test=Foo` on gcc would silently slip + # past the Clang guard and produce a broken instrumentation combo. + if(coverage AND coverage_tool STREQUAL "llvm" AND NOT is_clang) + message(FATAL_ERROR "coverage_tool=llvm requires Clang (got ${CMAKE_CXX_COMPILER_ID})") + endif() option(wextra "compile with extra gcc/clang warnings enabled" ON) else() set(profile OFF CACHE BOOL "gcc/clang only" FORCE) From f8a30c528d936d5a91618315a89d9f1f3d5e23f1 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:25:30 +0700 Subject: [PATCH 09/17] chore(cov): drop dead BASE_DIRECTORY arg + revert .disabled file edit - CodeCoverageLLVM.cmake: BASE_DIRECTORY was parsed but never used (no analog to gcovr's -r in the llvm-cov commands we emit). dead arg. - xahau-ga-macos.yml.disabled: revert the conan_deps_cxxflags addition. the file is disabled so the edit was bit-rotting in unreachable code. whoever revives the macOS workflow can wire up the field then. --- .github/workflows/xahau-ga-macos.yml.disabled | 3 --- cmake/CodeCoverageLLVM.cmake | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml.disabled index 4748abdeda..65d5470934 100644 --- a/.github/workflows/xahau-ga-macos.yml.disabled +++ b/.github/workflows/xahau-ga-macos.yml.disabled @@ -107,9 +107,6 @@ jobs: compiler: apple-clang compiler_version: ${{ steps.detect-compiler.outputs.compiler_version }} stdlib: libcxx - # grpc 1.50.1 trips this on newer Apple Clang (clang-19+ frontend). - # Drop when grpc is bumped past the fix. - conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' - name: Build uses: ./.github/actions/xahau-ga-build diff --git a/cmake/CodeCoverageLLVM.cmake b/cmake/CodeCoverageLLVM.cmake index f986ec6252..b678559992 100644 --- a/cmake/CodeCoverageLLVM.cmake +++ b/cmake/CodeCoverageLLVM.cmake @@ -59,7 +59,7 @@ function(_find_llvm_cov_tools) endfunction() function(setup_target_for_coverage_llvm) - set(oneValueArgs NAME FORMAT BASE_DIRECTORY) + set(oneValueArgs NAME FORMAT) set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) cmake_parse_arguments(Cov "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) From 0342badb5dea90c4f119bb2d97d082205d67f65a Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:27:01 +0700 Subject: [PATCH 10/17] Revert "chore(cov): drop ... .disabled file edit" (partial) restore the conan_deps_cxxflags addition to xahau-ga-macos.yml.disabled. prior commit framed it as dead code, but the .disabled rename is itself a TEMP measure being reverted before merge - the field is needed for the macOS workflow to keep building grpc 1.50.1 once it's re-enabled, since the unconditional workaround was removed from the dependencies action. --- .github/workflows/xahau-ga-macos.yml.disabled | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml.disabled index 65d5470934..4748abdeda 100644 --- a/.github/workflows/xahau-ga-macos.yml.disabled +++ b/.github/workflows/xahau-ga-macos.yml.disabled @@ -107,6 +107,9 @@ jobs: compiler: apple-clang compiler_version: ${{ steps.detect-compiler.outputs.compiler_version }} stdlib: libcxx + # grpc 1.50.1 trips this on newer Apple Clang (clang-19+ frontend). + # Drop when grpc is bumped past the fix. + conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' - name: Build uses: ./.github/actions/xahau-ga-build From 10fbafe996da915d44586f1fd166a6b046f03bff Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:36:29 +0700 Subject: [PATCH 11/17] fix(ci): restore conan_deps_cxxflags on macOS workflow reverts part of f8a30c528d - removing this line dropped the apple-clang grpc workaround that the dependencies action used to apply unconditionally before the matrix-driven refactor. the .disabled rename is itself a TEMP measure being reverted before merge, so the field needs to be in place when the macOS workflow comes back. --- .github/workflows/xahau-ga-macos.yml.disabled | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml.disabled index 4748abdeda..fc863a3dfc 100644 --- a/.github/workflows/xahau-ga-macos.yml.disabled +++ b/.github/workflows/xahau-ga-macos.yml.disabled @@ -107,6 +107,11 @@ jobs: compiler: apple-clang compiler_version: ${{ steps.detect-compiler.outputs.compiler_version }} stdlib: libcxx + # Preserves the prior unconditional macOS workaround that lived + # in xahau-ga-dependencies/action.yml before the matrix-driven + # conan_deps_cxxflags refactor. grpc 1.50.1 trips this on Apple + # Clang on the GHA macOS runners. Drop when grpc is bumped. + conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' # grpc 1.50.1 trips this on newer Apple Clang (clang-19+ frontend). # Drop when grpc is bumped past the fix. conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' From 83a6d14f7ad75d79cabe5105219fe9ed8965c9b7 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:40:16 +0700 Subject: [PATCH 12/17] ci: restore matrix-row comments explaining clang-20 + grpc workaround --- .github/workflows/xahau-ga-macos.yml.disabled | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml.disabled index fc863a3dfc..6df2d56cc2 100644 --- a/.github/workflows/xahau-ga-macos.yml.disabled +++ b/.github/workflows/xahau-ga-macos.yml.disabled @@ -107,10 +107,8 @@ jobs: compiler: apple-clang compiler_version: ${{ steps.detect-compiler.outputs.compiler_version }} stdlib: libcxx - # Preserves the prior unconditional macOS workaround that lived - # in xahau-ga-dependencies/action.yml before the matrix-driven - # conan_deps_cxxflags refactor. grpc 1.50.1 trips this on Apple - # Clang on the GHA macOS runners. Drop when grpc is bumped. + # grpc 1.50.1 trips clang-19+ -Werror=missing-template-arg-list-after-template-kw + # on Apple Clang. Drop when grpc is bumped past the fix. conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' # grpc 1.50.1 trips this on newer Apple Clang (clang-19+ frontend). # Drop when grpc is bumped past the fix. From 6b3fb5ea14ae3cc025d902bd75a824dbf3605740 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:41:18 +0700 Subject: [PATCH 13/17] ci: dedupe conan_deps_cxxflags in macOS workflow row prior turn-of-events created two identical conan_deps_cxxflags entries in the same matrix row from overlapping restore commits. keep one. --- .github/workflows/xahau-ga-macos.yml.disabled | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml.disabled index 6df2d56cc2..1ffc62a73b 100644 --- a/.github/workflows/xahau-ga-macos.yml.disabled +++ b/.github/workflows/xahau-ga-macos.yml.disabled @@ -110,9 +110,6 @@ jobs: # grpc 1.50.1 trips clang-19+ -Werror=missing-template-arg-list-after-template-kw # on Apple Clang. Drop when grpc is bumped past the fix. conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' - # grpc 1.50.1 trips this on newer Apple Clang (clang-19+ frontend). - # Drop when grpc is bumped past the fix. - conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' - name: Build uses: ./.github/actions/xahau-ga-build From 3834ec5997d01f30ba8e9192e939d31f47da78cf Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 09:44:48 +0700 Subject: [PATCH 14/17] ci: undisable workflows, drop gcc-13 coverage row, keep clang-20 llvm-cov as sole codecov reporter - restore the 8 .yml.disabled workflows back to .yml - drop the gcc-13 gcov coverage matrix row; native clang-20 llvm-cov is now the only codecov reporter - update minimal_matrix indices to match - remove the TEMP narrowing block that filtered to just the llvm-cov row - log line says '7 configs (build x6 + clang-20 llvm-cov coverage)' to reflect the new shape --- ...ocker.yml.disabled => build-in-docker.yml} | 0 ...s.yml.disabled => check-genesis-hooks.yml} | 0 ...g-format.yml.disabled => clang-format.yml} | 0 ...d.yml.disabled => guard-checker-build.yml} | 0 ...ation.yml.disabled => instrumentation.yml} | 0 ...lization.yml.disabled => levelization.yml} | 0 ....disabled => verify-generated-headers.yml} | 0 ...-macos.yml.disabled => xahau-ga-macos.yml} | 0 .github/workflows/xahau-ga-nix.yml | 28 +++---------------- 9 files changed, 4 insertions(+), 24 deletions(-) rename .github/workflows/{build-in-docker.yml.disabled => build-in-docker.yml} (100%) rename .github/workflows/{check-genesis-hooks.yml.disabled => check-genesis-hooks.yml} (100%) rename .github/workflows/{clang-format.yml.disabled => clang-format.yml} (100%) rename .github/workflows/{guard-checker-build.yml.disabled => guard-checker-build.yml} (100%) rename .github/workflows/{instrumentation.yml.disabled => instrumentation.yml} (100%) rename .github/workflows/{levelization.yml.disabled => levelization.yml} (100%) rename .github/workflows/{verify-generated-headers.yml.disabled => verify-generated-headers.yml} (100%) rename .github/workflows/{xahau-ga-macos.yml.disabled => xahau-ga-macos.yml} (100%) diff --git a/.github/workflows/build-in-docker.yml.disabled b/.github/workflows/build-in-docker.yml similarity index 100% rename from .github/workflows/build-in-docker.yml.disabled rename to .github/workflows/build-in-docker.yml diff --git a/.github/workflows/check-genesis-hooks.yml.disabled b/.github/workflows/check-genesis-hooks.yml similarity index 100% rename from .github/workflows/check-genesis-hooks.yml.disabled rename to .github/workflows/check-genesis-hooks.yml diff --git a/.github/workflows/clang-format.yml.disabled b/.github/workflows/clang-format.yml similarity index 100% rename from .github/workflows/clang-format.yml.disabled rename to .github/workflows/clang-format.yml diff --git a/.github/workflows/guard-checker-build.yml.disabled b/.github/workflows/guard-checker-build.yml similarity index 100% rename from .github/workflows/guard-checker-build.yml.disabled rename to .github/workflows/guard-checker-build.yml diff --git a/.github/workflows/instrumentation.yml.disabled b/.github/workflows/instrumentation.yml similarity index 100% rename from .github/workflows/instrumentation.yml.disabled rename to .github/workflows/instrumentation.yml diff --git a/.github/workflows/levelization.yml.disabled b/.github/workflows/levelization.yml similarity index 100% rename from .github/workflows/levelization.yml.disabled rename to .github/workflows/levelization.yml diff --git a/.github/workflows/verify-generated-headers.yml.disabled b/.github/workflows/verify-generated-headers.yml similarity index 100% rename from .github/workflows/verify-generated-headers.yml.disabled rename to .github/workflows/verify-generated-headers.yml diff --git a/.github/workflows/xahau-ga-macos.yml.disabled b/.github/workflows/xahau-ga-macos.yml similarity index 100% rename from .github/workflows/xahau-ga-macos.yml.disabled rename to .github/workflows/xahau-ga-macos.yml diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index 3130e84b86..fa07d75a55 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -71,19 +71,6 @@ jobs: "configuration": "Debug", "job_type": "build" }, - { - "compiler_id": "gcc-13-libstdcxx", - "compiler": "gcc", - "cc": "gcc-13", - "cxx": "g++-13", - "gcov": "gcov-13", - "compiler_version": 13, - "stdlib": "default", - "configuration": "Debug", - "job_type": "coverage", - "coverage_tool": "gcov", - "coverage_format": "xml" - }, { # Latest stable Clang for the most accurate source-based # coverage mapping (newer language features, fewer bugs in @@ -153,9 +140,8 @@ jobs: # Minimal matrix for PRs and feature branches minimal_matrix = [ full_matrix[1], # gcc-13 (middle-ground gcc) - full_matrix[2], # gcc-13 coverage - full_matrix[3], # clang-20 llvm-cov coverage - full_matrix[4] # clang-14 (mature, stable clang) + full_matrix[2], # clang-20 llvm-cov coverage + full_matrix[3] # clang-14 (mature, stable clang) ] # Determine which matrix to use based on the target branch @@ -230,20 +216,14 @@ jobs: # Select the appropriate matrix if use_full: if force_full: - print(f"Using FULL matrix (7 configs) - forced by [ci-nix-full-matrix] tag") + print(f"Using FULL matrix (7 configs (build x6 + clang-20 llvm-cov coverage)) - forced by [ci-nix-full-matrix] tag") else: - print(f"Using FULL matrix (7 configs) - targeting main branch") + print(f"Using FULL matrix (7 configs (build x6 + clang-20 llvm-cov coverage)) - targeting main branch") matrix = full_matrix else: print(f"Using MINIMAL matrix (3 configs) - feature branch/PR") matrix = minimal_matrix - # TEMP (coverage-llm branch): narrow the matrix to just the new - # clang-20 llvm-cov coverage row so we can iterate on it without - # burning runners on the rest. MUST be reverted before merging. - matrix = [e for e in matrix if e.get("coverage_tool") == "llvm"] - print(f"TEMP override: matrix narrowed to {len(matrix)} llvm-cov row(s)") - # Add runs_on based on job_type for entry in matrix: if entry.get("job_type") == "coverage": From 436a0d55400a253a411eb10b57a7e5108b448844 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 10:13:59 +0700 Subject: [PATCH 15/17] fix(ci): scope conan_deps_cxxflags per Conan package pattern prior shape (bare json list -> 'tools.build:cxxflags=[...]') leaked into the consumer/rippled build via the conan-generated toolchain (CMAKE_CXX_FLAGS_INIT). on macOS, where the build action doesn't override CMAKE_CXX_FLAGS, this would silently apply the workaround flag to rippled itself. reshape the input to a json object keyed by Conan package pattern: {"grpc/*":["-Wno-..."]} action emits package-pattern scoped lines: grpc/*:tools.build:cxxflags=["-Wno-..."] flags only apply while building the matching dependency. consumer toolchain stays clean. python validator rejects the consumer pattern ('&') and malformed shapes. --- .../actions/xahau-ga-dependencies/action.yml | 43 +++++++++++++++---- .github/workflows/xahau-ga-macos.yml | 2 +- .github/workflows/xahau-ga-nix.yml | 6 ++- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/actions/xahau-ga-dependencies/action.yml b/.github/actions/xahau-ga-dependencies/action.yml index 3864a77c5a..d44900ec37 100644 --- a/.github/actions/xahau-ga-dependencies/action.yml +++ b/.github/actions/xahau-ga-dependencies/action.yml @@ -51,9 +51,9 @@ inputs: - libstdcxx - libcxx conan_deps_cxxflags: - description: 'Extra cxxflags applied to Conan dependency builds only (NOT the rippled build). JSON list, e.g. ["-Wno-foo","-Wno-bar"]. Maps to Conan tools.build:cxxflags.' + description: 'Extra cxxflags applied to Conan dependency package builds only (NOT the rippled build). JSON object keyed by Conan package pattern, e.g. {"grpc/*":["-Wno-foo"]}. Maps to :tools.build:cxxflags.' required: false - default: '[]' + default: '{}' outputs: cache-hit: @@ -85,6 +85,8 @@ runs: - name: Configure Conan shell: bash + env: + CONAN_DEPS_CXXFLAGS: ${{ inputs.conan_deps_cxxflags }} run: | # Create the default profile directory if it doesn't exist mkdir -p ~/.conan2/profiles @@ -111,9 +113,11 @@ runs: # [buildenv] + [conf] sections. # Linux pins compiler executables; macOS uses the system toolchain. - # conan_deps_cxxflags (matrix-driven) optionally adds tools.build:cxxflags - # for Conan dependency builds only - typically grpc workarounds for - # newer clang's stricter diagnostics. Does NOT affect the rippled build. + # conan_deps_cxxflags (matrix-driven) optionally adds package-pattern + # scoped tools.build:cxxflags for Conan dependency builds only - typically + # grpc workarounds for newer clang's stricter diagnostics. Because these + # are profile-pattern scoped (e.g. grpc/*:...), they do NOT affect the + # consumer/rippled toolchain generated for the main build. NEED_CONF=0 if [ "${{ inputs.os }}" = "Linux" ] && [ -n "${{ inputs.cc }}" ]; then cat >> ~/.conan2/profiles/default <> ~/.conan2/profiles/default echo "[conf]" >> ~/.conan2/profiles/default fi - echo 'tools.build:cxxflags=${{ inputs.conan_deps_cxxflags }}' >> ~/.conan2/profiles/default + if [ -n "${CONAN_DEPS_CXXFLAGS_LINES}" ]; then + printf '%s\n' "${CONAN_DEPS_CXXFLAGS_LINES}" >> ~/.conan2/profiles/default + fi fi # Display profile for verification diff --git a/.github/workflows/xahau-ga-macos.yml b/.github/workflows/xahau-ga-macos.yml index 1ffc62a73b..01d2c4b6cf 100644 --- a/.github/workflows/xahau-ga-macos.yml +++ b/.github/workflows/xahau-ga-macos.yml @@ -109,7 +109,7 @@ jobs: stdlib: libcxx # grpc 1.50.1 trips clang-19+ -Werror=missing-template-arg-list-after-template-kw # on Apple Clang. Drop when grpc is bumped past the fix. - conan_deps_cxxflags: '["-Wno-missing-template-arg-list-after-template-kw"]' + conan_deps_cxxflags: '{"grpc/*":["-Wno-missing-template-arg-list-after-template-kw"]}' - name: Build uses: ./.github/actions/xahau-ga-build diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index fa07d75a55..e32437feb4 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -89,7 +89,9 @@ jobs: # grpc 1.50.1 uses `Foo::template Bar(...)` without an # angle-bracket arg list; clang-19+ promoted that to # -Werror. Drop when grpc is bumped past the fix. - "conan_deps_cxxflags": ["-Wno-missing-template-arg-list-after-template-kw"] + "conan_deps_cxxflags": { + "grpc/*": ["-Wno-missing-template-arg-list-after-template-kw"] + } }, { "compiler_id": "clang-14-libstdcxx-gcc11", @@ -411,7 +413,7 @@ jobs: cc: ${{ matrix.cc }} cxx: ${{ matrix.cxx }} stdlib: ${{ matrix.stdlib }} - conan_deps_cxxflags: ${{ matrix.conan_deps_cxxflags && toJson(matrix.conan_deps_cxxflags) || '[]' }} + conan_deps_cxxflags: ${{ matrix.conan_deps_cxxflags && toJson(matrix.conan_deps_cxxflags) || '{}' }} gha_cache_enabled: 'false' # Disable caching for self hosted runner - name: Build From c149351ccf76c9b45fea04816b7bbfb89a9edcca Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 10:48:13 +0700 Subject: [PATCH 16/17] ci: bump apt retries to 5 to handle ppa.launchpadcontent.net flakes --- .github/workflows/xahau-ga-nix.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/xahau-ga-nix.yml b/.github/workflows/xahau-ga-nix.yml index e32437feb4..b463258413 100644 --- a/.github/workflows/xahau-ga-nix.yml +++ b/.github/workflows/xahau-ga-nix.yml @@ -268,6 +268,9 @@ jobs: - name: Install build dependencies run: | + # Bump apt's default 3 retries; papers over short upstream blips + # like the recurring ppa.launchpadcontent.net outages. + echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries apt-get update apt-get install -y software-properties-common add-apt-repository ppa:ubuntu-toolchain-r/test -y From 273273d7a233872f0b13c1c87a26d72ef856cda1 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Wed, 6 May 2026 16:27:15 +0700 Subject: [PATCH 17/17] ci: relax patch coverage for PeerImp --- .codecov.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index 191144aae1..064ba46b7d 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -4,3 +4,16 @@ coverage: default: target: 60% threshold: 2% + patch: + default: + target: auto + threshold: 0% + paths: + # PeerImp is historically hard to exercise in the current unit-test + # harness. Keep this list narrow; new testable code should remain + # covered by the default patch gate. + - "!src/xrpld/overlay/detail/PeerImp.cpp" + historically-untested: + target: 0% + paths: + - "src/xrpld/overlay/detail/PeerImp.cpp"