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

[Question] EXDEV: cross-device link not permitted error even when enableGlobalCache: false #6698

Open
uhyo opened this issue Feb 18, 2025 · 2 comments
Labels
waiting for feedback Will autoclose in a while unless more data are provided

Comments

@uhyo
Copy link

uhyo commented Feb 18, 2025

Hello, sorry for yet another cross-device link not permitted issue. However, please view this issue as rather a question.

First, here's the error we're seeing on our CI environment (with some internal stuff masked):

[Error: EXDEV: cross-device link not permitted, link '/root/.yarn/berry/index/bf/bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f.dat' -> '/*****/node_modules/.store/*****/package/.prettierrc'] {
  errno: -18,
  code: 'EXDEV',
  syscall: 'link',
  path: '/root/.yarn/berry/index/bf/bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f.dat',
  dest: '/*****/node_modules/.store/*****/package/.prettierrc'
}

(where the link source looks like in the global cache and the dest is inside our project folder)

Looking at #6457 and other issues, I wanted to try disabling the global cache. Here's my .yarnrc.yml:

# .yarnrc.yml
nodeLinker: pnpm
yarnPath: .yarn/releases/yarn-4.6.0.cjs
enableGlobalCache: false
enableMirror: false

However, the exactly same error still happens. I thought these settings would totally disable use of the global cache, including the hard-linking behavior.

Question: is there a way to completely disable hard-linking from the global cache?

Thank you!

@clemyan
Copy link
Member

clemyan commented Mar 14, 2025

The pnpm linker, by definition, needs to hardlink to a global content-addressable store.

If you don't want that, you probably just want to use the node-modules linker. Or is there something you need the pnpm linker for that can't be done with the node-modules linker

@clemyan clemyan added the waiting for feedback Will autoclose in a while unless more data are provided label Mar 14, 2025
@uhyo
Copy link
Author

uhyo commented Mar 17, 2025

Thank you for response!

First of all, we want to disable the hardlinking from the global store only when yarn is running on CI. Actually, we want to disable the hardlinking by an environment variable (YARN_ENABLE_GLOBAL_CACHE) rather than .yarnrc.yml.

The reason why we stick to the pnpm linker is that it has stricter hoisting behavior. Also, the pnpm linker is more storage-efficient (at least in our case).

At first I thought that by disabling the global.cache the pnpm linker would switch to hard- (or maybe sym-) linking from a “local” store (.yarn/cache), but it wasn't the case.

Currently, our workaround for the cross-device link error is to override the global store path to somewhere local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Will autoclose in a while unless more data are provided
Projects
None yet
Development

No branches or pull requests

2 participants