Repository navigation
docs(r17): The Rust toolbox — example 48 + chapter 48 (Appendices: Tooling) - #17
Merged
Merged
Conversation
…oling) Rust analog of ch46/ch47 and the final chapter of Part 13. One zero-dependency crate (`toolbox`, edition 2024, channel 1.97.1) with every gate asserting a real tool-produced effect, never a bare exit code. Hard gates (A-D), all offline, all from the pinned toolchain alone: - A rustup pin resolves (rustc 1.97.1) + report digest 0x481984990deee5ff, byte-identical to ch46's C++ and ch47's Go digest - B cargo fmt --check clean on the module tree; rustfmt --check nonzero on fixtures/misformatted.rs (outside the module tree, so never compiled) - C cargo clippy -D warnings clean by default; --features lintbait fires and names the stable needless_return lint - D cargo test runs the named digest unit test asserting the literal E-H (cargo-nextest/deny/llvm-cov/audit) ship committed configs and skip-if-present gates; cargo-audit is double-guarded on the binary and on ~/.cargo/advisory-db so a missing database is a SKIP, not a failure. Deviation from the plan: rust-toolchain.toml components trimmed to ["rustfmt", "clippy"] — pinning llvm-tools made rustup fetch it over the network on the first cargo invocation, breaking the offline build claim on a fresh host. Both llvm-tools and rust-src are now a documented `rustup component add` opt-in. Verified on Fedora 44 (kernel 7.1.5-201.fc44), offline: verify.lua PASS 20 / FAIL 0 with 4 informational SKIPs, test-all-examples --only 48-rust-toolbox 1 passed, validate.py OK.
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.
Rust analog of ch46/ch47 and the final chapter of Part 13. One zero-dependency crate (
toolbox, edition 2024, channel 1.97.1) with every gate asserting a real tool-produced effect, never a bare exit code.The structural point
rustfmtandclippyare rustup components of the pinned channel, so pinning the channel pins the formatter and the linter. That is why ch48's hard core covers formatting and linting offline, where ch47'sgofumpt/golangci-lintcould only ever be gated-if-present.Hard gates (A–D) — offline, pinned toolchain only
rustup showreports therust-toolchain.tomloverride;rustc --version== 1.97.1;toolbox report==0x481984990deee5ff(byte-identical to ch46 C++ and ch47 Go)cargo fmt --checkclean on the module tree;rustfmt --check fixtures/misformatted.rsexits 1 with a diff (fixture is outside the module tree, so nothing compiles it)cargo clippy --all-targets -- -D warningsclean by default;--features lintbaitfails and namesneedless_returnatsrc/lintbait.rs:13:5test result: ok. 1 passed; 0 failed(not the exit code)Gated-if-present (E–H)
cargo-nextest,cargo-deny,cargo-llvm-cov,cargo-audit— committeddeny.toml/clippy.toml, informationalSKIP:when absent, neverchecks.skip/FAIL.cargo-auditis double-guarded on the binary and on~/.cargo/advisory-db, so a missing database is a skip rather than a mid-verification network clone.Deviation from the plan (worth a look)
rust-toolchain.tomlcomponents trimmed from["rustfmt", "clippy", "llvm-tools", "rust-src"]to["rustfmt", "clippy"]. Pinningllvm-toolsmade rustup fetch it over the network on the firstcargoinvocation (info: downloading component llvm-tools), breaking the offline-build claim on a fresh host. Both omitted components are now a documentedrustup component addopt-in, covered in the chapter's "What is deliberately not pinned" subsection, and the pipeline diagram was relabelled to match.Verification (Fedora 44, kernel 7.1.5-201.fc44, offline, no
cargo install)LSP_LANG=rust lua verify.lua→ PASS 20 / FAIL 0, 4 informational SKIPstest-all-examples.py --only 48-rust-toolbox→ 1 passed, 0 failed, 0 skippedvalidate.py→ OK; 15/15 chapter source blocks verbatim; banned-words cleandigest=0x481984990deee5ffDetails and the full gate matrix in
_plans/r17-ch48-plan.md.