Skip to content

build(just): lint and document the codegen workspace, as CI does - #834

Merged
nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:build/just-backend-workspace-gates
Aug 12, 2026
Merged

nihalpasham merged 2 commits into
NVIDIA:mainfrom
vyncint:build/just-backend-workspace-gates

Conversation

@vyncint

@vyncint vyncint commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

just check claims to run CI's gates minus a named few. Two of its recipes were
narrower than the jobs they mirror, both in the same way: they 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 (cd crates/rustc-codegen-cuda && cargo test --lib). These two never did.

clippy

CI lints three scopes; the recipe ran one:

scope CI just clippy (before)
root workspace cargo clippy --workspace --all-targets cargo clippy --all-targets --lib --tests
codegen workspace cd crates/rustc-codegen-cuda && cargo clippy --all-targets —
per example one run per example —

Two problems in that first cell: no --workspace, and --all-targets --lib --tests narrows target selection, so it skips bin and example targets CI
lints — cuda-host/examples/finalize_nvvm_ir.rs 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 — same omission
as #814's missing timeout.

The per-example pass stays CI-only

It is one clippy run per example across 200-odd separate workspaces — a CI job,
not something to wait on locally. check's comment now names it as CI-only
rather than implying clippy is covered in full, which is the part that was
actually misleading.

Verification

Both widened recipes pass here, which was the real risk — widening a gate
can surface new lints:

  • just clippy — clean across both workspaces, 0 issues, exit 0;
  • just doc-check — builds the codegen rustdoc warning-free, exit 0.

So this closes a coverage gap without landing new work.

Merge order

#835 is stacked on this one. Both edit the same Still CI-only: sentence —
this PR adds clippy's per-example pass to it, #835 removes naming-guard — so they
conflicted until #835 was rebased onto this branch. Merging this one first keeps
that resolution valid; if #835 lands first its squash carries this change too and
this PR becomes an empty duplicate.

#836 and #838 also touch the Justfile/manifests but at unrelated lines, and I
verified all five merge clean in either order after the rebase.

`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]>
@nihalpasham nihalpasham added build-related Build scripts, toolchain discovery, or compilation setup enhancement New feature or request labels Aug 12, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator

Gist: the two codegen-workspace passes (clippy and warning-free rustdoc, cd-into-workspace) genuinely mirror the dedicated CI steps in clippy.yml and docs.yml and close a real local/CI gap for the one crate outside the root workspace. The comment's rationale was wrong, though: cargo target flags are additive, so the old --all-targets --lib --tests never skipped examples, and the virtual root workspace means the bare invocation already covered every member. Pushed f7cf4c3 rewording the block so the Justfile doesn't teach wrong cargo semantics; the real change is CI-spelling parity plus the two new passes.

Verified here:

  • both mirrored steps quoted line-for-line from clippy.yml and docs.yml;
  • just -n clippy dry-runs cleanly with the reworded comment;
  • clippy-fix widening left as a follow-up if you want fix mode to reach the codegen workspace too.

Landing once CI is green (before #835, which stacks this branch).

@nihalpasham
nihalpasham merged commit b28e40a into NVIDIA:main Aug 12, 2026
42 checks passed
nihalpasham pushed a commit that referenced this pull request Aug 13, 2026
`clippy` gained a second pass for crates/rustc-codegen-cuda in #834, because
that crate carries its own [workspace] and no root invocation crosses that
boundary. `clippy-fix` did not, so a warning the gate reports there had no
`--fix` pass to answer it -- the one place where fix mode was useful and absent.

The root line only changes spelling, to match `clippy`: target flags are
additive and the virtual root workspace has no default-members, so
`--all-targets --lib --tests` already selected the same members and targets.

Verified: `just clippy-fix` runs both passes (the second reaches
`rustc_codegen_cuda`), exits 0 on a clean tree, and rewrites nothing.

Signed-off-by: Vyncint Ng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-related Build scripts, toolchain discovery, or compilation setup enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants