I’ve been trying to package a project of mine with nix on Mac OS. This project uses numpy distutils rather than setuptools since it has some Fortran code embedded in it. Here is the nix I am using (I’m on the release-20.09 channel):
with import <nixpkgs> {};
with pkgs.python3Packages;
buildPythonPackage rec {
name = "mypackage";
src = ./.;
nativeBuildInputs = [ gfortran stdenv ];
propagatedBuildInputs = [ pytest numpy dask click appdirs requests h5py
xarray scikitimage scipy toolz pooch intake zarr ];
}
nix-build
successully builds the wheel, compiling the Fortran code, but then fails to install the wheel in the nix-store with this error message:
Finished executing setuptoolsBuildPhase
installing
Executing pipInstallPhase
/private/tmp/nix-build-python3.8-mypackage.drv-0/vcm/dist /private/tmp/nix-build-python3.8-mypackage.drv-0/vcm
ERROR: vcm-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl is not a supported wheel on this platform.
I have verified that this wheel can be installed a typical virtualenv so I am not sure what the problem is or how to debug nix’s sandboxed builds. I would appreciate some pointers. Thanks.