fix: supply the ninth format argument in build_guest_script - #5
Merged
Conversation
This crate does not compile on main:
error: 9 positional arguments in format string, but there are 8 arguments
--> src/script.rs:72:19
The guest script's format string has nine placeholders; the argument list
supplied eight. The missing one is the third bootstrap_path, at the fallback
warning "bootstrap flake not found at {}".
The mapping is determined by the surrounding text, not guessed. The else branch
reads: report that the local flake was missing, then retry via GitHub. So the
warning takes the PATH and the `nix develop` that follows takes the URL —
which is exactly where the argument list skipped from bootstrap_path straight
to bootstrap_github.
Also adds the tests that would have caught it. Nothing exercised
build_guest_script at all — it is called only from lima.rs at runtime — which
is why an outright compile error survived on main.
The second test earns its place: an arity mismatch is caught by the compiler,
but SWAPPING the path and URL arguments still compiles and produces a script
that names the GitHub URL in the "not found at" message and then runs the local
path as a flake reference. Verified the test has teeth by making that swap and
watching it fail, then reverting.
cargo build: clean
cargo test: 18 passed, 0 failed (16 pre-existing + 2 new)
Unrelated to the dependency work in the merged osv-scan PR, though that is how
it surfaced: the broken build made it impossible to confirm the git2 0.21 bump
compiled, so the advisory fix went in with weaker evidence than it should have.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LF9Cu8u4dkCEM8MXC1QeDL
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.
This crate does not compile on
main.The guest script's format string has nine placeholders; the argument list supplies eight.
The missing argument is determined, not guessed
The missing one is a third
bootstrap_path, at the fallback warning"bootstrap flake not found at {}".The else branch reads: report that the local flake was missing, then retry via GitHub. So the warning takes the path and the
nix developthat follows takes the URL — which is exactly where the argument list skipped frombootstrap_pathstraight tobootstrap_github.Adds the tests that would have caught it
Nothing exercised
build_guest_scriptat all — it's called only fromlima.rsat runtime — which is how an outright compile error survived onmain.The second test earns its place. An arity mismatch is caught by the compiler, but swapping the path and URL arguments still compiles, and produces a script that names the GitHub URL in the "not found at" message and then runs the local path as a flake reference. I verified the test has teeth by making that swap and watching it fail:
then reverting.
Verification
cargo build— cleancargo test— 18 passed, 0 failed (16 pre-existing + 2 new)Relationship to the osv work
Unrelated to the dependency changes in the merged #4, though that's how it surfaced: the broken build made it impossible to confirm the
git20.20 → 0.21 bump compiled, so that advisory fix landed on weaker evidence than it should have. With this merged, that bump is verifiable.Generated by Claude Code