-
Notifications
You must be signed in to change notification settings - Fork 680
[package-extractor]: fix issue #5719, preventing duplicate-copy conflicts across npm-packlist versions #5720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+77
−2
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bce3791
fix(package-extractor): preventing duplicate-copy conflicts across np…
LPegasus 316cd18
docs(README.md): update readme
LPegasus fa6d3ed
Fix different behavior on Windows that was breaking the unit test
octogonz 0ba8c2c
Prepare to publish a PATCH version of Rush
octogonz 4f3a77e
Merge branch 'main' into rush-issue-5719
octogonz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "package-extractor-test-05", | ||
| "description": "This project is used by tests in the @rushstack/package-extractor package.", | ||
| "version": "1.0.0", | ||
| "private": true, | ||
| "main": "./dist/index.js", | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "_phase:build": "" | ||
| }, | ||
| "dependencies": { | ||
| "@rushstack/node-core-library": "workspace:*" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export {}; |
10 changes: 10 additions & 0 deletions
10
common/changes/@microsoft/rush/rush-issue-5719_2026-03-25-00-05.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "@microsoft/rush", | ||
| "comment": "Fix an issue where \"rush deploy\" could fail with EEXIST due to a \"npm-packlist\" regression (GitHub #5720)", | ||
| "type": "none" | ||
| } | ||
| ], | ||
| "packageName": "@microsoft/rush" | ||
| } |
10 changes: 10 additions & 0 deletions
10
common/changes/@rushstack/package-extractor/rush-issue-5719_2026-03-24-11-42.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "@rushstack/package-extractor", | ||
| "comment": "preventing duplicate-copy conflicts across npm-packlist versions", | ||
| "type": "patch" | ||
| } | ||
| ], | ||
| "packageName": "@rushstack/package-extractor" | ||
| } |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key questions for this change:
Is this a perf concern? We are synchronously calling
path.normalize()potentially thousands of times, and allocating multiple data structures containing thousands of elements. How many thousands? It is not the full--create-archivelist fromrush deploy, but more like the total number of files under a single Rush project. An imperative loop here could be more efficient for time/memory, but the costs are probably already tiny compared to the preceding work required to constructnpmPackFiles.Is it the right fix? The problem did not exist with
npm-packlist@2, it is apparentlynpm-packlist@5that started returning duplicate paths. Why should a packlist contain duplicates? Aren't duplicate paths a bug? If so, then this "fix" is reversing the effects of a bug, which wouldn't be necessary if we simply fix the bug. (More evidence:npm-packlistis maintained by NPM, Inc., who are known for "how can this have no unit test???" type regressions.)If it's a bug, then other tools that use
npm-packlistshould have the same bug. And here we go, PNPM seems to have encountered the same issue:fix: packing the same file twice during publish pnpm/pnpm#7250
That diff interestingly has a similar deduplication line:
...but if you look closely, it is not calling
path.normalize(). It seems to be deduplicating for some other reason. PNPM's real fix was to upgradenpm-packlist:...which at the time, they accomplished by introducing a wrapper package
@pnpm/fs.packlist.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't downgrade, because that would undo the benefit of PR #5575.
So, one alternative fix is to upgrade to
npm-packlist(whose latest version is now already 10.x).BUT, consider that PNPM's @pnpm/fs.packlist has eliminated its dependency on
arborist, so today it is merely:"npm-packlist": "5.1.3"This seems like exactly what
rush deployneeds. And Rush primarily uses PNPM, I think we would get more consistent/stable results by replacing ournpm-packlistwith@pnpm/fs.packlist. That seems like the best solution.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said:
This was a significant regression for
rush deployIt is a recent regression caused by this PR in January:
[package-extractor] Upgrade npm-packlist to 5.1.3 to remove deprecated glob@7 and inflight dependencies #5575
CC @iclanton
@LPegasus's PR is a minimal fix.
So my recommendation is to merge+publish PR #5720, then do a follow up PR to implement the
@pnpm/fs.packlistapproach.