Caching fails when trying to speed up installing different versions of pyenv, goenv, nvm
One of the possible errors are that the Machine executors have these tools preinstalled but the owner is not circleci user but root but there are also some symlinks
Is there an effective way to cache pyenv versions installed?
Can you elaborate more about how / why it’s failing?
And are you using multiple versions of one or more of these tools in a single job, or is this a matrix type setup? Are you talking about the versions of pyenv
/ goenv
etc. themselves (in which case, the answer may be different depending on the tool)? Or the versions of the underlying software (python
, go
, etc.)?
I’d normally try to avoid using these tools within CI jobs if at all possible and use a docker container tied to a specific version, but without knowing exactly what you’re trying to do or what’s going wrong, assuming you’re trying to cache each version of the actual underlying software, I’d probably try to use a cache directory per version, if that makes sense?
You could also see if not trying to cache at all ends up being faster.
I would like to use CCI caching to avoid spending over 3 min on every run installing specific Python versions across the many different projects we have
I tried caching the CCI installation for pyenv on the machine executors but it comes backs with a long list of errors on symlinks
I’ve also asked this question on the pyenv project itself
Would it work to use a container with the correct Python tag for each version you’re testing? IMO, that might be simpler / preferred. You’d still probably want to use a Python version specific cache key etc. for any pip libraries you’re caching, though.
The symlink error might be because you’re missing saving or restoring the target of the symlink or the symlink itself maybe? Maybe run the jobs with ssh and see a) where pyenv
is installing stuff and b) where the dangling symlinks are pointing?
Maybe if you can post your actual config and the error you’re seeing, folks will be able to help a bit more.