From 436a0d55400a253a411eb10b57a7e5108b448844 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 5 May 2026 10:13:59 +0700 Subject: [PATCH] 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 3864a77c5..d44900ec3 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 1ffc62a73..01d2c4b6c 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 fa07d75a5..e32437feb 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