Skip to content

Commit 6c00348

Browse files
rizsottoclaude
andcommitted
ci: fold the license check into the audit job via cargo-deny
Restores the dependency license check that went away with the copyright job, this time as a gate rather than a report. Every dependency is statically linked into GPL-3.0-or-later binaries, so each one has to carry a GPL-3.0-compatible license, and the alternative to checking is hearing about it from a distribution packager after release. cargo-deny covers advisories as well, so it replaces cargo-audit outright and the two jobs become one. Verified equivalent on the advisory side: against the lock this branch carried before 64967a7, it reports RUSTSEC-2026-0204 on crossbeam-epoch 0.9.18 and exits non-zero, which is what cargo audit did. Pin unmaintained, unsound, and yanked in the config rather than inheriting them. cargo-deny defaults unsound to the workspace alone and yanked to a warning, both looser than the cargo audit --deny warnings the job ran until now; stating all three keeps a later cargo-deny upgrade from relaxing the gate without anyone noticing. The allow list holds only what the current tree needs. BSD-3-Clause and Unicode-3.0 each look droppable but sit inside AND expressions, where the permissive alternative cannot satisfy the requirement alone. cargo-deny reports an allowance nothing matches, so an entry that stops being needed will say so. Name the config .deny.toml. cargo-deny looks for deny.toml, .deny.toml, then .cargo/deny.toml, so the dotfile needs no --config flag and matches how .rustfmt.toml and .codespellrc already sit in the tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent eeb48a8 commit 6c00348

2 files changed

Lines changed: 41 additions & 5 deletions

File tree

.deny.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
# Every dependency is statically linked into GPL-3.0-or-later binaries,
4+
# so each one has to carry a GPL-3.0-compatible license. CI gates on
5+
# this because the alternative is finding out from a distribution
6+
# packager, after release, that the linked result cannot be shipped.
7+
#
8+
# The list is deliberately minimal: each entry is load-bearing for the
9+
# current tree, and cargo-deny reports any allowance nothing matches, so
10+
# a stale entry does not sit here unnoticed. A dependency that needs a
11+
# new entry is a decision worth making explicitly rather than a default
12+
# worth inheriting.
13+
[licenses]
14+
allow = [
15+
"MIT",
16+
"Apache-2.0",
17+
# Both of these appear only inside AND expressions, where the
18+
# permissive alternative cannot satisfy the requirement on its own:
19+
# encoding_rs is "(Apache-2.0 OR MIT) AND BSD-3-Clause", and
20+
# unicode-ident is "(MIT OR Apache-2.0) AND Unicode-3.0".
21+
"BSD-3-Clause",
22+
"Unicode-3.0",
23+
# Bear's own crates. Nine of the eleven are publishable, so they are
24+
# part of the graph cargo-deny walks.
25+
"GPL-3.0-or-later",
26+
]
27+
28+
# Stated rather than inherited. These three carry the whole weight of the
29+
# advisory gate, and two of cargo-deny's defaults are looser than what
30+
# this job enforced when it ran cargo-audit: unsound defaults to the
31+
# workspace only, and yanked to a warning. Pinning them keeps a
32+
# cargo-deny upgrade from quietly relaxing the gate.
33+
[advisories]
34+
unmaintained = "all"
35+
unsound = "all"
36+
yanked = "deny"

.github/workflows/build_rust.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
- name: Run Codespell
8686
run: codespell
8787

88-
security-audit:
89-
name: Security Audit
88+
audit:
89+
name: Audit
9090
runs-on: ubuntu-latest
9191
steps:
9292
- uses: actions/checkout@v7
@@ -95,6 +95,6 @@ jobs:
9595
toolchain: stable
9696
- uses: taiki-e/install-action@v2
9797
with:
98-
tool: cargo-audit
99-
- name: Run Cargo Audit
100-
run: cargo audit --deny warnings
98+
tool: cargo-deny
99+
- name: Run Cargo Deny
100+
run: cargo deny check advisories licenses

0 commit comments

Comments
 (0)