conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
381 stars 423 forks source link

Can't build <package> because it is in conflict with itself #1858

Closed lsorber closed 6 years ago

lsorber commented 7 years ago

In trying to package the MILP solver Coin-OR CBC with MKL support for Windows, I came across a strange error where the package's run environment seems to be in conflict with itself -- even though there are no runtime dependencies on Windows.

On Linux, conda build works fine and generates shared libraries. On Windows, the build generates working static libraries but fails with the message that the environment is in conflict (see below). If I remove mkl as a feature, the Windows build successfully compiles. Why would adding mkl as a feature cause such a problem? I would like to keep it as a feature since I may want to also make an OpenBLAS variant.

Below is the output of conda build . --debug:

DEBUG conda.core.repodata:fetch_repodata(444): 304 NOT MODIFIED for 'https://repo.continuum.io/pkgs/msys2/noarch'. Updating mtime and loading from disk
.
DEBUG conda.plan:augment_specs(686): Pinned specs=[]
DEBUG conda.resolve:install_specs(781): Checking satisfiability of current install
DEBUG conda.resolve:bad_installed(731): Checking if the current environment is consistent
Solving package specifications: DEBUG conda.resolve:solve(836): Solving for [MatchSpec('coincbc 2.9.8 mkl_1')]
DEBUG conda.resolve:get_reduced_index(374): Retrieving packages for: [MatchSpec('coincbc 2.9.8 mkl_1')]
DEBUG conda.resolve:filter_group(399): coincbc: pruned from 3 -> 1
.
Can't build C:\Users\laurent\coincbc due to environment creation error:
The following specifications were found to be in conflict:
  - coincbc 2.9.8 mkl_1
Use "conda info <package>" to see the dependencies for each package.

The relevant part of the recipe [1] is:

build:
  number: 1
  features:
    - mkl

requirements:
  build:
    - m2-base # [win]
    - m2-make # [win]
    - m2w64-toolchain # [win]
    - gcc # [not win]
    - mkl
  run:
    - libgcc # [not win]
    - mkl # [not win]

[1] https://github.com/forespell/coincbc (based on conda-forge's coincbc package)

msarahan commented 7 years ago

usually this kind of error comes due to a lack of feature activation. If you want to include mkl, and you're not including any packages that define track_features for mkl, then you end up with unsatisfiable dependencies. Sorry it's not more intuitive. Theres some info here: https://github.com/conda/conda/wiki/VC-features#how-features-get-activated

If you don't want to add a package dependency on something that does "track" mkl, then you need to add the mkl track_feature also to your recipe.

github-actions[bot] commented 2 years ago

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!