setup-micromamba
should fail when restoring an existing conda environment
#219
Labels
bug
Something isn't working
setup-micromamba
currently does not fail when restoring a cached environment on top of an existing one. Instead, all files from the cache override the existing ones, while all other files from the existing environment persist. This leads to multiple issues; for example, theconda-meta
folder can contain multiple files for the same package with different versions, or imports may break (such asutils.py
from a dependency getting split intoutils/__init__.py
whileutils.py
persists and takes precedence overutils/
).While
setup-micromamba
could attempt to rectify the situation by pruning the target folder before restoring the cached environment, I believe it should instead produce an error. The better fix is to use either:job-completed
shell hook (removing the burden from users), orpost-cleanup
toenvironment
to instructsetup-micromamba
to do this automatically.Ideally,
setup-micromamba
would detect that it is running inside a long-livingself-hosted
runner, but I could not find any provided environment variables or similar indicators that would facilitate this elegantly.The text was updated successfully, but these errors were encountered: