rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

Build variants create inscrutable solver errors

Open h-vetinari opened this issue 5 months ago • 3 comments

In feedstocks depending on openmpi variants, it's ~common to have dependencies of the kind.

    - hdf5
    - hdf5 * mpi_${{ mpi }}_*

However, the solver throws up over them for no apparent reason:

Error:   × Failed to resolve dependencies: Cannot solve the request because of: hdf5
  │ * mpi_mpich_* cannot be installed because there are no viable options:
  │ └─ hdf5 1.10.4 | 1.10.5 | 1.10.5 | 1.10.5 | 1.10.5 | 1.10.5 | 1.10.5 |
  │ 1.10.5 would require
  │    └─ mpich >=3.2,<3.3.0a0, for which no candidates were found.
  │ The following packages are incompatible
  │ ├─ hdf5 * mpi_mpich_* cannot be installed because there are no viable
  │ options:
  │ │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.2, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.2, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.2, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ │  └─ hdf5 1.10.5, which conflicts with the versions reported above.
  │ └─ hdf5 1.14.6.* cannot be installed because there are no viable options:
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    ├─ hdf5 1.14.6, which conflicts with the versions reported above.
  │    └─ hdf5 1.14.6, which conflicts with the versions reported above.
  │ 
  ╰─▶ Cannot solve the request because of: hdf5 * mpi_mpich_* cannot be
      installed because there are no viable options:
      └─ hdf5 1.10.4 | 1.10.5 | 1.10.5 | 1.10.5 | 1.10.5 | 1.10.5 | 1.10.5 |
      1.10.5 would require
         └─ mpich >=3.2,<3.3.0a0, for which no candidates were found.
      The following packages are incompatible
      ├─ hdf5 * mpi_mpich_* cannot be installed because there are no viable
      options:
      │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.4, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.3, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.2, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.14.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.2, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.2, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.1, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.12.0, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.6, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  ├─ hdf5 1.10.5, which conflicts with the versions reported above.
      │  └─ hdf5 1.10.5, which conflicts with the versions reported above.
      └─ hdf5 1.14.6.* cannot be installed because there are no viable
      options:
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         ├─ hdf5 1.14.6, which conflicts with the versions reported above.
         └─ hdf5 1.14.6, which conflicts with the versions reported above.

It looks like it's trying first to search for hdf5 * mpi_mpich_*, which is just stupid because there's already a rich set of constraints to start off with

 │ │   Specs:
 │ │    - libblas 3.9.* *netlib
 │ │    - liblapack 3.9.* *netlib
 │ │    - cmake
 │ │    - mpich 4.*
 │ │    - yaml
 │ │    - libhwloc 2.11.2.*
 │ │    - metis 5.1.0.*
 │ │    - parmetis
 │ │    - libptscotch 7.0.6.*
 │ │    - scalapack
 │ │    - superlu
 │ │    - superlu_dist 9.*
 │ │    - libscotch 7.0.6.*
 │ │    - mumps-mpi 5.7.3.*
 │ │    - libamd 3.*
 │ │    - libcholmod 5.*
 │ │    - libklu 2.*
 │ │    - libspqr 4.*
 │ │    - libumfpack 6.*
 │ │    - hdf5 1.14.6.*
 │ │    - hdf5 * mpi_mpich_*
 │ │    - fftw 3.*
 │ │    - fftw * mpi_mpich_*
 │ │    - __osx >=10.13
 │ │    - libcxx >=19
 │ │    - libgfortran
 │ │    - libgfortran5 >=14.3.0

Listing all the incompatible hdf5 versions when it's already pinned to hdf5 1.14.6.* is just not helpful.

In the case of https://github.com/conda-forge/qe-feedstock/pull/71 it completely obscured that there was a conflicting openmpi pin due to a missing migration. In https://github.com/conda-forge/petsc-feedstock/pull/253 I cannot even tell what's going wrong, all builds are available AFAICT.

h-vetinari avatar Jul 25 '25 07:07 h-vetinari

Yeah improving the solver error messages would be amazing. I think this issue might be mostly in resolvo, actually. @baszalmstra should we move this one to resolvo?

wolfv avatar Jul 25 '25 07:07 wolfv

And yes, I think we could try to filter solver errors with "direct specs" to get a cleaner set of conflicts (and no unrelated versions).

wolfv avatar Jul 25 '25 07:07 wolfv

edit: removed redundant description from initial post

If it helps, I've tracked this down to a partial migration of libhwloc and the libgfortran versioning happening at the same time.

fwiw, given the constraint:

    - hdf5 1.14.6.*
    - hdf5 * mpi_mpich_*

If the same constraint is expressed as hdf5 1.14.6.* mpi_mpich_* it produces a more reasonable conflict message:

Error:   × Failed to resolve dependencies: Cannot solve the request because of: The following packages are incompatible
  │ └─ hdf5 1.14.6.* mpi_mpich_* cannot be installed because there are no viable options:
  │    ├─ hdf5 1.14.6 would require
  │    │  ├─ mpich >=4.3.1,<5.0a0, which can be installed with any of the following options:
  │    │  │  └─ mpich 4.3.1 would require
  │    │  │     └─ libgfortran 5.*, which can be installed with any of the following options:
  │    │  │        └─ libgfortran 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 |
  │ 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0
  │    │  └─ libgfortran5 >=15.1.0, which cannot be installed because there are no viable options:
  │    │     └─ libgfortran5 15.1.0 would constrain
  │    │        └─ libgfortran ==15.1.0, which conflicts with any installable versions previously reported
  │    └─ hdf5 1.14.6 | 1.14.6 | 1.14.6 would require
  │       ├─ libgfortran 5.*, which can be installed with any of the following options:
  │       └─ libgfortran5 >=13.3.0, which cannot be installed because there are no viable options:
  │          ├─ libgfortran5 15.1.0 would constrain
  │          │  └─ libgfortran ==15.1.0, which conflicts with any installable versions previously reported
  │          └─ libgfortran5 14.3.0 would constrain
  │             └─ libgfortran ==14.3.0, which conflicts with any installable versions previously reported
  │
  ╰─▶ Cannot solve the request because of: The following packages are incompatible
      └─ hdf5 1.14.6.* mpi_mpich_* cannot be installed because there are no viable options:
         ├─ hdf5 1.14.6 would require
         │  ├─ mpich >=4.3.1,<5.0a0, which can be installed with any of the following options:
         │  │  └─ mpich 4.3.1 would require
         │  │     └─ libgfortran 5.*, which can be installed with any of the following options:
         │  │        └─ libgfortran 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 |
      5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0 | 5.0.0
         │  └─ libgfortran5 >=15.1.0, which cannot be installed because there are no viable options:
         │     └─ libgfortran5 15.1.0 would constrain
         │        └─ libgfortran ==15.1.0, which conflicts with any installable versions previously reported
         └─ hdf5 1.14.6 | 1.14.6 | 1.14.6 would require
            ├─ libgfortran 5.*, which can be installed with any of the following options:
            └─ libgfortran5 >=13.3.0, which cannot be installed because there are no viable options:
               ├─ libgfortran5 15.1.0 would constrain
               │  └─ libgfortran ==15.1.0, which conflicts with any installable versions previously reported
               └─ libgfortran5 14.3.0 would constrain
                  └─ libgfortran ==14.3.0, which conflicts with any installable versions previously reported

mamba produces the most informative error, mentioning libhwloc, which is actually the key to the conflict:

> mamba create -p /tmp/env --dry-run --platform osx-64 'hdf5=1.14.6=mpi_mpich_*' 'libhwloc=2.11.2' 'libgfortran5>=14.3'
conda-forge/noarch                                  21.6MB @  23.6MB/s  0.8s
conda-forge/osx-64                                  39.6MB @  25.6MB/s  1.5s

error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ hdf5 =1.14.6 mpi_mpich_* is installable with the potential options
    │  ├─ hdf5 1.14.6 would require
    │  │  └─ libgfortran =5 *, which can be installed;
    │  └─ hdf5 1.14.6 would require
    │     ├─ libgfortran5 >=15.1.0 *, which requires
    │     │  └─ libgfortran ==15.1.0 *, which conflicts with any installable versions previously reported;
    │     └─ mpich >=4.3.1,<5.0a0 * with the potential options
    │        ├─ mpich 4.3.1 would require
    │        │  └─ libhwloc >=2.12.1,<2.12.2.0a0 *, which can be installed;
    │        └─ mpich 4.3.1 would require
    │           └─ libgfortran =5 *, which can be installed;
    ├─ libgfortran5 >=14.3 * is not installable because there are no viable options
    │  ├─ libgfortran5 14.3.0 would require
    │  │  └─ libgfortran ==14.3.0 *, which conflicts with any installable versions previously reported;
    │  └─ libgfortran5 15.1.0, which cannot be installed (as previously explained);
    └─ libhwloc =2.11.2 * is not installable because it conflicts with any installable versions previously reported.
critical libmamba Could not solve for environment specs

Reproducible with this reduced recipe:

package:
  name: test
  version: 0

requirements:
  host:
    - mpich 4.*
    - hdf5 1.14.6.*
    - hdf5 * mpi_mpich_*
    - libhwloc 2.11.2.*
    - libgfortran
    - libgfortran5 >=14.3.0

with rattler-build build --target-platform osx-64 -r recipe (I'm not sure why only osx-64 is affected)

minrk avatar Aug 09 '25 17:08 minrk