berry icon indicating copy to clipboard operation
berry copied to clipboard

Allow symlinks in MountFS

Open thatsmydoing opened this issue 2 years ago • 8 comments

What's the problem this PR addresses?

Yarn shouldn't care if zips in the cache are symlinks or not. The only reason it doesn't work is that finding the mount point skips zips if they're not regular files. This used to be supported until it was removed for "performance" reasons in https://github.com/yarnpkg/berry/pull/1474. The bulk of the logic in the linked PR involves resolving the real path of the symlink but I don't think that's needed for this?

Resolves https://github.com/yarnpkg/berry/issues/3514

How did you fix it? I switched the check to use stat from lstat.

Checklist

  • [X] I have set the packages that need to be released for my changes to be effective.
  • [x] I will check that all automated PR checks pass before the PR gets reviewed.

thatsmydoing avatar May 31 '23 00:05 thatsmydoing

The tests seem to accept that, so I'd tend to be fine with merging this since it shouldn't impact existing codebases 🤔

arcanis avatar Jun 01 '23 20:06 arcanis

I've added the tests. The acceptance tests were timing out on windows so I just excluded them. For some reason, the unit test works though so I'm just letting it run unconditionally.

thatsmydoing avatar Jun 02 '23 04:06 thatsmydoing

Side note: I'm getting this error on Vercel when setting YARN_CACHE_FOLDER=node_modules/.yarn-cache:

YN0001: │ Error: While persisting /vercel/path0/node_modules/.yarn-cache/node-gyp-npm-9.3.1-43540bab9c-b860e9976f.zip/node_modules/node-gyp/ -> /vercel/path0/node_modules/node-gyp ENOENT: no such file or directory, scandir '/vercel/path0/node_modules/.yarn-cache/node-gyp-npm-9.3.1-43540bab9c-b860e9976f.zip/node_modules/node-gyp'

~~I hope this PR will also fix that, if not I'll make a new issue.~~ I have tested this PR's artifacts and it seems to resolve this as well.

hansottowirtz avatar Jun 09 '23 09:06 hansottowirtz

@merceyz are there any other changes you want me to make?

thatsmydoing avatar Sep 06 '23 04:09 thatsmydoing

@merceyz Sorry for pinging, but could this be merged or are there any blockers?

hansottowirtz avatar Oct 02 '23 08:10 hansottowirtz

@thatsmydoing would you be able to rebase on master?

hansottowirtz avatar Jan 04 '24 17:01 hansottowirtz

@arcanis Any way this could be merged?

hansottowirtz avatar Mar 28 '24 16:03 hansottowirtz

Hey @thatsmydoing @merceyz -- is this safe to be merged?

gabrielrussoc avatar Jun 25 '24 12:06 gabrielrussoc