Repository navigation
chore(foundryup): upgrade to tar 8 and tune streaming extraction - #11896
davidmurdoch wants to merge 5 commits into
Conversation
🛑 Files requiring codeowner reviewTo merge this PR, you'll need to get approvals from the following owner groups. (Note: For files with multiple owners, approval from one owner is sufficient.) @MetaMask/extension-platform or @MetaMask/mobile-platform (6 files)
ℹ️ Files co-owned by
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 62b3b54. Configure here.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the tar 8 extraction migration.
No open issues 🎉
What changed in this PR
Migrates @metamask/foundryup to tar 8’s async extraction API while preserving selective extraction and optional checksum verification. ZIP extraction is unchanged.
Changes:
- Upgrade to
tar@^8.0.5and remove the directminipassdependency. - Tune download buffering, input batching, and gzip output chunks.
- Add extraction and failure-cleanup tests.
| File | Description |
|---|---|
yarn.lock |
Update resolved dependencies. |
packages/foundryup/src/types.ts |
Add download buffering option. |
packages/foundryup/src/extract.ts |
Migrate tar extraction and tune streaming. |
packages/foundryup/src/extract.test.ts |
Test selective extraction, checksums, and cleanup. |
packages/foundryup/src/download.ts |
Apply configurable stream buffering. |
packages/foundryup/package.json |
Upgrade tar and remove minipass. |
packages/foundryup/CHANGELOG.md |
Document dependency changes. |
oxlint-suppressions.json |
Remove obsolete lint suppression. |
Review effort: Balanced
| await extractTar( | ||
| { | ||
| codecs: foundryTarCodecs, | ||
| cwd: dir, | ||
| input: batchTarInput( | ||
| startDownload(url, { | ||
| streamHighWaterMark: TAR_DOWNLOAD_HIGH_WATER_MARK, | ||
| }), | ||
| ), |
There was a problem hiding this comment.
tar 8 now accepts an archive that's missing its last few bytes (the gzip trailer); tar 7 rejected it with zlib: unexpected end of file. Checksums still catch a bad binary, so clients are fine. Worth a test for a truncated archive?

Explanation
Upgrade
@metamask/foundryuptotar@8.0.5. Tar 8 replaces its Node stream extraction API with async extraction and Web Stream transforms. Foundryup still streams the download directly into extraction, selects only the requested binaries, and verifies checksums in the same pass when configured. The old transform was the only direct use ofminipass, so this also removes that dependency. ZIP extraction is unchanged.Tar 8's gzip path was sensitive to small HTTP chunks in local benchmarks. This PR keeps the initial input batch at 256 KiB so extraction can start promptly, then uses 2 MiB input batches, a 1 MiB download stream high-water mark, and 1 MiB gzip output chunks to reduce stream and decompressor overhead. The download, unpack, and checksum pipeline remains bounded and still uses tar's decompression-ratio guard.
Performance
Official Foundry v1.10.1 Linux x64 archive, Node 26. The initial tar 8 migration regressed at matched 64 KiB settings, especially with SHA-256. The final tuning reduced the time spent in the HTTP download and extraction path.
14.0% less time vs. tar 8 HTTP baseline
12.3% less time vs. tar 8 HTTP baseline
The Tar 7 and Untuned Tar 8 columns show median times with matched 64 KiB compressed input chunks and gzip output buffers. The HTTP comparison uses fast loopback delivery and reports median paired reductions versus the earlier tar 8 implementation with 256 KiB input and output buffers. The optimized HTTP times are not directly comparable to the fixed-input times.
Paced HTTP completion time was effectively unchanged; the first extracted file appeared about 2 ms later. Tar 8 was slower on a synthetic incompressible fixture at matched settings, so the measurements do not imply universal parity.
Testing
yarn workspace @metamask/foundryup test --run(24 tests passed)yarn workspace @metamask/foundryup buildyarn lint:oxlint packages/foundryupyarn lint:misc:check packages/foundryup oxlint-suppressions.jsonyarn workspace @metamask/foundryup changelog:validateReferences
Checklist
Note
Medium Risk
Touches the core Foundry binary download/unpack/checksum path and a major tar major version, so regressions could affect install reliability even with new tests.
Overview
Upgrades
@metamask/foundryuptotar@8.0.5, drops the directminipassdependency, and updates the tar.gz path for tar 8’s asyncextractAPI and Web Streams transforms (checksum hashing viaTransformStreaminstead ofMinipass). Downloaded bytes are fed throughbatchTarInput, tuned gzip codecs, and an optionalstreamHighWaterMarkonstartDownloadto cut overhead from small HTTP chunks.Adds
extract.test.tscoverage for selective binary extraction with/without checksums and cleanup when verification or HTTP fails. ZIP extraction is unchanged; changelog and lockfile reflect the dependency bump.Reviewed by Cursor Bugbot for commit 62b3b54. Configure here.