Pin Bun 1.4.0, compose the asset matrix, share the download cache - #14
Merged
arcaputo3 merged 1 commit intoAug 26, 2026
Merged
Conversation
Bun 1.4.0 shipped six days before #13 pinned 1.3.14 in eleven places, and the pin was hard to move: `bundledChecksum` matched the version with a literal, and `bunArchiveSha256` was rejected unless `bunArchiveUrl` was set too -- contradicting its own scaladoc. - Replace the single-version checksum map and the `version == "1.3.14"` guard with a version -> asset -> sha256 table holding 1.3.14 and 1.4.0. All 24 entries verified against the official SHASUMS256.txt. - Compose asset names from (os, arch, musl, baseline) instead of enumerating, and reject combinations Bun does not publish. This adds the musl (Alpine) and -baseline (pre-AVX2 x64) builds the plugin previously could not download at all: 12 assets per version, not 6. musl is detected from the dynamic loader; baseline is opt-in via `bunUseBaseline` because the JVM cannot see CPU feature flags. - `bunArchiveSha256` now works alone, deriving the URL from `bunVersion`, so running an unbundled Bun is a two-line override. A custom `bunArchiveUrl` still requires a checksum so a mirror stays verified. - Add a checksum-keyed shared download cache. `downloadedBunExecutable` is a task on the trait, so a build with N Bun modules previously downloaded the ~35MB archive N times into N task dests. - `BunToolchainModule.DefaultBunVersion` is the single pin; `bunVersion` and `bunTypesVersion` both derive from it. `@types/bun` is published in lockstep with Bun, so the stale 1.3.11 pin can no longer drift. - Point the integration suite at the managed toolchain by default. It ran with MILL_BUN_USE_SYSTEM=true, so it tested whatever Bun the developer had rather than the version the plugin pins -- and broke outright once the pin moved ahead of the local Bun. The shared cache makes this affordable: the whole suite now uses one download. Unit 57 passing; integration 37 passing against managed Bun 1.4.0 with a single cached archive. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 26, 2026
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.
Stack 1/N onto #13. Base is
agent/idiomatic-scalajs-mill-workflows, notmain.Why
Bun 1.4.0 shipped 2026-08-20, six days before #13 pinned 1.3.14 in eleven places — and the pin was hard to move:
bundledChecksummatched the version with anif (version == "1.3.14")literal, so any other version had no checksum.bunArchiveSha256was rejected unlessbunArchiveUrlwas set too, contradicting its own scaladoc ("or for an unbundled Bun version"). There was no way to run a newer Bun without hand-writing a GitHub release URL.bunVerifyVersiondefaulting true, a developer whose system Bun was not exactly the pin got a hard failure.What changed
Checksums. Version → asset → sha256 table holding 1.3.14 and 1.4.0. All 24 entries verified against the official
SHASUMS256.txtfor each release.Asset matrix.
distributionnow composesbun-{os}-{arch}[-musl][-baseline].zipfrom(os, arch, musl, baseline)and returnsLeftfor combinations Bun does not publish (-muslis Linux-only,-baselineis x64-only). This adds builds the plugin previously could not download at all: musl for Alpine, and-baselinefor x64 CPUs without AVX2. 12 assets per version, up from 6.musl is auto-detected from the presence of the musl dynamic loader.
-baselineis opt-in viabunUseBaseline, because the JVM cannot see CPU feature flags and guessing wrong surfaces asSIGILLrather than a diagnosable error.Unbundled versions.
bunArchiveSha256now works on its own, deriving the URL frombunVersionand the detected platform — the behavior the scaladoc already promised. A custombunArchiveUrlstill requires a checksum so a mirror stays verified.Shared download cache.
downloadedBunExecutableis a task on the trait, so a build with N Bun modules downloaded the ~35 MB archive N times into N separate task dests. Downloads are now cached under~/.cache/mill-bun, keyed by the verified checksum — so a cache hit is proof of the right bytes, and a partial or tampered download can never be reused. Override withMILL_BUN_CACHE_DIR.One pin.
BunToolchainModule.DefaultBunVersionis the single source of truth;bunVersionandbunTypesVersionboth derive from it.@types/bunpublishes in lockstep with Bun, so the stale1.3.11pin (against a 1.3.14 Bun) can no longer drift.Integration suite uses the managed toolchain.
forkEnvsetMILL_BUN_USE_SYSTEM=true, so the suite tested whatever Bun the developer had installed rather than the version the plugin pins — and broke outright the moment the pin moved ahead of the local Bun. It now defaults to the managed toolchain; the shared cache makes that affordable. ExportMILL_BUN_USE_SYSTEM=trueto run against a local Bun.Verification
Note
millbun/integration/resources/typescript-envnow setsbunVerifyVersion = false. Itsbun-proxyscript execs whatever Bun is onPATH, so its--versionreports the developer's Bun, not the pin — that fixture tests env propagation, not version pinning.🤖 Generated with Claude Code