fix(setup): allow static.rust-lang.org; correct the rust-toolchain paths in the doc - #1183
Merged
Merged
Conversation
…ths in the doc The lychee prek hook is `language: rust` with `additional_dependencies: ["cli:lychee"]`, so prek bootstraps its own toolchain on first run. It fetches `rustup-init` from static.rust-lang.org, which was never in `allowedDomains` — a contributor with a cold prek cache cannot build the hook env in-sandbox. The annotated block in the setup doc also claimed the framework needs `~/.rustup/` and `~/.cargo/`. It does not: prek installs its rustup and toolchains under `~/.cache/prek/tools/rustup/` and points CARGO_HOME at `~/.cache/prek/cache/cargo/`, both already covered by `~/.cache/`. Those lines were added to the doc in apache#501 and never applied to the settings file or the sandbox-lint baseline, so the doc has been describing a config that does not exist and over-stating the framework's reach into the home directory. Generated-by: Claude Code (Opus 5)
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.
Two related defects in how the framework's own sandbox config describes and permits the
lycheerust hook. Both originate in #501, which rewrote the annotated block indocs/setup/secure-agent-setup.mdbut applied only the domain removals to.claude/settings.jsonandtools/sandbox-lint/expected.json.1.
static.rust-lang.orgis required but was never allowedThe
lycheehook islanguage: rustwithadditional_dependencies: ["cli:lychee"], so prek bootstraps its own toolchain on first run. It downloadsrustup-initfromstatic.rust-lang.org:That host was not in
allowedDomains, so a contributor with a cold prek cache cannot build the hook env in-sandbox.*.crates.iowas allowed, which is why this looked fine — crate deps resolve, but the toolchain that consumes them can never be fetched.2. The doc over-stated the framework's home-directory reach
The annotated block claimed the framework needs
~/.rustup/and~/.cargo/in bothallowReadandallowWrite. It does not. prek redirects everything into its own cache:All under the
~/.cache/entries that were already present. The user's own~/.rustup/~/.cargoare never read or written — verified on a machine where both exist and neither contains a lychee binary.Since those four lines were never in the real
.claude/settings.json, the doc has been describing a config that does not exist, and claiming more home-directory access than the framework actually takes.Also
The doc's
allowedDomainslist omittedapi.bitbucket.org, which the real file has. Added so the block matches what it claims to reproduce.Verification
sandbox-lint: OK (.claude/settings.jsonmatchesexpected.json)prek run --files <the three changed files>: all greenpytest tools/sandbox-lint: 111 passedGenerated-by: Claude Code (Opus 5)