Repository navigation
ci: cargo-deny reaches two of the three non-example workspace roots - #1043
Merged
nihalpasham merged 1 commit intoAug 19, 2026
Merged
Conversation
`cargo deny check` stops at a `[workspace]` boundary, which is why this workflow already runs it twice: once at the root and once for crates/rustc-codegen-cuda. There is a third such root under version control that resolves third-party crates, and nothing judges it. `crates/cuda-macros/tests/device-only` declares its own `[workspace]` on purpose -- the fixture exists to prove a graph that does *not* contain cuda-host (NVIDIA#701/NVIDIA#702), so it must resolve independently rather than share the root lock. That same boundary puts it outside all three existing runs: the root `cargo deny check` stops at it, the backend run names a different manifest, and `check-example-license-policy.sh` walks `crates/rustc-codegen-cuda/examples` only. The gap is not theoretical. Comparing its lock against both governed locks: proc-macro2 fixture 1.0.107 root 1.0.106 backend 1.0.106 quote fixture 1.0.47 root 1.0.45 backend 1.0.44 syn fixture 2.0.119 root 2.0.117 backend 2.0.114 unicode-ident fixture 1.0.24 root 1.0.24 backend 1.0.22 Three of its four third-party `(name, version)` pairs appear in neither governed lock, so no advisory, license, ban or source policy has ever been applied to them. `(name, version, source)` is this repo's own unit of policy -- it is the grouping key `check-example-license-policy.sh` uses to argue its 26-runs-for-187-workspaces equivalence -- so a version present nowhere else is a distinct policy question, not a duplicate. Add the third run, with `--locked` like the other two: a check that can rewrite its own input is not a check, and verified here, deleting a package block from that lock makes the run stop with "cannot update the lock file" rather than silently re-resolving. `crates/fuzzer/rustlantis` is the one remaining `[workspace]` root and is deliberately left out: it is a vendored upstream project rather than first-party code, so bringing its graph under deny.toml is a policy call for a maintainer, not a gap to close silently. Two present-tense counts in this file had also drifted and are corrected against the current tree: the backend workspace resolves 88 third-party crates, not 82 (`cargo metadata --manifest-path crates/rustc-codegen-cuda/Cargo.toml`, packages with a non-null source), and the example-policy script is 31 runs over 217 lock files, not 26 over 187. Verified: the new invocation reports `advisories ok, bans ok, licenses ok, sources ok` and exits 0 on today's tree, so main stays green; every workflow still parses; and `just check-guards` carries the same third run so the local mirror keeps predicting CI. Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
nihalpasham
approved these changes
Aug 19, 2026
nihalpasham
added a commit
that referenced
this pull request
Aug 20, 2026
…ed in a day (#1055) * ci: four tooling comments keep tree sizes by hand, and all four drifted in a day #1032 added one example, `redux_f32`, and eight catalog entries. That single merge falsified numbers in four places: | site | said | now | |---|--:|--:| | `check-example-license-policy.sh` (x3) | 217 locks | 218 | | `check-example-license-policy.sh` (x2) | 215 examples | 216 | | `check-example-license-policy.sh` | 13871 packages, floor 2170 | 13934, 2180 | | `cargo-deny.yml` | 31 runs instead of 217 | ... of 218 | | `Justfile` | 986 catalog entries | 1010 | | `examples-compile.yml` | 210 example crates | 216 | Six of those transcriptions are mine, from #1043 and #1044, written the day before. Refreshing them buys one day. The counts are not load-bearing in any of the four -- each is there to make a structural point -- so state the structure and let the code report the numbers: - The license-policy guard already announced its representative count. It now announces the lock count beside it, so the grouping ratio is observable output rather than a comment to keep in step: Checking deny.toml over 31 representative example workspaces, grouped from 218 example lock files. - Its scope comment and its enumeration cross-check now say "one lock per example directory, plus one per nested sub-workspace" instead of naming today's totals. - The parsed-package floor is computed as ten per lock, so the comment says that rather than quoting the current product. - `cargo-deny.yml` says one run per distinct dependency set instead of one per lock file, and points at the script's own output. - The `Justfile` comment's point was that the generated path dominates, which 35 generated op modules against 7 hand-written makes without an entry count. Module counts are structural and have not moved through any of these merges. - `examples-compile.yml`'s number only justified a timeout, so "every example crate" does the same job. One number is kept and re-labelled rather than removed: the `[a-m]*` glob illustration in the cross-check comment now reads "measured once ... 137 of the 217 locks then present", matching the timestamped-measurement idiom the same file already uses two paragraphs above. The argument needs a concrete ratio; making it explicitly historical stops it being a live claim. Verified: the guard passes unchanged -- 31 representatives grouped from 218 lock files, `deny.toml holds over every example workspace outside POLICY_EXEMPT_EXAMPLES`, exit 0. `bash -n` clean, `just --list` parses, all eleven workflows parse, and dialect-nvvm really does hold 35 generated and 7 hand-written op modules. Signed-off-by: Vyncint Ng <[email protected]> * ci: correct the floor-margin claim and tighten the rewritten tooling comments --------- Signed-off-by: Vyncint Ng <[email protected]> Co-authored-by: nihalpasham <[email protected]>
nihalpasham
pushed a commit
that referenced
this pull request
Aug 21, 2026
… roots (#1114) `check-dependency-licenses.sh` builds its required set from two manifests: required="$( { declared_crates Cargo.toml declared_crates crates/rustc-codegen-cuda/Cargo.toml } | LC_ALL=C sort -u )" and the comment above it says "Both first-party workspaces, not just the root one". There are three. `cargo metadata` stops at a `[workspace]` boundary, so one pass per root is the only way to reach them all, and `crates/cuda-macros/tests/device-only` declares its own `[workspace]` on purpose: the fixture exists to prove a graph that does *not* contain `cuda-host` (#701/#702), so it must resolve independently rather than share the root lock. That boundary puts it outside both passes. The gap is live, not theoretical. Its member `device-only-kernels` has no row in `dependency-licenses.csv`, and adding the third pass says so immediately: error: dependency-licenses.csv is missing a row for: device-only-kernels `publish = false` is not what excluded it -- `cuda-intrinsics-gen` and `reserved-oxide-symbols` are both unpublished root members and both have rows. The only reason it was absent is that no pass ever looked at that workspace. This is #1043's gap in the sibling guard. That fix taught `cargo deny check` the third root, which governs the license *policy* over the resolved graph. This guard covers the other half, stated in its own header: "that the human-readable inventory does not silently fall behind what the workspace declares." Both halves need all three roots, and until now only one had them. What it protects going forward: the fixture currently declares nothing but two first-party path dependencies, so the one missing row is the whole of today's drift. But a third-party dependency added there would have been recorded nowhere -- cargo-deny would judge its policy and the inventory would stay silent, which is exactly the asymmetry this pair of guards exists to prevent. Changes: * the third `declared_crates` pass, plus a rewritten comment that enumerates all three roots and says why each is separate, so the next reader does not have to rediscover that `cargo metadata` stops at the boundary; * the `device-only-kernels` row, matching the column layout of the other first-party rows and inserted in sort position. Verified, both directions: * drop the CSV row, keep the third pass -> fails naming `device-only-kernels`; * keep the row, drop the third pass -> reports "OK: ... all 58 declared crates" while blind to that workspace, which is the state being fixed; * restored -> "OK: dependency-licenses.csv records all 59 declared crates" and the example half unchanged. `scripts/check-example-license-policy.sh`, the other consumer of the CSV, still reports "OK: deny.toml holds over every example workspace". `bash -n` clean. Signed-off-by: Vyncint Ng <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cargo deny checkstops at a[workspace]boundary, which is why this workflow already runs it twice: once at the root and once forcrates/rustc-codegen-cuda. There is a third such root under version control that resolves third-party crates, and nothing judges it.crates/cuda-macros/tests/device-onlydeclares its own[workspace]on purpose — the fixture exists to prove a graph that does not containcuda-host(#701/#702), so it must resolve independently rather than share the root lock. That same boundary puts it outside all three existing runs:cargo deny checkstops at it,check-example-license-policy.shwalkscrates/rustc-codegen-cuda/examplesonly.The gap is not theoretical
Its lock against both governed locks:
proc-macro2quotesynunicode-identThree of its four third-party
(name, version)pairs appear in neither governed lock, so no advisory, license, ban or source policy has ever been applied to them.(name, version, source)is this repo's own unit of policy — it is the grouping keycheck-example-license-policy.shuses to argue its runs-for-workspaces equivalence — so a version present nowhere else is a distinct policy question, not a duplicate.What this does
Adds the third run with
--locked, like the other two. A check that can rewrite its own input is not a check, and verified here: deleting a package block from that lock makes the run stop withcannot update the lock filerather than silently re-resolving.crates/fuzzer/rustlantisis the one remaining[workspace]root and is deliberately left out: it is a vendored upstream project rather than first-party code, so bringing its graph underdeny.tomlis a policy call for a maintainer, not a gap to close silently. The header comment now records which roots are in scope and why.Two present-tense counts in this file had also drifted and are corrected against the current tree:
cargo metadata --manifest-path crates/rustc-codegen-cuda/Cargo.toml, packages with a non-nullsource);Verification
advisories ok, bans ok, licenses ok, sources okand exits 0 on today's tree, somainstays green.just check-guardscarries the same third run, so the local mirror keeps predicting CI.f1e62fe2.