CI: check dependency licences, bans and sources with cargo-deny #276

Open
github-bot wants to merge 1 commit from github-bot/gh-276 into main AGit
Owner

@⁠sombraSoft on GitHub · 2026-11-23 22:17 UTC · original
sombraSoft:ci/cargo-deny → main · +96 −1 · 3 files · 1 commits · open

CONTRIBUTING.md requires every dependency to be GPL-2.0-compatible (no Apache-2.0-only, no GPL-3.0), but nothing checks it. This turns the rule into a cargo-deny check that blocks PRs. A separate workflow checks RustSec advisories daily, so a new advisory does not turn unrelated PRs red.

Part of #265

What is in it

  • deny.toml:
    • The graph is limited to x86_64-pc-windows-msvc.
    • Licence allowlist: MIT, BSD-2-Clause (retour), Unicode-3.0 (unicode-ident), and GPL-2.0-only (the workspace crates). Apache-2.0 on its own is not allowed; MIT OR Apache-2.0 crates pass through MIT.
    • Wildcard versions are denied and only crates.io is allowed. Duplicate versions only warn (windows-sys 0.52 / 0.61, syn 2 / 3).
    • Advisories: vulnerabilities, yanked, unmaintained and unsound all fail.
  • .github/workflows/ci.yml: a new deny job (ubuntu-latest, EmbarkStudios/cargo-deny-action@v2, check bans licenses sources). The header comment lists it.
  • .github/workflows/advisories.yml: check advisories runs daily, on workflow_dispatch, and on pushes / PRs that touch Cargo.lock, deny.toml or the workflow.

CI time

  • 0 wall time: the deny job runs in parallel on Ubuntu and takes 19 s. The advisories workflow (22 s) runs only daily and on PRs that change Cargo.lock, deny.toml or the workflow.

Tested

  • cargo deny check (cargo-deny 0.22.0, Windows): advisories ok, bans ok, licenses ok, sources ok, plus the 2 duplicate warnings (syn, windows-sys). Every crate's licence was checked: 50 pass through MIT, and retour, unicode-ident and the 3 workspace crates use the other entries above.
  • Fork CI: Dependencies (cargo-deny) green (https://github.com/sombraSoft/xcl/actions/runs/45276856646), Advisories green (https://github.com/sombraSoft/xcl/actions/runs/45276857241).
  • Full suite on main (9ab7d76), RTX 3060 Ti (driver 621.24), Ryzen 9 5900X, Windows 11, rustc 1.97.1, debug: scripts/test.ps1 → 651 passed, 0 failed, 40 ignored; SKIPPED: 2 (no wave64). This PR changes only CI config, so the compiled code is the same.

Regression run

  • Not needed: no crates/xcl/src change.

Not tested

  • The scheduled trigger; only the pull_request trigger ran.
  • A failing case (such as an Apache-2.0-only crate) was not tried in CI.
  • A future dependency under another GPL-2.0-compatible licence (ISC, Zlib, BSD-3-Clause, …) will need its licence added to the allowlist. That is intended: each new licence gets a look.

AI use

  • Claude Code (Claude Opus 5.5) wrote the config, the workflows and this description; I read the diff.
**@⁠sombraSoft** on GitHub · 2026-11-23 22:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/276) `sombraSoft:ci/cargo-deny` → `main` · +96 −1 · 3 files · 1 commits · open CONTRIBUTING.md requires every dependency to be GPL-2.0-compatible (no Apache-2.0-only, no GPL-3.0), but nothing checks it. This turns the rule into a cargo-deny check that blocks PRs. A separate workflow checks RustSec advisories daily, so a new advisory does not turn unrelated PRs red. Part of #265 **What is in it** - `deny.toml`: - The graph is limited to `x86_64-pc-windows-msvc`. - Licence allowlist: MIT, BSD-2-Clause (retour), Unicode-3.0 (unicode-ident), and GPL-2.0-only (the workspace crates). Apache-2.0 on its own is not allowed; `MIT OR Apache-2.0` crates pass through MIT. - Wildcard versions are denied and only crates.io is allowed. Duplicate versions only warn (windows-sys 0.52 / 0.61, syn 2 / 3). - Advisories: vulnerabilities, yanked, unmaintained and unsound all fail. - `.github/workflows/ci.yml`: a new `deny` job (ubuntu-latest, `EmbarkStudios/cargo-deny-action@v2`, `check bans licenses sources`). The header comment lists it. - `.github/workflows/advisories.yml`: `check advisories` runs daily, on `workflow_dispatch`, and on pushes / PRs that touch `Cargo.lock`, `deny.toml` or the workflow. **CI time** - 0 wall time: the `deny` job runs in parallel on Ubuntu and takes 19 s. The advisories workflow (22 s) runs only daily and on PRs that change `Cargo.lock`, `deny.toml` or the workflow. **Tested** - `cargo deny check` (cargo-deny 0.22.0, Windows): `advisories ok, bans ok, licenses ok, sources ok`, plus the 2 duplicate warnings (syn, windows-sys). Every crate's licence was checked: 50 pass through MIT, and retour, unicode-ident and the 3 workspace crates use the other entries above. - Fork CI: `Dependencies (cargo-deny)` green (https://github.com/sombraSoft/xcl/actions/runs/45276856646), `Advisories` green (https://github.com/sombraSoft/xcl/actions/runs/45276857241). - Full suite on `main` (9ab7d76), RTX 3060 Ti (driver 621.24), Ryzen 9 5900X, Windows 11, rustc 1.97.1, debug: `scripts/test.ps1` → 651 passed, 0 failed, 40 ignored; SKIPPED: 2 (no wave64). This PR changes only CI config, so the compiled code is the same. **Regression run** - Not needed: no `crates/xcl/src` change. **Not tested** - The scheduled trigger; only the `pull_request` trigger ran. - A failing case (such as an Apache-2.0-only crate) was not tried in CI. - A future dependency under another GPL-2.0-compatible licence (ISC, Zlib, BSD-3-Clause, …) will need its licence added to the allowlist. That is intended: each new licence gets a look. **AI use** - Claude Code (Claude Opus 5.5) wrote the config, the workflows and this description; I read the diff.
CONTRIBUTING.md requires every dependency to be GPL-2.0-compatible (no
Apache-2.0-only, no GPL-3.0), but nothing checked it: a new crate, or an
update that changes a crate's licence, could land unnoticed. deny.toml
turns the rule into an allowlist (BSD-2-Clause, GPL-2.0-only, MIT,
Unicode-3.0: the licences the current graph needs). Apache-2.0 is not on
it; `MIT OR Apache-2.0` crates pass through MIT. The same file refuses
wildcard versions and crates from anywhere but crates.io, and reports
duplicate versions (windows-sys 0.52 / 0.61, syn 2 / 3) without failing.

ci.yml runs `cargo deny check bans licenses sources` on Linux for every
push and pull request. RustSec advisories run in advisories.yml (daily,
by hand, and when Cargo.lock, deny.toml or that workflow changes): a new
advisory changes the result without any change to the repository and
should not turn unrelated pull requests red.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:18:27 +00:00
Author
Owner

@⁠throny on GitHub · 2026-11-24 20:15 UTC · original

Two contributors checked independently and found that #599 solves the same problem (for #265) in a different way: #1607, group D37. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-24 20:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/276#issuecomment-7143265584) <!-- xcl-1607-hint:D37 --> Two contributors checked independently and found that #599 solves the same problem (for #265) in a different way: #1607, group D37. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 15:03 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 15:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/276#issuecomment-7166239881) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/276/head:github-bot/gh-276'
git switch 'github-bot/gh-276'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-276'
git switch 'github-bot/gh-276'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-276'
git switch 'github-bot/gh-276'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-276'
git switch 'main'
git merge --squash 'github-bot/gh-276'
git switch 'main'
git merge --ff-only 'github-bot/gh-276'
git switch 'main'
git merge 'github-bot/gh-276'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.