-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(core): handle self-referencing build dependencies #5177
Conversation
@@ -1351,7 +1351,7 @@ export class Project { | |||
|
|||
const workspace = this.tryWorkspaceByLocator(dependencyPkg); | |||
if (workspace) { | |||
if (buildablePackages.has(workspace.anchoredLocator.locatorHash)) | |||
if (resolution !== workspace.anchoredLocator.locatorHash && buildablePackages.has(workspace.anchoredLocator.locatorHash)) |
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.
Perhaps I'm too tired and reading this incorrectly, but isn't this checking whether the transitive workspace dependency is different from the devirtualized workspace?
Shouldn't it be?
if (resolution !== workspace.anchoredLocator.locatorHash && buildablePackages.has(workspace.anchoredLocator.locatorHash)) | |
if (resolution !== locator.locatorHash && buildablePackages.has(workspace.anchoredLocator.locatorHash)) |
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.
You're reading it correctly, that's a mistake on my part however your suggested change isn't correct either, the check was supposed to check that the devirtualized workspace wasn't the original locator
. I changed it to workspace.anchoredLocator.locatorHash !== locator.locatorHash
and added a new test.
packages/acceptance-tests/pkg-tests-specs/sources/commands/install.test.js
Outdated
Show resolved
Hide resolved
* fix(core): handle self-referencing build dependencies * chore: revert e2e trigger * fix(core): handle self-referencing virtual workspace build dependencies
What's the problem this PR addresses?
#5162 didn't handle self-referencing build dependencies.
Fixes https://github.com/yarnpkg/berry/actions/runs/3848381377/jobs/6556091151#step:4:65 and https://github.com/yarnpkg/berry/actions/runs/3848381374/jobs/6556092179#step:4:52
How did you fix it?
Handle self-referencing build dependencies.
Checklist