-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(plugin-nm): set binary permissions for partial installs #6807
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
fix(plugin-nm): set binary permissions for partial installs #6807
Conversation
packages/acceptance-tests/pkg-tests-specs/sources/node-modules.test.ts
Outdated
Show resolved
Hide resolved
cb72ab0
to
5220052
Compare
packages/acceptance-tests/pkg-tests-specs/sources/node-modules.test.ts
Outdated
Show resolved
Hide resolved
5220052
to
2e850a7
Compare
2e850a7
to
7ac999d
Compare
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
I think it's done automatically. We just squash-merge PRs |
f479e67
to
b8866bf
Compare
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.
Thanks, look good to me!
@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? |
I'll review a couple of other PRs later today and make a release |
Hi! 👋
What's the problem this PR addresses?
Resolves #5344 #6551
When using
nodeLinker: node-modules
there'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_modules
and then runningyarn install
node_modules
(e.g. when using a CI cache) and then runningyarn install
I 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
prevBinSymlinks
to remove all symlinks that were related to added/changed packages during the installation. The comparison between previous and current symlinks insidepersistBinSymlinks
will 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