mach-nix icon indicating copy to clipboard operation
mach-nix copied to clipboard

conda provider confuses dashes and underscore when resolving packages

Open bjornfor opened this issue 3 years ago • 1 comments

This results in failure to create environments that pull in e.g. _libgcc_mutex, like the zip or mlir package does:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix/";
    ref = "refs/heads/master";
    rev = "7b0e7f6f58f7332c1b8347e2673036eada1a6998"; # 2022-03-22
  }) {};
in
  mach-nix.mkPython {
    requirements = ''
      zip
      #mlir
      #_libgcc_mutex
    '';
    providers = {
      _default = "conda/main,conda/conda-forge";
    };
  }
$ nix-build ./try-conda.nix 
[...]
The Package '-libgcc-mutex' (build: ('conda_forge', 'main')) is not available from any of the selected providers ['conda/conda-forge', 'conda/main']
 for the selected python version
[...]

Looking at https://github.com/DavHau/conda-channels I see _libgcc_mutex in there (note the underscore), which makes me think that mach-nix is missing a name.replace('_', '-') somewhere.

There are already several of those substitutions in the codebase, which explains why it displays the package in the error message with dashes instead of underscore.

bjornfor avatar Mar 26 '22 20:03 bjornfor

I also hit this problem with the yaml package.

jamesdbrock avatar Aug 29 '22 07:08 jamesdbrock