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

local multichannel for libmamba v2 #3124

Closed
jaimergp opened this issue Jan 12, 2024 · 6 comments
Closed

local multichannel for libmamba v2 #3124

jaimergp opened this issue Jan 12, 2024 · 6 comments

Comments

@jaimergp
Copy link
Contributor

In #3055 we identified a difference in how conda and mamba populate the local multichannel. @isuruf addressed this for conda-libmamba-solver via #3056 with a new context.conda_build_local_paths attribute that was released in 1.5.6.

This attribute is not present in v2 yet, but @mbargull was pointing out that with v2 we could finally standardize this behavior across implementations and drop the mamba 1.x (accidental?) departures.

If that's not desired, we'd still need the context.conda_build_local_paths bit in v2 though.

@AntoinePrv
Copy link
Member

AntoinePrv commented Jan 12, 2024

@jaimergp in V2 you'll have the option to not take Mamba's definition of local and define it yourself.

  • the specs::Channel class has no hardcoded names,
  • the ChannelContext is optional for creating channels, and mostly a holder and sugar for all the parameters needed to create a channel

@AntoinePrv
Copy link
Member

Ok, so I'm realizing you rely on the Pool, which needs the ChannelContext. So what you'll want to do is create a ChannelContext and passing it your own parameters with your own definition of local (and then defaults) in the custom_multichannel field. The whole process might be a bit verbose, but you'll end up with full customization.

@jaimergp
Copy link
Contributor Author

I just need to do it before .make_conda_compatible(), right? According to this, at least:

// This will not redefine them if the user has already defined these keys.

jaimergp added a commit to conda/conda-libmamba-solver that referenced this issue Jan 12, 2024
@AntoinePrv
Copy link
Member

Ha yes, either:

  • define local in Context.custom_multichannel beforecc = ChannelContext.make_conda_compatible() (or ChannelContext.make_simple for that matter)
  • or, don't call cc = ChannelContext.make_conda_compatible(), but cc= ChannelContext(...) for constructing a ChannelContext independently from Mamba's Context.

The first one might be the easiest to do, but the second will be more future proof as we aim to provide a solver API that does not rely on the context.

@jaimergp
Copy link
Contributor Author

I went with the first option for now, and seems to be working. Thanks for the info! I guess we'll switch to a proper ChannelContext() definition when time comes :D

@AntoinePrv
Copy link
Member

ChannelContext is pretty straightforward now (hope its stays that way). Just that you need to use a Context to use it, so that makes it verbose, but anyways, for now you might also need the Context in other APIs so...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants