Skip to content

conda-pack with --format noarchive fails if two packages provide the same file #422

@ahmadsharif1

Description

@ahmadsharif1

Checklist

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

What happened?

Example, in my conda env:

conda-pack --format no-archive --ignore-missing-files --ignore-editable-packages --output /tmp/foo2
# This fails at around 30%

echo $?
0

# The failure is silent

Upon investigation, I found that two conda packages provide the same file:

find $CONDA_PREFIX/conda-meta -type f | xargs grep libexpat.so.1
/home/user/conda-meta/expat-2.6.2-h6a678d5_0.json:  "lib/libexpat.so.1",
/home/user/conda-meta/expat-2.6.2-h6a678d5_0.json:  "lib/libexpat.so.1.9.2",
/home/user/conda-meta/expat-2.6.2-h6a678d5_0.json:    "_path": "lib/libexpat.so.1",
/home/user/conda-meta/expat-2.6.2-h6a678d5_0.json:    "_path": "lib/libexpat.so.1.9.2",
/home/user/conda-meta/libexpat-2.6.2-h59595ed_0.json:  "lib/libexpat.so.1",
/home/user/conda-meta/libexpat-2.6.2-h59595ed_0.json:  "lib/libexpat.so.1.9.2"
/home/user/conda-meta/libexpat-2.6.2-h59595ed_0.json:    "_path": "lib/libexpat.so.1",
/home/user/conda-meta/libexpat-2.6.2-h59595ed_0.json:    "_path": "lib/libexpat.so.1.9.2",

And the Noarchive object fails at the symlink because it already exists:

if os.path.isfile(source) or os.path.islink(source):

OTOH, shutil.copy2 overwrites if the file already exists, so perhaps the fix should be to use that if the destination file exists (or never to overwrite).

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type::bugdescribes erroneous operation, use severity::* to classify the type

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions