fix(plugin-nm): set binary permissions for partial installs#6807
Merged
larixer merged 1 commit intoyarnpkg:masterfrom May 28, 2025
Merged
Conversation
oskarols
commented
May 25, 2025
packages/acceptance-tests/pkg-tests-specs/sources/node-modules.test.ts
Outdated
Show resolved
Hide resolved
cb72ab0 to
5220052
Compare
oskarols
commented
May 25, 2025
packages/acceptance-tests/pkg-tests-specs/sources/node-modules.test.ts
Outdated
Show resolved
Hide resolved
5220052 to
2e850a7
Compare
oskarols
commented
May 25, 2025
1 task
2e850a7 to
7ac999d
Compare
Contributor
Author
|
General question: browsing the commit history it seems that the PRs description seem to be used for the commits. Is this done automatically upon merge? Or do you want me to write a detailed commit description by hand? |
7ac999d to
f479e67
Compare
Member
I think it's done automatically. We just squash-merge PRs |
f479e67 to
b8866bf
Compare
Contributor
Author
|
@larixer Thanks for the reviews and help! Any clue on when this would be released? Is there anything I can do to get this out the door? |
Member
|
I'll review a couple of other PRs later today and make a release |
1 task
This was referenced Jul 14, 2025
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.
Hi! 👋
What's the problem this PR addresses?
Resolves #5344 #6551
When using
nodeLinker: node-modulesthere's an issue where bin files sometimes don't have the correct permissions (755) after installation. Some examples of scenarios where this can occur:node_modulesand then runningyarn installnode_modules(e.g. when using a CI cache) and then runningyarn installI ran a bisect and at least scenario 1 above seems to have started in 3.2.1, I suspect it's this change specifically although previous to this change the deleted directory was not reinstalled at all.
Digging into the issue I found that the general issue stems from reliance on presence of symlinks inside
node_modules/.bin/(here) to check whether permissions should be re-applied. The flaw with this approach is that for stale installation the old symlink is still there e.g. if a new version of a package is installed.How did you fix it?
This changes the
prevBinSymlinksto remove all symlinks that were related to added/changed packages during the installation. The comparison between previous and current symlinks insidepersistBinSymlinkswill now recreate the symlinks for these updated packages and also set the correct permissions.I've added two tests which were previously failing to cover this behavior, and a third which was already succeeding since it seemed sensible to explicitly test for permissions in a basic test as well.
Checklist