Repository navigation
docs(rustc-codegen-cuda): gate this workspace's rustdoc and fix its broken links - #725
Merged
Merged
Conversation
…roken links
`crates/rustc-codegen-cuda` is its own [workspace], so the root
`cargo doc --workspace` in the docs gate never reaches it. fmt, clippy and
unit-tests each carry a dedicated step for that crate; docs did not, and four
broken intra-doc links in its crate-level documentation went unreported as a
result:
error: unresolved link to `collector::should_collect_from_crate`
error: public documentation for `rustc_codegen_cuda` links to private item `collector`
error: public documentation for `rustc_codegen_cuda` links to private item `device_codegen`
error: unresolved link to `layout`
`collector` and `device_codegen` are private modules, so a link to them from
public crate documentation is rejected, and `should_collect_from_crate` is a
private method on the private `DeviceCollector<'tcx>`, so that path could never
resolve. All three are now named rather than linked.
`layout` was never a module in this crate. The "Module Structure" list
documented it while omitting `generated_intrinsics` and `materialize`, so the
list is corrected to the four modules that exist.
Adding the workspace to the docs gate keeps it that way.
`RUSTDOCFLAGS="-D warnings" cargo doc --no-deps` now exits 0 there.
Closes NVIDIA#724
Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
|
Verified all four broken links exist on main and that the new docs leg needs no CUDA toolkit. A faithful copy of the unit-tests mechanism, which is right. Merging; closes #724. |
nihalpasham
approved these changes
Aug 10, 2026
nihalpasham
added a commit
that referenced
this pull request
Aug 12, 2026
* build(just): lint and document the codegen workspace, as CI does
`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 #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]>
* docs(just): state the real change: CI-spelling parity plus the codegen-workspace passes
Signed-off-by: nihalpasham <[email protected]>
---------
Signed-off-by: Vyncint Ng <[email protected]>
Signed-off-by: nihalpasham <[email protected]>
Co-authored-by: nihalpasham <[email protected]>
nihalpasham
added a commit
that referenced
this pull request
Aug 12, 2026
* build(just): lint and document the codegen workspace, as CI does
`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 #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]>
* ci: move the reserved-prefix guard into a script
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]>
---------
Signed-off-by: Vyncint Ng <[email protected]>
Co-authored-by: nihalpasham <[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.
Closes #724.
crates/rustc-codegen-cudais its own[workspace](rustc-private dylibs), sothe root
cargo doc --workspaceindocs.ymlnever reaches it. Every other gatehas a dedicated step for that crate —
fmt,clippy,unit-tests— and docsdid not.
That gap hid four real errors. The gate's own command, run against that
workspace on
main:What was wrong
collectoranddevice_codegenare private (mod, notpub mod), so linkingto them from public crate docs is rejected. Now named, not linked.
should_collect_from_crateis a private method on the privateDeviceCollector<'tcx>— that path could never have resolved, so it reads asDeviceCollector::should_collect_from_cratein prose.layouthas never been a module in this crate. The "Module Structure" listdocumented a module that does not exist, while omitting
generated_intrinsicsand
materialize. Corrected to the four that do exist.Only documentation comments changed; no code.
Verified
cargo fmt --checkpasses for both the root workspace andcrates/rustc-codegen-cuda. No GPU needed for any of this.The new step mirrors the existing
rustc-codegen-cudasteps infmt.ymlandclippy.yml, so the gate cannot silently skip that workspace again.