conda-libmamba-solver icon indicating copy to clipboard operation
conda-libmamba-solver copied to clipboard

CLS injects channels from installed packages

Open kenodegard opened this issue 1 year ago • 4 comments

Checklist

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

What is the idea?

Libmamba changes the default behavior of what channels are used for solves by appended the installed package's channels to the list of channels. So once a channel has been used to fetch a package, that channel will continue to be included in all future solves even if we no longer wish to use that channel.

We can return to classic's behavior by enabling CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED, see docs.

I'm wondering how and why this feature was decided on in the first place and whether there is additional context that can be provided.

Why is this needed?

No response

What should happen?

No response

Additional Context

No response

kenodegard avatar Dec 14 '23 21:12 kenodegard

Introduced in https://github.com/conda/conda-libmamba-solver/pull/52 as a workaround for https://github.com/conda/conda/issues/11790, supported by source code comments in conda/conda.

jaimergp avatar Dec 17 '23 18:12 jaimergp

A number of experienced conda users have reported to me that they are surprised by the work-around and indicated that CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED should be the default instead of an option (or maybe switch the default and provide a config value?).

jezdez avatar Apr 26 '24 06:04 jezdez

The PR discussion contains the rationale: very loud warnings alarmed the user otherwise. The conda classic code contained comments suggesting this behaviour should be implemented, too. The env var is there because so far we don't have a way to configure per-plugin settings (but this is in the making). This is documented in the documentation, a pinned issue, and this one.

That said we can flip this back with the (upcoming) libmamba v2, I think. We have more control over the solver.

jaimergp avatar Apr 26 '24 08:04 jaimergp

As a user, I would be astonished if ffmpeg were to be installed from the pytorch channel if I do this:

conda create -n py310 python=3.10
conda activate py310
conda install pytorch::pytorch
conda install ffmpeg

Historically, the :: syntax has not conveyed "add this channel to the default places to search", and that's certainly not what I would have intended to happen. Can't the warning messages be addressed more directly? Seems like that should be a special thing to catch ("oh, don't warn about this one, because it's from another channel that we don't have repodata for (or whose repodata is kept separate from the rest to avoid using it in solves)").

jbednar avatar Apr 26 '24 14:04 jbednar