Repository navigation
fix: make cargo-binstall resilient to flaky build-host networks - #27
Merged
Merged
Conversation
On WSL2 / Docker Desktop the NAT chokes cargo-binstall's concurrent
fetcher checks (~20 simultaneous outbound connections is the observed
ceiling). Resolving all 11 crates at once (~22 connections) times out the
GitHub + QuickInstall lookups, and cargo-binstall then falls back to
compile-from-source — which hard-fails the build: this image ships no Rust
toolchain, and the source path rejects --install-path ("cargo-install
does not support --install-path", exit 100). macOS never trips the NAT
blip, so the build only failed on WSL.
Add three guards, all no-ops on a healthy host:
* --disable-strategies compile — never take the broken source path (all
11 crates publish prebuilt binaries, so compile is never needed here)
* install in batches of 4 (~8 concurrent connections, well under the
ceiling) instead of all 11 at once
* retry each batch + --maximum-resolution-timeout 60 to ride out blips
Verified: full `make rebuild` green end-to-end, claude-code healthy;
shellcheck clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
make rebuildfails at stage 5/20 (install-tools.sh→ cargo-binstall) on WSL2 / Docker Desktop, while the same build succeeds on macOS.The failure looks like a slow network but is actually a latent defect:
WARN resolve: Timeout reached while checking fetcher … deadline has elapsed, in 15s waves).--install-path:macOS has no equivalent NAT layer, so it never trips the blip and never reaches the broken fallback.
Fix
Three guards on the cargo-binstall invocation, all no-ops on a healthy host (macOS unaffected):
--disable-strategies compile— never take the broken source-compile path. All 11 crates publish prebuilt binaries, socompileis never legitimately needed here.--maximum-resolution-timeout 60— rides out any residual transient NAT/DNS blip; the cargo cache mount keeps retries cheap.Verification
make rebuild: exit 0, image exported,claude-codeUp (healthy).shellcheckclean (the only CI gate this shell-script change touches; Dockerfile/YAML untouched).🤖 Generated with Claude Code