-
Notifications
You must be signed in to change notification settings - Fork 54
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
Option to not include arch
in cache key
#130
Comments
I looked back at the docs for cache keys, and the description for
I'm not a bundler or gem expert, but my read of this is that it shouldn't matter if you restore a bundler cache from one architecture into another architecture. Especially in my example above where it's This also makes me think that |
architecture does matter because there are gems that have c libraries that are compiled on install. |
@vizjerai Thanks for the comment, that makes sense. Do you know whether those gems would break if the installation was ported between I suppose this is a circle issue: Either they need to ensure that all the steps of a workflow run with the same exact But absent those solutions from circle, it seems like for my use case the option to not include |
Describe Request
For the
install-deps
command I'd like to have an option to not includearch
in the cache key. This could be done with ainclude-arch-in-cache-key
option, which defaults to true, just likeinclude-branch-in-cache-key
.Motivation
I have a project that was not using this orb but instead manually running
bundle install
and manually doing the caching. I had RSpec and RuboCop running in downstream jobs in the workflow. The whole thing looked like this:apt-get
to installlibmagic
, a requirement for one of our gemsbundle install
bundle install
rspec
/rubocop
Originally I was including
arch
in the cache key, because I saw that in examples. However I had some jobs fail mysteriously, and it turned out the issue was that sometimes the RSpec or RuboCop jobs ran with a differentarch
than the bundle job earlier in the same workflow. For example, one would usearch1-linux-amd64-6_85
and the otherarch1-linux-amd64-6_106
. This would lead to an error in the RSpec/RuboCop jobs because:bundle install
would then try to reinstall all gems from scratchbundle install
would fail becauselibmagic
had not been installedMy solution to this problem was to remove
arch
from our cache keys, thus ensuring that there would always be a cache hit in RSpec/RuboCop. As far as I could tell, there was no issue sharing caches between these randomly different architectures. Everything has been good since then.Now I'm trying to convert us to this orb, but this orb always includes
arch
in the cache keys, which will lead to this issue again. I could solve it by always installinglibmagic
viapre-install-steps
, even in the RSpec/RuboCop jobs, but that's just a workaround — when there's no cache hit due toarch
it defeats the purpose of caching the bundle in a shared upstream job.The text was updated successfully, but these errors were encountered: