rattler icon indicating copy to clipboard operation
rattler copied to clipboard

Multichannel support

Open jaimergp opened this issue 6 months ago • 6 comments

Checklist

  • [x] I added a descriptive title
  • [x] I searched open requests and couldn't find a duplicate

What is the idea?

Add an optional field in rattler.Channel that allows users to refer to this channel with another name(s). e.g. the python package in https://repo.anaconda.com/pkgs/main can be queried with both pkgs/main::python and defaults::python.

The option can be named multichannel_names, additional_names, extra_names, etc.

Why is this needed?

conda and mamba have this notion of Multichannel objects: a channel that is actually composed of a number of channels underneath. It is used to merge existing channels under a unified name in the CLI. I don't like how they are implemented in conda, but we do need to implement that UX use case in the CLI (e.g. requesting a package from defaults by doing conda install defaults::python instead of pkgs/main::python.

Common multichannels are:

  • By default, conda has a multichannel named defaults, which pulls from repo.anaconda.com/pkgs/{main,r,msys2}.
  • conda-build injects a multichannel named local, which pulls from the all the local paths conda-build puts built artifacts in.
  • Users can define their own via custom_multichannels option in condarc.

What should happen?

I think the best solution is to add an option in ChannelConfig. Then the solver bits would need to be aware of these extra names when querying, filtering and sorting the records.

Additional Context

No response

jaimergp avatar May 18 '25 13:05 jaimergp

To support this, we should also add a MultiChannel object as a set of ChannelUrls. We need to add support for this in a few places, the Gateway and MatchSpec I think.

baszalmstra avatar May 20 '25 15:05 baszalmstra

How would we load multiple SparseRepodata objects for a multichannel in a MultiChannel-aware API?

jaimergp avatar May 21 '25 08:05 jaimergp

You would basically have to load all of them seperately. But maybe I misunderstand multichannels.

baszalmstra avatar May 21 '25 08:05 baszalmstra

Yep, that's what I expect too. My question is how we would pass the "this sparse repodata belongs to this multichannel" metadata. With some argument in the rattler.Channel object?

jaimergp avatar May 21 '25 09:05 jaimergp

MultiSparseRepoData I guess 😅

baszalmstra avatar May 21 '25 09:05 baszalmstra

That would work for me and would help understand the channel priority logic too (because all channels within a multichannel should have the same channel priority).

jaimergp avatar May 21 '25 09:05 jaimergp