Repository navigation
ci: move the reserved-prefix guard into a script - #835
Merged
Merged
Conversation
`just check` claims to run CI's gates minus a named few, and two of its
recipes were narrower than the jobs they mirror. Both miss
`crates/rustc-codegen-cuda`, which carries its own `[workspace]` for the
rustc_private dylibs so `--workspace` from the root stops at that
boundary. The `test` recipe already handles that crate the same way; these
two never did.
* clippy: CI lints three scopes -- root workspace, the codegen
workspace, and once per example. The recipe ran only the first, and
ran it as `--all-targets --lib --tests`, where the target-selection
flags narrow what `--all-targets` would have covered and so skip bin
and example targets CI lints -- `cuda-host/examples/` among them. Now
`--workspace --all-targets`, matching CI, plus the codegen workspace.
* doc-check: the docs gate builds this workspace's rustdoc separately
under `-D warnings` too. That job is mine, from NVIDIA#725, and I did not
add it here.
The per-example clippy pass stays CI-only, and `check`'s comment now says
so rather than implying clippy is covered in full: it is one clippy run per
example across 200-odd separate workspaces, which belongs in a CI job
rather than in a command someone waits on.
Verified: both widened recipes pass here -- `just clippy` clean across
both workspaces, `just doc-check` builds the codegen rustdoc
warning-free -- so this closes a coverage gap without landing new work.
Signed-off-by: Vyncint Ng <[email protected]>
naming-guard was the last CI gate with real logic and no script: a 50-line shell block inline in the workflow, so it could not be run before pushing, could not be mutation-tested, and `just check` listed it as CI-only for exactly that reason. `scripts/check-reserved-prefixes.sh` is that block, moved verbatim in behaviour -- same pattern, same canary self-test, same grep exit-status handling, same two filters. The reasoning comes with it, and it is worth keeping: it records why bare `cuda_oxide_` is deliberately not matched (pliron attribute keys, rustc `--cfg` names, dlopen probe symbols and temp directories live in that word-space and are not reserved link symbols), why `codegen_v1` needs its own alternation arm, and why a search that cannot run has to fail rather than report an empty result -- the ripgrep incident, where `rg ... || true` turned "command not found" into a clean result on every commit. The workflow now calls the script, `check-guards` runs it, and `check`'s CI-only list drops naming-guard. One deliberate change: the script reports `error:` on stderr like its eight siblings rather than emitting `::error::` annotations, so its output reads the same locally and in CI. The step still fails and the message is still in the log; the PR-annotation nicety is the cost. Verified equivalent, not just similar: identical verdict to the inline pipeline on this tree (no violations from either); an injected literal is caught with file and line; a pure-comment mention is still allowed; and `reserved-oxide-symbols` stays exempt with its 45 legitimate literals. `just check-guards` green with nine guards. Signed-off-by: Vyncint Ng <[email protected]>
vyncint
force-pushed
the
ci/naming-guard-script
branch
from
August 12, 2026 10:32
aaec565 to
cc59cfc
Compare
Collaborator
|
Gist: the last inline CI guard becomes a checked-in script, joining the eight Verified here:
Lands after #834 (this branch stacks it); one stale Justfile docstring line will be tidied at landing. |
Signed-off-by: nihalpasham <[email protected]> # Conflicts: # Justfile
nihalpasham
approved these changes
Aug 12, 2026
nihalpasham
added a commit
that referenced
this pull request
Aug 13, 2026
…s in CI (#853) The open-source review of commit 15fa9d9 confirmed everything from #812 fixed and left two items, both addressed here: 1. Source headers: scripts/check-book-api-names.sh and scripts/check-reserved-prefixes.sh landed after #812 merged (#819, #835) without the standard SPDX header. Both now carry it. 2. Third-party notices: the rangemap sub-crate under crates/fuzzer/rustlantis/ carries its own LICENSE-APACHE and LICENSE-MIT copies, which THIRD_PARTY_NOTICES did not mention. The Rustlantis entry now names that path; both texts are byte-identical to the rustlantis top-level ones. The review also suggested a CI guard, since headers have now drifted twice. scripts/check-spdx-headers.sh requires the two-line header on every tracked *.rs *.sh *.py *.cu *.c *.h *.ll file outside the vendored rustlantis subtree, with a checked exemption for the two CUTLASS-derived BSD-3-Clause helpers the review accepted as-is. It runs as a fourth job of the cargo-deny workflow and from 'just check-guards', and CONTRIBUTING's License Headers section points at it. Signed-off-by: nihalpasham <[email protected]>
This was referenced Aug 16, 2026
nihalpasham
added a commit
that referenced
this pull request
Aug 17, 2026
… not (#957) * build(just): check-guards runs the naming guard too, and says it does not `check-guards` has run `scripts/check-reserved-prefixes.sh` since #835, but both places that describe its scope name only two workflows: # Run the status-guard and cargo-deny CI jobs (needs cargo-deny, python3) # `check-guards` covers the status-guard and cargo-deny workflows in full That script is naming-guard.yml's `reserved-symbols-guard` job, not a status-guard one. The recipe is correct; the description undersells it, which is the direction that costs someone a redundant CI round trip -- a contributor touching a `cuda_oxide_*` literal reads this, concludes the reserved-prefix guard is CI-only, and finds out after pushing. Names all three workflows in both places. The mapping now checks out job for job: status-guard's seven, naming-guard's one, and cargo-deny's four are the eleven scripts plus two `cargo deny` invocations this recipe runs. Comment-only; `just --list` and `just -n check-guards` are unchanged apart from the wording. Signed-off-by: Vyncint Ng <[email protected]> * build(just): repair the check-guards detail paragraph too The paragraph above the recipe still described coverage as status-guard plus "all three cargo-deny jobs": it listed five of status-guard's seven jobs (book-api-names and device-only-build were missing), the cargo-deny workflow has four jobs (the SPDX source-headers job was missing), and the naming-guard's reserved-prefix search went unnamed, which is the same undersell this PR exists to remove. Also widen "either workflow" to all three and rewrap the over-long merged line in the check header comment. --------- Signed-off-by: Vyncint Ng <[email protected]> Co-authored-by: nihalpasham <[email protected]>
nihalpasham
pushed a commit
that referenced
this pull request
Aug 17, 2026
`check-spdx-headers.sh` globs `*.rs *.sh *.py *.cu *.c *.h *.ll`. Eight tracked first-party files fall outside that list and are therefore unchecked: cuda-oxide-book/_static/css/custom.css cuda-oxide-book/_static/css/lightbox.css cuda-oxide-book/_static/css/nvidia-sphinx-theme.css cuda-oxide-book/_static/js/lightbox.js cuda-oxide-book/_static/js/spa-nav.js cuda-oxide-book/_templates/footer.html cuda-oxide-book/_templates/globaltoc.html flake.nix All eight already carry the standard two-line header, so this changes no file and fails nothing today. That is exactly the hazard the guard's own header describes: the OSRB review fixed 32 files in #812, and the next two scripts to land (#819, #835) arrived without headers because nothing was watching that extension. The same is true here one file type over -- a new book stylesheet or template can land bare and CI stays green. CONTRIBUTING already names HTML's comment form in the header policy, so these files are in policy scope; only the guard's glob was short. Verified: the guard passes unchanged over the extended scope (1803 files, up from 1795), and stripping the header from `flake.nix` or from `_static/js/spa-nav.js` now fails the run, where before it passed. 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.
naming-guard was the last CI gate with real logic and no script: a ~50-line
shell block inline in the workflow. So it could not be run before pushing, could
not be mutation-tested, and
just checklisted it as CI-only for exactly thatreason.
scripts/check-reserved-prefixes.shis that block, moved verbatim in behaviour —same pattern, same canary self-test, same grep exit-status handling, same two
filters.
The reasoning comes with it
That block's comments are hard-won and worth keeping next to the code:
cuda_oxide_is deliberately not matched — pliron attribute keys,rustc
--cfgnames, dlopen probe symbols and temp directories live in thatword-space and are not reserved link symbols;
codegen_v1needs its own alternation arm — the pattern is anchored to theopening quote, so a hardcoded modern prefix's embedded
cuda_oxide_kernel_segment sits mid-string where the
kernelarm can never reach it;ripgrep incident, where
rg … || trueturned "command not found" into a cleanresult on every commit without reading a file.
Verified equivalent, not merely similar
reserved-oxide-symbolsand its 45 legitimate literalsOne deliberate change
The script reports
error:on stderr like its eight siblings, rather thanemitting
::error::annotations. That keeps its output identical locally and inCI, at the cost of the PR-annotation nicety — the step still fails and the message
is still in the log. Say the word if you would rather keep the annotations; it is
a one-line difference.
The workflow now calls the script,
check-guardsruns it, andcheck's CI-onlylist drops naming-guard.