Repository navigation
Description
Description
cargo deny check resolves the root workspace, and the guard added in #662 checks the same graph against dependency-licenses.csv. Every example under crates/rustc-codegen-cuda/examples/ is its own [workspace], so neither sees any of them. Six examples declare third-party dependencies, pulling 68 distinct crates that are in neither the root dependency graph nor the CSV — and nothing enforces the license policy over any of them.
This is not a violation today, and I want to be precise about that: deny.toml's allow-list (MIT, Apache-2.0, Apache-2.0 WITH LLVM-exception, BSD-2-Clause, BSD-3-Clause, ISC, Unicode-3.0, Zlib) plausibly covers all 68, though I have not resolved each crate's license to confirm it. The problem is that if it did not, no gate would say so.
Where the 68 come from
| Example | Uncovered crates | Direct declarations |
|---|---|---|
cutile_inter_kernel |
62 | cutile, cutile-compiler, cutile-cuda-core (git), tokio |
hashmap_v2 |
5 | rayon |
hashmap_v3 |
5 | rayon |
async_mlp |
2 | tokio |
async_vecadd |
2 | tokio |
libm_math |
1 | libm |
cutile_inter_kernel dominates because the cutile-rs git dependency pulls a large transitive graph — wasm-bindgen, wit-bindgen, wasmparser, windows-targets, parking_lot, rand, phf, and so on. The others are small: rayon brings crossbeam-*, tokio brings mio/socket2.
half and hashbrown are not in this list — they already appear in the root graph, so they are covered.
Why this is in scope
#662 established that the CSV legitimately records crates from outside the root workspace: libmathdx-sys lives under examples/mathdx_ffi_test/ and has a row. So "examples are out of scope" is not the existing convention.
These crates are also not hypothetical — they are compiled by a documented workflow. cargo oxide run cutile_inter_kernel builds all 62, and scripts/smoketest.sh builds them on every full run.
Expected behavior
Either the license policy covers third-party code compiled from this tree, or the exemption is written down. Right now the gate silently stops at the root workspace boundary.
Suggested fix
Extend scripts/check-dependency-licenses.sh with a second assertion: for each example workspace, every package in its Cargo.lock must appear in the root graph, in the CSV, or be first-party. That is pure lock-file parsing — no cargo metadata, no network, no build scripts — so it runs in the same CPU-only job the #662 guard already uses, and it is self-maintaining: the next example that adds a dependency fails until its rows land.
It also correctly ignores the 172 examples that declare only path dependencies, so the check is over 6 workspaces in practice rather than 178.
One scope decision for you
Adding the 68 rows is mechanical but cutile_inter_kernel contributes 62 of them, which is a large block of wasm-bindgen/wit-bindgen machinery that exists only because one example links a git dependency. Two defensible answers:
- Record them. The CSV becomes a complete inventory of third-party code compiled from the tree.
- Gate but exempt. Add the check, and let an example declare its deps out of inventory scope — on the grounds that examples are not distributed artifacts — with the exemption recorded in the file rather than implied by a workspace boundary.
I lean towards (1) for the five small examples and would rather hear your preference on cutile_inter_kernel than guess, since it is the one that meaningfully grows the file. Happy to implement either.
Related
Same shape as #643, #645 and #661 — a guard whose coverage silently stopped short of what it appeared to check.
Also noted while measuring, and not proposed for action here: crates/rustc-codegen-cuda is its own workspace too, but its 93-package graph is a strict subset of the root's 160, so cargo deny check already covers every third-party crate the shipped backend uses. Only the first-party rustc_codegen_cuda crate itself lacks a CSV row.
Environment
- Measured at
e28248c1 - No GPU, CUDA toolkit or LLVM required; figures come from parsing
Cargo.lockfiles
Activity
ci: extend the license inventory guard to the example workspaces (#664)
vyncint commentedon Aug 6, 2026
Measured this properly, and two things in my original report need correcting — plus the answer to the open question turns out to be no.
The count was 68; it is actually 131. I only counted the six examples with declared third-party dependencies. The real figure is the delta between each example lock and the root graph, which pulls in transitive build-dep graphs I missed (
bindgen,clang-sys,libloading,zerocopy, …). Root workspace resolves 139 third-party crates; the example workspaces add 131 distinct crates beyond it, and all 187 examples add at least one.I wrote "This is not a violation today". That was wrong. Running the policy over every example workspace finds a live advisory:
It affects
hashmap_v2andhashmap_v3. Nothing reports it, exactly as the issue predicted — I just did not expect to find one.Full result: 186 of 187 example workspaces satisfy
deny.tomlunchanged once that advisory is fixed. The remaining one iscutile_inter_kernel, which genuinely cannot:The first needs cutile-rs in
[sources] allow-git; the second needs a license field on a crate this repo does not own. Both are your calls, so I have left it exempt rather than loosening the policy.PR coming that closes the policy half: a guard running
cargo deny checkper example workspace, and thecrossbeam-epochbump so it lands green. #664 already closed the inventory half.ci: enforce deny.toml over the example workspaces
ci: enforce deny.toml over the example workspaces (#681)
vyncint commentedon Aug 10, 2026
Resolved. Both halves are enforced in CI now:
scripts/check-dependency-licenses.sh, which reads the examplelock files directly and requires a CSV row per third-party crate. On current
main it reports
dependency-licenses.csv also covers every third-party crate the example workspaces pull.example-policyjob, which runscargo deny checkovereach example workspace — the 131 crates the root check could not reach because
every example sets its own
[workspace].cargo-deny.ymlnow names this issue directly in its header comment, so thegap this tracked is both closed and documented at the point of enforcement.
ci: both license guards still defer to #663, which is closed (#955)