fix(tools): mise's downloads try six times, on the host and in tool builds

Through a proxy that cut and stalled connections (measured on the mini,
a two-minute stall), mise's three retries of bun's download each timed
out after 30 s, as mise tried again on the connection that had stalled,
and the tool build failed. shared-tools/build.sh and the host's mise
(miseCmd) now set MISE_HTTP_RETRIES=6, which outlasts such a stall; each
try still ends after 30 s without bytes (mise's http_timeout).

Every tool image's key changes (shared-tools/build.sh).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
w3cjandClaude Opus 5.5 committed 2026-11-29 22:57:15 -07:00
1 parent 9f2dda910d
commit 1946707e19
5 files changed
+11 -5

No files matched your search

+3 -1
View File
@@ -65,7 +65,9 @@ tool=$1 version=$2 file=$3
wait_share
sudo rm -rf "$work"; sudo mkdir -p "$work"; sudo chown "$USER" "$work"
cd "$share/.build"
export MISE_LOCKED=1 MISE_TRUSTED_CONFIG_PATHS="$share/.build" MISE_YES=1
# Six retries of a download, each try at most 30 s without bytes (mise's own timeout): mise's 3 end
# within a two-minute stall, as it tries again on the connection that stalled.
export MISE_LOCKED=1 MISE_TRUSTED_CONFIG_PATHS="$share/.build" MISE_YES=1 MISE_HTTP_RETRIES=6
if [[ $tool == rust ]]; then
# The toolchain as rustup lays it out, plus rustup itself for the VM to install (it links the
+1
View File
@@ -24,6 +24,7 @@ A build's downloads survive a network that cuts or stalls them:
- **`devvm-fetch`**, which base installs and every layer downloads through, gives up on a connection that takes more than 20 seconds to open or stays slower than 1 KB/s for 30 seconds, and tries again from where it stopped, five tries in all, waiting a little longer after each. A server that won't resume (curl's exits 33 and 36) starts the file again from nothing, and so does a file that doesn't match its checksum, once, as a resume may have joined two versions of it. It follows a redirect only to https, and it keeps only a file whose checksum is the pinned one.
- **apt** tries a package's download again three times once a source has answered ([base's packages](#bases-packages)).
- **crane**, in a `--from` conversion, is tried again five times, and **oh-my-bash**'s clone, in the `omb` feature, is tried five times in all, each failing on a connection that stays slower than 1 KB/s for 30 seconds.
- **mise**, in a tool image's build and on this machine, tries each download again six times (`MISE_HTTP_RETRIES`), as its own three end within a two-minute stall.
## Keys and caching
+2 -2
View File
@@ -122,7 +122,7 @@ A first run also downloads about 210 MB less on arm64 and about 280 MB less on a
While tool images build side by side, one status line covers them, and each line of a build's commands in the run log starts with its tool's name, such as `[node]`. When one fails, devvm stops the others and shows the end of that tool's own lines. Each build VM has a name of its own on Lima, `devvm-tools-build` and then `devvm-tools-build-2` to `devvm-tools-build-4`, and a later build or `devvm gc` deletes any of them that a killed or failed run left, and gc names each one it deletes.
These changes, and the next section's, change what goes into base and every layer, so they're built again once, with the pins since 0.2.0-rc.1. Run `devvm update` in each existing VM's folder, as for those pins.
These changes, and the next section's, change what goes into base, every layer and every shared tool, so they're built again once, with the pins since 0.2.0-rc.1. Run `devvm update` in each existing VM's folder, as for those pins.
### A first run on a bad network
@@ -130,7 +130,7 @@ A first run failed at the first connection that was cut or stalled, in Lima's do
- **Ubuntu's cloud image:** devvm downloads it itself, and a download that's cut or stalls goes on from where it stopped, in the same run or the next ([Ubuntu's cloud image in devvm's folder](#ubuntus-cloud-image-in-devvms-folder)).
- **`devvm-fetch`**, which base and every layer download through, gives up on a connection slower than 1 KB/s for 30 seconds and goes on from where it stopped, five tries in all, and a file that doesn't match its checksum is fetched again from nothing once. Your own layers' `devvm-fetch` downloads get the same.
- **apt** tries a package's download again three times, **crane** five times, and **oh-my-bash**'s clone gets five tries in all.
- **apt** tries a package's download again three times, **crane** five times and **mise** six times, in tool builds and on this machine, and **oh-my-bash**'s clone gets five tries in all.
### Ubuntu's cloud image in devvm's folder
+3
View File
@@ -258,6 +258,9 @@ func (t Versions) miseCmd(ctx context.Context, mise, dir string, args ...string)
"MISE_TRUSTED_CONFIG_PATHS="+dir,
"MISE_CEILING_PATHS="+filepath.Dir(dir),
"MISE_LOG_FILE="+filepath.Join(dir, miseLog),
// Six retries, as the tool builds' (shared-tools/build.sh): mise's
// three end within a two-minute stall.
"MISE_HTTP_RETRIES=6",
)
cmd.Env = append(cmd.Env, proxyEnv...)
cmd.Env = append(cmd.Env, caEnv...)
+2 -2
View File
@@ -91,9 +91,9 @@ func TestMiseCmdCompanyProxy(t *testing.T) {
if err != nil || slices.ContainsFunc(cmd.Env, func(kv string) bool { return strings.Contains(kv, "proxy.corp") }) {
t.Errorf("the environment's: %v, %q", err, cmd.Env)
}
// None: nothing added to mise's own eight.
// None: nothing added to mise's own nine.
e.Proxy = nil
if cmd, err = e.miseCmd(t.Context(), "/bin/true", t.TempDir(), "lock"); err != nil || len(cmd.Env) != len(os.Environ())+8 {
if cmd, err = e.miseCmd(t.Context(), "/bin/true", t.TempDir(), "lock"); err != nil || len(cmd.Env) != len(os.Environ())+9 {
t.Errorf("none: %v, %d of %d", err, len(cmd.Env), len(os.Environ()))
}
}