Fix: invalid linking in workspaces for unused packages#4129
Merged
Conversation
arcanis
previously approved these changes
Aug 9, 2017
added 8 commits
August 9, 2017 16:09
Need another review since further updates revealed other bugs needing to be fixed
arcanis
reviewed
Aug 10, 2017
src/package-linker.js
Outdated
|
|
||
| if (!linksToCreate.has(name) || isDirectRequire) { | ||
| if ( | ||
| !(workspaceLayout && name === workspaceLayout.virtualManifestName) && |
Member
There was a problem hiding this comment.
Is it needed? The virtual manifest should have no bin link, right?
Member
Author
There was a problem hiding this comment.
Nothing prevents it from having a bin definition. Also, this is the actual fix after merging from the master. I think the reason is this line: 7bd20fe#diff-306a2caea89d886b11134fb770d1ebf6R385
arcanis
approved these changes
Aug 10, 2017
GulajavaMinistudio
added a commit
to GulajavaMinistudio/yarn
that referenced
this pull request
Aug 11, 2017
Fix: invalid linking in workspaces for unused packages (yarnpkg#4129)
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.
Summary
Fixes #4106. When a local package is listed under
workspacesbut that specific version is never used by anything,yarnstill tries to install its bin links because it is listed as a dependency of the virtual workspace aggregator (but never get installed). This patch makes sure we have a location insidenode_moduleswhen trying to create bin links. It also fixes where we don't pass the proper location for workspaces root which may result in unexpected behavior under certain circumstances.Test plan
Added a new test case which fails on master and passes with the fix.
Manual:
Fails before the patch with latest nightly and passes after the patch.