Repository navigation
Conversation
The book was the only documentation surface without warnings-as-errors. The Rust
docs gate builds under RUSTDOCFLAGS="-D warnings" and says why -- to keep broken
intra-doc links from accumulating silently -- while sphinx-build ran bare, so a
broken cross-reference, a malformed directive, or a page dropped from a toctree
exited 0 and published.
Appending one dangling link to index.md shows the gap:
$ sphinx-build -b html cuda-oxide-book _build # before
build succeeded. # exit 0, publishes
$ sphinx-build -W --keep-going -b html cuda-oxide-book _build
WARNING: 'myst' cross-reference target not found: 'does-not-exist.md'
# exit 1
`--keep-going` reports every warning in one run rather than stopping at the
first, which matters when a rename breaks several references at once.
The book is already clean, so this costs nothing now: with the pinned
requirements the flagged build exits 0 on main with zero warnings. The Makefile
gets the same default so `make html` catches locally what CI would catch, and it
stays overridable for a draft build with `SPHINXOPTS= make html`.
Note requirements.txt uses `>=`, so CI floats to the newest Sphinx and a release
that adds a deprecation warning would fail this. Pinning the Sphinx major would
remove that exposure if it is unwanted.
Closes NVIDIA#732
Signed-off-by: Vyncint Ng <[email protected]>
Collaborator
nihalpasham
added a commit
that referenced
this pull request
Aug 10, 2026
* ci(book): fail the book build on Sphinx warnings
The book was the only documentation surface without warnings-as-errors. The Rust
docs gate builds under RUSTDOCFLAGS="-D warnings" and says why -- to keep broken
intra-doc links from accumulating silently -- while sphinx-build ran bare, so a
broken cross-reference, a malformed directive, or a page dropped from a toctree
exited 0 and published.
Appending one dangling link to index.md shows the gap:
$ sphinx-build -b html cuda-oxide-book _build # before
build succeeded. # exit 0, publishes
$ sphinx-build -W --keep-going -b html cuda-oxide-book _build
WARNING: 'myst' cross-reference target not found: 'does-not-exist.md'
# exit 1
`--keep-going` reports every warning in one run rather than stopping at the
first, which matters when a rename breaks several references at once.
The book is already clean, so this costs nothing now: with the pinned
requirements the flagged build exits 0 on main with zero warnings. The Makefile
gets the same default so `make html` catches locally what CI would catch, and it
stays overridable for a draft build with `SPHINXOPTS= make html`.
Note requirements.txt uses `>=`, so CI floats to the newest Sphinx and a release
that adds a deprecation warning would fail this. Pinning the Sphinx major would
remove that exposure if it is unwanted.
Closes #732
Signed-off-by: Vyncint Ng <[email protected]>
* ci(book): build the book on pull requests, deploy only from main
book.yml had no `pull_request` trigger, so the book was built only after merge.
Every other content gate -- ci, docs, examples-compile, codeql, naming-guard,
status-guard -- runs on PRs. A pull request that broke a cross-reference, a
directive or a toctree entry therefore reached main unchallenged, and the first
signal was a failure on the branch everyone builds from.
Adding the trigger is not sufficient on its own. This is a deployment workflow:
it holds `pages: write` / `id-token: write` and a deploy job, which is presumably
why it was push-only, and a naive trigger would attempt a Pages deploy from every
pull request. So `deploy` is gated on `github.event_name != 'pull_request'`: a PR
builds the book to prove it is sound and stops there, never touching the Pages
environment.
The workflow-level `concurrency: group: pages` needed the same care. It exists to
serialise deploys, and leaving it workflow-wide would queue unrelated PR builds
behind each other. It moves onto the deploy job, where the constraint actually
applies, and the workflow-level group becomes ref-scoped. Superseded PR runs are
cancelled; pushes to main are not, so a publish in flight is never interrupted.
Stacked on #733: with `-W` in place a PR build now fails on a warning instead of
publishing one, which is the half that makes this trigger worth having.
Closes #743
Signed-off-by: Vyncint Ng <[email protected]>
* ci(book): scope Pages permissions to the deploy job, bound the Sphinx major
Pull requests now run the build job, so the workflow-level token they
receive should hold checkout rights only; `pages: write` and
`id-token: write` move onto the deploy job, the only place they are
used. With `-W` gating every PR, an unbounded `sphinx>=7.0` float lets
a new Sphinx major redden every PR and the main-branch deploy
overnight; bound it below 10 so majors are adopted deliberately.
---------
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 #732.
The book is the only documentation surface without warnings-as-errors. The Rust
docs gate builds under
RUSTDOCFLAGS="-D warnings"anddocs.ymlstates thereason — "keeps broken intra-doc links and uncompilable doc examples from
accumulating silently" — while
sphinx-buildran bare.Demonstrated
Appending one dangling link to
index.md:--keep-goingreports every warning in one run instead of stopping at the first,which matters when a rename breaks several references at once.
Costs nothing today
The book is already clean —
sphinx-build -W --keep-goingexits 0 with zerowarnings on
main(Sphinx 9.1.0, installed fromcuda-oxide-book/requirements.txt).The
Makefilegets the same default somake htmlcatches locally what CIcatches, and it stays overridable for a draft build:
Verified
make htmlstill exits 0 with the new default.One caveat, stated plainly
requirements.txtuses>=constraints, so CI floats to the newest Sphinx. Afuture release that introduces a deprecation warning would then fail the book
build rather than merely mention it.
--keep-goingat least surfaces all of themat once. If you would rather not take that exposure, pinning the Sphinx major in
requirements.txtremoves it — happy to add that here or drop the-Wentirely.No GPU needed for any of this.