Skip to content

Commit 2b71376

Browse files
author
Guillaume Lessard
committed
fix(ci): the licence gate never ran, and aarch64 needs __ARM_ARCH
cargo deny has been failing to start on every run. In 0.18 `--config` belongs to the `check` subcommand, not the global level, so the invocation died with "unexpected argument '--config' found" and exit 2. Because the step runs under `set +e` and only enforces when `strict`, non-strict runs downgraded that to a warning and dependency-audit reported success - so the licence/bans/sources gate has executed nothing at all, and neither has the informational advisory scan. Both invocations fixed. Also stop a broken gate from ever looking like a clean one: exit >1 is clap saying the tool never ran, which is not a policy finding and is now a hard failure in every mode. Only a real violation (exit 1) remains subject to strict. The informational leg stays non-blocking but now says plainly when the scan did not run, instead of printing nothing and implying all-clear. aarch64: my previous sccache theory was wrong. The failure reproduced with the compiler invoked directly, so sccache was never the cause. ring 0.17's asm_base.h hard-errors because the manylinux cross-gcc does not predefine __ARM_ARCH when assembling chacha-armv8-linux64.S; define it for that target. ring is already at its newest compatible version, so there is nothing to bump.
1 parent a3b0ad2 commit 2b71376

2 files changed

Lines changed: 33 additions & 9 deletions

File tree

.github/workflows/dependency-audit.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,23 @@ jobs:
111111
STRICT: ${{ inputs.strict == true }}
112112
run: |
113113
set +e
114-
cargo deny --all-features --config .github/deny.toml check licenses bans sources
114+
# `--config` belongs to the `check` subcommand in cargo-deny 0.18;
115+
# `--all-features` stays global. It used to sit before `check`, which
116+
# 0.18 rejects with "unexpected argument '--config' found" and exit 2.
117+
cargo deny --all-features check --config .github/deny.toml licenses bans sources
115118
rc=$?
116119
set -e
120+
121+
# Exit 2 is clap: cargo deny never ran. That is NOT a policy warning,
122+
# and downgrading it to one is how a broken invocation went unnoticed -
123+
# non-strict runs reported success while the licence gate executed
124+
# nothing at all. A gate that cannot run is always a hard failure,
125+
# in every mode; only an actual policy violation (exit 1) is subject
126+
# to `strict`.
127+
if [ "$rc" -gt 1 ]; then
128+
echo "::error title=cargo deny::cargo deny failed to execute (exit $rc) - the licence/bans/sources gate did NOT run. This is never downgraded to a warning."
129+
exit "$rc"
130+
fi
117131
if [ "$rc" -ne 0 ]; then
118132
if [ "$STRICT" = "true" ]; then
119133
echo "::error title=cargo deny::Licence/source policy violation. Release blocked. Update .github/deny.toml AND NOTICE.md only after a deliberate legal review."
@@ -128,10 +142,17 @@ jobs:
128142
- name: cargo deny (informational advisories, never blocking)
129143
run: |
130144
set +e
131-
cargo deny --all-features --config .github/deny.toml check advisories
145+
# Same 0.18 flag-position fix as the gating step above.
146+
cargo deny --all-features check --config .github/deny.toml advisories
132147
rc=$?
133148
set -e
134-
if [ "$rc" -ne 0 ]; then
149+
# This leg never blocks, by design. But distinguish "advisories found"
150+
# from "the scan did not run": the latter reported a clean warning for
151+
# as long as the invocation was malformed, which is indistinguishable
152+
# from good news in the log.
153+
if [ "$rc" -gt 1 ]; then
154+
echo "::warning title=cargo deny advisories::cargo deny failed to execute (exit $rc) - the informational advisory scan did NOT run. Not blocking, but the absence of findings below means nothing."
155+
elif [ "$rc" -ne 0 ]; then
135156
echo "::warning title=cargo deny advisories::Informational RustSec advisories present (unmaintained/unsound/notice). Advisory only — never blocks. Triage at the quarterly review."
136157
fi
137158

.github/workflows/release-build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,15 @@ jobs:
8888
--out dist
8989
--no-default-features
9090
--features abi3${{ matrix.features && format(',{0}', matrix.features) || '' }}
91-
# sccache is disabled for the Linux aarch64 cross-build. Wrapping the
92-
# cross-assembler breaks ring's .S files: `aarch64-unknown-linux-gnu-gcc`
93-
# is invoked on chacha-armv8-linux64.S without __ARM_ARCH defined, and
94-
# ring's asm_base.h then fails the build outright with
95-
# `#error "ARM assembler must define __ARM_ARCH"`. Native aarch64
96-
# (macos-14) is unaffected and keeps the cache.
91+
# Linux aarch64 cross-build: ring 0.17's asm_base.h hard-errors with
92+
# `#error "ARM assembler must define __ARM_ARCH"` because the
93+
# cross-gcc in the manylinux container does not predefine it when
94+
# assembling chacha-armv8-linux64.S. Define it explicitly for that one
95+
# target. (sccache was suspected first and ruled out - the failure
96+
# reproduced with the compiler invoked directly.) ring is already at
97+
# its newest version compatible with this tree, so there is nothing to
98+
# bump instead.
99+
docker-options: ${{ (matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64') && '-e CFLAGS_aarch64_unknown_linux_gnu=-D__ARM_ARCH=8 -e CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-gcc' || '' }}
97100
sccache: ${{ !(matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64') }}
98101

99102
- name: Show built wheels

0 commit comments

Comments
 (0)