conda-pack icon indicating copy to clipboard operation
conda-pack copied to clipboard

Q: Programatically detect if 'conda-unpack' has already been executed?

Open HenrikBengtsson opened this issue 2 years ago • 3 comments

On https://conda.github.io/conda-pack/ it says:

Once an environment is unpacked and conda-unpack has been executed, it cannot be relocated. Re-applying conda-pack is unlikely to work.

Is there a way to programmatically detect whether or not conda-unpack has already been executed?

HenrikBengtsson avatar Apr 13 '22 18:04 HenrikBengtsson

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include: - What OS and version you reproduced the issue on - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

github-actions[bot] avatar May 26 '22 04:05 github-actions[bot]

ping

HenrikBengtsson avatar May 26 '22 04:05 HenrikBengtsson

I'm interested in this functionality as well. What I've been doing is building a tarball with conda-pack and having all bash script utilities I place in it run conda-unpack and write a <prefix>/.installed file that contains the absolute prefix path. Then any future executions I check if the .installed path doesn't match the current prefix I rerun conda-unpack. However, as mentioned in the documentation, this doesn't actually update the files that were updated in the initial execution.

I wonder if conda-pack could bundle a "package data" file that serves the same purpose as my .installed file. Theoretically this should give it all the information needed to know if it should run again. I think you could even use conda post-link scripts to create the initial version of this file with the conda environment's path: https://docs.conda.io/projects/conda-build/en/latest/resources/link-scripts.html

djhoese avatar Jun 11 '22 20:06 djhoese