-
Notifications
You must be signed in to change notification settings - Fork 80
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
Yarn install does not use the cache-path parameter #61
Comments
I found your issue and had a look this morning, because I was curious. I added a lot of logs to my build to try and troubleshoot this. I found that yarn uses Here is the output of
Maybe what isn't obvious is that Moreover, trying to save to an existing cache key doesn't work either: this is skipped instead of being replaced. Initially I got the same problem as you when I tried on my project. I could fix it by adding Therefore I think that everything works like it should :-) and that this bug could be closed. Hope this helps! |
Thanks for taking the time to look at the issue @julienw.
I didn't realize that was the default. I don't remember how I chose this value, but that wasn't by looking the default up. If I specify a Regarding the One thing I just noticed and which could indicate this Orb's purpose doesn't match my use case, is that |
Yeah that's right. I wonder what is the use case for this though :-)
This is even a bit more subtle: if you try to save with the same key as an existing cache (because same lock / same branch), then the save will be skipped altogether, even if there are files to be saved. So there were actually 2 problems here, if the cache already exists: 1/ no new file in
Yeah, actually this is the issue I wanted to file initially and that's why I looked at other issues and found this one first :D I was planning to file this issue indeed. Update: filed #63 |
I don't have any specific use case in mind 🤔 , but since the Orb allows changing the cache path, it should use it in the
Thank you. |
I also found it counter-intuitive that |
Hi! Thank you for your patience. I'll look at getting this into the next major version if possible :) |
Implemented in #94 Please feel free to review the changes and see if they work for your use-case 😄 |
Orb version:
4.1.0
What happened:
I have the following configuration:
There is, unfortunately, no visual way to describe what I think is happening, because
yarn install
's output is the same whether the dependencies are cached or not. Only the duration can be an indicator, but it's too variable between jobs to be reliable.If I understand correctly the code, when
cache-path
is specified, that's the path which will be cached bysave_cache
.That path is, however, not used by
yarn install
, unless I override the command withoverride-ci-command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
.Expected behavior:
The
yarn install
command uses the cache directory specified bycache-path
.Alternatively, the documentation could be clarified to explain that the install command needs to be overridden with
override-ci-command
to specify the cache folder.Currently the documentation for the
cache-path
parameter is confusing for yarn users:Additional Information:
AFAIK, this is also true for
npm
.I haven't used recent versions of
npm
and I don't know how its cache works, though.The text was updated successfully, but these errors were encountered: