Skip to content

fix: supply the ninth format argument in build_guest_script - #5

Merged
bdelanghe merged 1 commit into
mainfrom
claude/fix-guest-script-format
Jul 31, 2026
Merged

fix: supply the ninth format argument in build_guest_script#5
bdelanghe merged 1 commit into
mainfrom
claude/fix-guest-script-format

Conversation

@bdelanghe

Copy link
Copy Markdown
Collaborator

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 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 develop that follows takes the URL — which is exactly where the argument list skipped from bootstrap_path straight to bootstrap_github.

Adds the tests that would have caught it

Nothing exercised build_guest_script at all — it's called only from lima.rs at runtime — which is how 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. I verified the test has teeth by making that swap and watching it fail:

test script::tests::bootstrap_fallback_reports_path_and_runs_github_url ... FAILED

then reverting.

Verification

  • cargo build — clean
  • cargo test18 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 git2 0.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

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
@bdelanghe
bdelanghe marked this pull request as ready for review July 31, 2026 03:26
@bdelanghe
bdelanghe merged commit 4a65645 into main Jul 31, 2026
3 checks passed
@bounded-systems-front-desk bounded-systems-front-desk Bot moved this from Todo to Done in Front Desk Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants