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

Question about how conda pack works, why the pack step is necessary #336

Closed
2 tasks done
jgarvin opened this issue May 8, 2024 · 4 comments
Closed
2 tasks done
Labels
type::documentation request for improved documentation

Comments

@jgarvin
Copy link

jgarvin commented May 8, 2024

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

I would like to better understand what conda-pack does. My understanding is that conda build already makes binaries relocatable by patching RPATH and other measures. If this is the case, what extra work is pack/unpack doing? Why can't conda build do it?

Additional Context

No response

@jgarvin jgarvin added the type::documentation request for improved documentation label May 8, 2024
@ncoghlan
Copy link

conda-pack and conda build work at different levels.

conda-pack packs an entire conda environment into a relocatable archive, not just a single conda package.

@jgarvin
Copy link
Author

jgarvin commented Jun 18, 2024

@ncoghlan thanks for the clarification, but that still leaves me wondering why conda-pack has anything to do, if all the packages inside the environment are all already individually relocatable? It sounds like you're implying I should be able to move conda build artifacts around without them breaking due to path assumptions, and a conda environment is a bunch of conda build artifacts, so I'm curious where the pathing assumptions get baked in?

@ncoghlan
Copy link

ncoghlan commented Jun 19, 2024

Most of what conda-pack does is simply making the archive itself. The work that conda-unpack does is mainly fixing shebang lines.

There is also some special case handling for various conda metadata files.

It's certainly possible to write your own code to do the same things that conda-pack does, and most things will still work correctly if you simply tar or zip the entire directory with no customisation of the input. conda-pack just tidies up the rough edges that arise when using a more simplistic approach.

The clearest documentation of exactly what those rough edges are is the conda-pack source code.

@jgarvin
Copy link
Author

jgarvin commented Jun 19, 2024

Thanks, I think that's enough for me to go on 👍

@jgarvin jgarvin closed this as completed Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::documentation request for improved documentation
Projects
Archived in project
Development

No branches or pull requests

2 participants