build-image icon indicating copy to clipboard operation
build-image copied to clipboard

Yarn arguments

Open arcanis opened this issue 5 years ago • 7 comments

Opening an issue here as requested in the support email (I initially asked on Twitter what was the best PoC, and was redirected to the support) 🙂

Yarn 2 doesn't support the --cache-folder command-line option (it always was problematic, because users had to specify it at every single command). This causes a crash on Netlify when using Yarn together with the v2 (currently flagged experimental, fortunately).

Additionally, starting from Yarn 2 we no longer have different logic between the Yarn cache and the offline mirrors. The directory pointed by the cache-folder key will be populated with archives, and as such it becomes possible (and recommended in various situations) to add the cache to the repository (amongst other things, it enables Zero-installs). However, this doesn't work if Netlify configures a different cache location than the default one.

We're currently hitting this issue with the Yarn 2 Netlify instance (example), but it's likely your customers would encounter it as well once we start publishing formal releases. I'd be happy to help find out a solution (I lead Yarn's development) 🙂

arcanis avatar Jun 03 '19 15:06 arcanis

@ekfuhrmann This isn't related.

8:58:58 AM: error An unexpected error occurred: "https://registry.yarnpkg.com/lodash.--imagelate/-/lodash.--imagelate-3.6.2.tgz: Request failed \"404 Not Found\"".

arcanis avatar Jun 05 '19 14:06 arcanis

@arcanis My mistake!

ekfuhrmann avatar Jun 05 '19 15:06 ekfuhrmann

Ping someone? @bcomnes maybe? 😄

arcanis avatar Jun 13 '19 12:06 arcanis

@bcomnes has sadly found a new gig. Sorry for the delay, we are trying to get our internal resources marshaled to be able to properly respond to requests on the image.

rybit avatar Jun 13 '19 14:06 rybit

No worry 🙂

arcanis avatar Jun 13 '19 14:06 arcanis

The workaround for packages not being cached is setting the environment variable YARN_GLOBAL_FOLDER to /opt/buildhome/.yarn_cache and YARN_ENABLE_GLOBAL_CACHE=1 in Netlify settings. Note this depends on the undocumented path in https://github.com/netlify/build-image/blob/5159a4be00a042d42ec5f03647f823057e943bbc/run-build-functions.sh#L10 https://github.com/netlify/build-image/blob/5159a4be00a042d42ec5f03647f823057e943bbc/run-build-functions.sh#L113 so it may break in the future.

ylemkimon avatar Aug 03 '20 11:08 ylemkimon

Looks like @ylemkimon has fixed this issue in #465. @rybit do you think it's likely to be merged?

camjackson avatar Apr 20 '21 11:04 camjackson