conda / conda-pack

Package conda environments for redistribution
https://conda.github.io/conda-pack/
BSD 3-Clause "New" or "Revised" License
528 stars 93 forks source link

Allow over-writing existing targets #339

Open kunalb opened 6 months ago

kunalb commented 6 months ago

Description

Depending on the conda environment, the same file may be written to multiple times (eg. if a specific lib.so file exists, multiple conda packages may have it and at pack time conda-pack will pull from the cache'd original copy of the package and copy it in; when multiple packages have the same lib.so file they'll over-write each other).

shutil.copy2 doesn't handle overwriting existing symlinks cleanly: it overwrites files silently but fails on creating a symlink (probably worth a separate PR to cpython later). Allow for this by explicitly deleting existing targets.

Checklist - did you ...

conda-bot commented 6 months ago

We require contributors to sign our Contributor License Agreement and we don't have one on file for @kunalb.

In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (https://github.com/conda/infrastructure/pull/946), and ping the bot to refresh the PR.