Repository navigation
ci(licenses): the guard's own workspace-root list is a claim nothing checks - #1132
Merged
nihalpasham merged 2 commits intoAug 23, 2026
Merged
Conversation
…checks `check-dependency-licenses.sh` reaches each first-party workspace with one `declared_crates` pass per root, because `cargo metadata` stops at a `[workspace]` boundary. Which roots exist was hard-coded, and nothing compared that list against the tree -- which is exactly how the guard has failed twice: * NVIDIA#662 found `crates/rustc-codegen-cuda` unread. The backend, the largest first-party crate in the tree, had no CSV row while every other member did. * NVIDIA#1114 found `crates/cuda-macros/tests/device-only` unread, and its member `device-only-kernels` likewise unrecorded. Both times the guard printed OK. That is the failure mode this repo's guards are built to refuse, and it is the one this guard had: a short list is indistinguishable from a complete one, a count cannot tell them apart, and the comment saying "Both first-party workspaces" was itself the wrong number for months. NVIDIA#1114's review asked for the self-check; this is it. The list becomes two named arrays and is compared against `git ls-files -- '*Cargo.toml'` filtered to manifests declaring `[workspace]`, both directions: * a manifest on disk that no pass reads fails, naming it, and says to add it as first-party or as vendored; * a name in the arrays that is no longer such a manifest fails as stale, since a renamed root left behind is a permanent hole. `crates/fuzzer/rustlantis` is the one vendored root, listed separately with the reason: third-party code attributed in THIRD_PARTY_NOTICES whose dependencies are not ours to record, excluded by `check-spdx-headers.sh` on the same grounds. Roots under `crates/rustc-codegen-cuda/examples` stay out of scope here because the second half of the script already resolves those, including the two nested sub-workspaces, from their committed lock files. Verified, four ways: | mutation | result | |---|---| | drop the device-only root from the list | fails, naming that manifest | | add a name that is not a manifest | fails as stale, naming it | | a new tracked `[workspace]` manifest appears | fails, naming it | | the `[workspace]` scan pattern rots | refuses: "the scan broke, so a clean result means nothing" | Unmutated the guard reports "OK: dependency-licenses.csv records all 59 declared crates" and the example half is unchanged. `bash -n` clean. `git` is added to the `require_tool` list it already uses for `cargo` and `python3`. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
Resolve every tracked manifest through Cargo, compare named non-example roots in both directions, and require each example workspace to have an adjacent tracked lock. Signed-off-by: nihalp <nihalp@nvidia.com>
Collaborator
|
nihalpasham
approved these changes
Aug 23, 2026
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.
Follow-up to #1114, which your review asked for: "This drift has now happened twice (#662, here), so a self-check comparing the pass list against on-disk
[workspace]manifests is follow-up material."What is wrong
check-dependency-licenses.shreaches each first-party workspace with onedeclared_cratespass per root, becausecargo metadatastops at a[workspace]boundary. Which roots exist was hard-coded, and nothing compared that list against the tree. That is how the guard has failed twice:crates/rustc-codegen-cudaunread. The backend — the largest first-party crate in the tree — had no CSV row while every other member did.crates/cuda-macros/tests/device-onlyunread, and its memberdevice-only-kernelslikewise unrecorded.Both times the guard printed OK. A short list is indistinguishable from a complete one, a count cannot tell them apart, and the comment reading "Both first-party workspaces" was itself the wrong number for months.
The change
The list becomes two named arrays, compared against
git ls-files -- '*Cargo.toml'filtered to manifests declaring[workspace], in both directions:crates/fuzzer/rustlantisis the one vendored root, listed separately with the reason: third-party code attributed in THIRD_PARTY_NOTICES whose dependencies are not ours to record, excluded bycheck-spdx-headers.shon the same grounds. Roots undercrates/rustc-codegen-cuda/examplesstay out of scope here — the second half of the script already resolves those, including the two nested sub-workspaces, from their committed lock files.Verification
All local, no GPU.
[workspace]manifest appears (git add -N)[workspace]scan pattern rotsUnmutated:
OK: dependency-licenses.csv records all 59 declared crates, example half unchanged,bash -nclean.gitjoins therequire_toollist next tocargoandpython3.One file. Checked against every open PR's file list via
gh api --paginate .../pulls/N/files— no overlap.Maintainer repair
bash -n, and diff checks pass.