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

Closed
sombraSoft wants to merge 1 commit from upstream-pr/276 into main
sombraSoft commented 2026-11-23 22:17:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by sombraSoft on 2026-11-23T22:17:01Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5462181772 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/276). Originally posted by [sombraSoft](https://github.com/sombraSoft) on 2026-11-23T22:17:01Z. --- 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.
throny commented 2026-11-24 21:09:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-24T20:15:38Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7143265584 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/276#issuecomment-7143265584). Originally posted by [throny](https://github.com/throny) on 2026-11-24T20:15:38Z. --- <!-- 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.
DavidM1911 commented 2026-11-25 15:08:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:03:38Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7166239881 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/276#issuecomment-7166239881). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T15:03:38Z. --- 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!
github-actions[bot] commented 2026-11-29 20:43:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:43:43Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262310710 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/276#issuecomment-7262310710). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:43:43Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 03:03:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:03:16Z.


Triage (#1607) – head bb232e4

#599 (draft) also adds cargo-deny with a deny.toml, but checks only licences and sources with a wider allowlist; this PR also checks bans and runs advisories on a daily schedule. Different approaches, not a duplicate.
Problem: deny.toml is written for a GPL-2.0-only XCL (allowlist GPL-2.0-only, MIT, BSD-2-Clause, Unicode-3.0; Apache-2.0 refused). Main relicensed to GPL-3.0-or-later in #3002 (Cargo.toml: license = "GPL-3.0-or-later"), so after a rebase check licenses would reject the workspace's own three crates and fail the deny job on every PR, and the policy (no Apache-2.0) no longer matches CONTRIBUTING.md. The allowlist and the comments in deny.toml / ci.yml need updating to the GPL-3.0 policy. The PR also conflicts with main.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7299271916 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/276#issuecomment-7299271916). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:03:16Z. --- **Triage (#1607)** – head bb232e4 #599 (draft) also adds cargo-deny with a `deny.toml`, but checks only licences and sources with a wider allowlist; this PR also checks bans and runs advisories on a daily schedule. Different approaches, not a duplicate. Problem: `deny.toml` is written for a GPL-2.0-only XCL (allowlist `GPL-2.0-only`, `MIT`, `BSD-2-Clause`, `Unicode-3.0`; Apache-2.0 refused). Main relicensed to GPL-3.0-or-later in #3002 (`Cargo.toml`: `license = "GPL-3.0-or-later"`), so after a rebase `check licenses` would reject the workspace's own three crates and fail the `deny` job on every PR, and the policy (no Apache-2.0) no longer matches CONTRIBUTING.md. The allowlist and the comments in `deny.toml` / `ci.yml` need updating to the GPL-3.0 policy. The PR also conflicts with main. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!273
No description provided.