Repository navigation
fix(check): report unavailable cargo as FPRSL902, not a manifest fault - #128
Merged
Merged
Conversation
When cargo is not installed or rustup has no usable toolchain, cargo metadata fails before it reads the manifest, and fensu reported FPRSL901 "restore a readable, valid Cargo manifest" for a valid Cargo.toml. Spawn failures and rustup toolchain errors now produce FPRSL902, and fensu check exits 2 with "cargo not found; install the Rust toolchain", naming rust-toolchain.toml when the repository has one. A manifest that cannot be read or parsed, or that a working cargo rejects, keeps FPRSL901.
Deploying fensu with
|
| Latest commit: |
ffa94a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e49542e3.fensu.pages.dev |
| Branch Preview URL: | https://fix-cargo-unavailable.fensu.pages.dev |
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.
Why
On a machine without a Rust toolchain,
fensu checkblamed a validCargo.toml:cargo metadatafailed to start, and the failure was reported asFPRSL901"restore a readable, valid Cargo manifest" (0.28), or as a generic "Rust analysis found 0 Rust files" error that carries the RSL901 cause (0.29).Changes
cargo metadatafailures are classified. A spawn failure (cargonot onPATH, orCARGOpointing nowhere), or rustup reporting that it has no usable toolchain, now produces the newFPRSL902. Anything else, including a manifest a working cargo rejects, keepsFPRSL901.fensu checkexits 2 onFPRSL902before any rule is evaluated, so it never passes silently and the result is never cached:The
(see …)part appears only when the repository hasrust-toolchain.tomlorrust-toolchain. A rustup failure readscargo could not run: <rustup's error>; install the Rust toolchain ….The existing "0 Rust files" error now names its code (
FPRSL901 …).FPRSL902is registered in the rule catalogue (the catalogue was regenerated), and docs/rust.md describes it.Verification
Locally with Rust 1.95.0 and Python 3.12:
make verify,make skills-content-checkandmake test-rustall pass.