refactor: replace tar extraction with modern-tar - #3353
Open
ayuhito wants to merge 1 commit into
Open
Conversation
ayuhito
commented
Aug 9, 2026
| log.error('error while extracting tarball', code, message) | ||
| } | ||
| const extract = () => unpackTar(tarExtractDir, { | ||
| strict: true, |
Author
There was a problem hiding this comment.
This is the only section I'm somewhat unsure about if it may regress. I don't think the differences are large, but I do want to point it out.
The previous behavior was very strict, relying on the onwarn handler to throw. strict: true is the same thing, but there still may be minor differences on what our definitions of strict are. e.g. node-tar accepts an archive with a single EOF zero block, while modern-tar strict mode rejects it as truncated.
This is fine for the normal path from Node.js sources, but might affect --tarball and --dist-url? How do we feel about that?
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.
Checklist
npm install && npm run lint && npm testpassesDescription of change
Replaces
tarwithmodern-tar. Cuts dependencies from 6 --> 1. 4MB on disk --> 95KB on disk.Ref: https://npmgraph.js.org/?q=node-gyp#select=tar%407.5.22
Similar to the motivation of #3133. Thanks for everyone's time!