conda / conda-libmamba-solver

The libmamba based solver for conda.
https://conda.github.io/conda-libmamba-solver/
Other
204 stars 24 forks source link

Add hint to set CONDA_OVERRIDE_<virtual package> when solving on a different platform than current? #483

Open JeanChristopheMorinPerso opened 4 months ago

JeanChristopheMorinPerso commented 4 months ago

Checklist

What is the idea?

When trying to solve for a different platform than the current platform, the solve will likely fail unless virtual packages are overriden/set via environment variables.

For example, on osx-arm64:

$ CONDA_SUBDIR=linux-64 conda create -n test --dry-run 'snowflake-snowpark-python==1.18.0' --solver=libmamba
Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - nothing provides __glibc >=2.17 needed by libstdcxx-ng-11.2.0-h1234567_0

Could not solve for environment specs
The following package could not be installed
└─ snowflake-snowpark-python >0.8.0  is not installable because it requires
   └─ snowflake-connector-python [>=2.7.11 |>=2.7.12 |...|>=3.6.0,<4.0.0 ], which requires
      └─ libstdcxx-ng >=11.2.0 , which requires
         └─ __glibc >=2.17 , which is missing on the system.

I think that a hint could be useful here. For example:

Could not solve for environment specs
The following package could not be installed
└─ snowflake-snowpark-python >0.8.0  is not installable because it requires
   └─ snowflake-connector-python [>=2.7.11 |>=2.7.12 |...|>=3.6.0,<4.0.0 ], which requires
      └─ libstdcxx-ng >=11.2.0 , which requires
         └─ __glibc >=2.17 , which is missing on the system.

You are trying to solve for the linux-64 subdir while your current subdir is X, you might need to override the virtual packages highlighted above. See https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-virtual.html#overriding-detected-packages for more details.

Would that be useful?

Why is this needed?

It's very common to solve for a different platform that your current platform and it's kind of hard to find how to fix the glibc thing without prior knowledge of virtual packages. A hint would help a lot.

What should happen?

No response

Additional Context

No response

jaimergp commented 4 months ago

Thanks. I think this was brought up in https://github.com/conda/conda-libmamba-solver/issues/368 too.