Skip to content
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

Nasty edge case in the cached env docs #361

Open
liamhuber opened this issue Jul 25, 2024 · 0 comments
Open

Nasty edge case in the cached env docs #361

liamhuber opened this issue Jul 25, 2024 · 0 comments

Comments

@liamhuber
Copy link

I ran into a case where specifying a range of python in the env used for the mamba env update -n anaconda-client-env -f etc/example-environment-caching.yml step of the caching docs results in overriding the requested version of python passed to the setup-miniconda python-version action arg. In a hindsight-is-20/20 moment, it makes perfect sense that the update overrides things an bumps python to the maximum version specified in the range!

It's possible there are a few other manifestations of this symptom; at some point we managed to get python and python_abi having different versions due to this issue.

The solution I found is to instead take a five-step process so that the cache-free invocation of setup-miniconda always exploits the environment-file argument, which allows the python-version to be respected. Basically:

  • Check for a cache with lookup-only = true
  • If cache hit: run setup-miniconda without environment-file
  • If cache hit: restore cache
  • if cache not hit: run setup-miniconda with environment-file
  • if cache not hit: save cache

I made a repo demonstrating this, and as long as GitHub holds the run report, you can look and see that the docs approach has python upgrade while the careful approach outlined above retains the requested version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant