Skip to content
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

Using link: protocol to link two different modules with the same name causes cache conflicts #8156

Open
garyo opened this issue May 26, 2020 · 0 comments

Comments

@garyo
Copy link

garyo commented May 26, 2020

Bug description

I'm in a monorepo. In two workspaces, A and B, I have this structure:
A/package.json and B/package.json:

  "dependencies": {
    "@horizon/common": "link:.deps/@horizon/common",

Each workspace has its own different copy of .deps/@horizon/common (for important but unrelated reasons). Running yarn on this setup gives the following error:

yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["@horizon/common@link:packages/front-end/.deps/@horizon/common"] is trying to unpack in the same destination "/home/garyo/.cache/yarn/v6/npm-@horizon-common-0.1.0/node_modules/@horizon/common" as pattern ["@horizon/common@link:packages/renderer/.deps/@horizon/common"]. This could result in non-deterministic behavior, skipping.

What is the current behavior?

From the error, it appears that yarn is trying to cache the dependency in the global cache. Given that the dependency is already present on the filesystem, caching seems at best pointless, and at worst, a conflict like this.

What is the expected behavior?
Should just work. I expect "link:" to just link to the file on disk.

Steps to Reproduce

Create the above environment and run yarn.

Environment

  • Node Version: 10.13
  • Yarn v1 Version: 1.22.4
  • OS and version: Linux Ubuntu 18.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant