mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.57k stars 343 forks source link

v2: Do not load `.tar.bz2` record if there's a `.conda` artifact counterpart #3250

Closed jaimergp closed 3 months ago

jaimergp commented 3 months ago

defaults has both .tar.bz2 and .conda artifacts for many of its packages. When loading the repodata for e.g. defaults/noarch, conda's SubdirData will not list the tar.bz2 artifacts for those packages that feature a .conda copy. This saves a lot of items.

I have a local test I haven't pushed yet, but this is the gist:

File "/workspaces/conda-libmamba-solver/tests/test_index2.py", line 84, in test_defaults_use_only_tar_bz2
    assert libmamba_tar_bz2_total + libmamba_dot_conda_total == conda_tar_bz2_total + conda_dot_conda_total
AssertionError: assert (19967 + 14276) == (5691 + 14276)

I don't know if you want to do this by default, but maybe it can be a flag exposed in the Database signatures?

AntoinePrv commented 3 months ago

What is a good criteria to know if a .conda and .tar.bz2 are the same? Would filename without extension (i.e. name, version, build-string) suffice?

jaimergp commented 3 months ago

Would filename without extension (i.e. name, version, build-string) suffice?

I'm not sure if that's what conda/conda seems to be doing in this block. It looks like they are merging entries more than replacing them altogether, though 🤔