[Nix-dev] Problem with python distutils

Andreas Herrmann andreash87 at gmx.ch
Tue Jul 1 18:02:49 CEST 2014


Hello everyone,

I am trying to add a nix-expression for mpi4py. It is a wrapper module for
the message passing interface for python.

Unfortunately, the build fails with with a distutils error. (The error
message is attached at the end of this mail.) When I googled the error I
found a seemingly related issue in the setuptools issue tracker [1]. It
seems to be a problem in how distutils and setuptools interact. A naive fix
that I tried was to simply update setuptools. However, that failed quite
badly. Setuptools seems to be a very complicated package and I wasn't able
to upgrade it. (I got into circular dependencies with pytest.)

So, I was wondering if anyone of you every came across this issue and knows
how to fix it, or has an idea where to start looking for a solution.
You can find my nix-expression for mpi4py under [2], and the corresponding
call in [3].

Best, Andreas

[1]:
https://bitbucket.org/pypa/setuptools/issue/73/typeerror-dist-must-be-a-distribution
[2]:
https://github.com/aherrmann/nixpkgs/blob/hdf5mpi/pkgs/development/python-modules/mpi4py/default.nix
[3]:
https://github.com/aherrmann/nixpkgs/blob/hdf5mpi/pkgs/top-level/python-packages.nix#L113

--------------------------------------------------------------
error message:

building 'mpi4py.dl' extension
/nix/store/hpcv8grqy84b4ijq7ixgg7rq9bk0lh2x-openmpi-1.6.5/bin/mpicc -fPIC
-fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
-DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1
-I/nix/store/c2a5czy3lvs16gr6lhkjk2d0gj41zhg1-python-2.7.7/include/python2.7
-c src/dynload.c -o build/temp.linux-x86_64-2.7/src/dynload.o
/nix/store/hpcv8grqy84b4ijq7ixgg7rq9bk0lh2x-openmpi-1.6.5/bin/mpicc -shared
build/temp.linux-x86_64-2.7/src/dynload.o
-L/nix/store/c2a5czy3lvs16gr6lhkjk2d0gj41zhg1-python-2.7.7/lib
-Lbuild/temp.linux-x86_64-2.7
-Wl,-R/nix/store/c2a5czy3lvs16gr6lhkjk2d0gj41zhg1-python-2.7.7/lib -ldl
-lpython2.7 -o build/lib.linux-x86_64-2.7/mpi4py/dl.so
running build_exe
Traceback (most recent call last):
  File "setup.py", line 588, in <module>
    main()
  File "setup.py", line 585, in main
    run_setup()
  File "setup.py", line 459, in run_setup
    **metadata)
  File
"/tmp/nix-build-python2.7-mpi4py-1.3.1.drv-7/mpi4py-1.3.1/conf/mpidistutils.py",
line 494, in setup
    return fcn_setup(**attrs)
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/core.py",
line 151, in setup
    dist.run_commands()
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/dist.py",
line 953, in run_commands
    self.run_command(cmd)
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/dist.py",
line 972, in run_command
    cmd_obj.run()
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/command/build.py",
line 127, in run
    self.run_command(cmd_name)
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/cmd.py",
line 326, in run_command
    self.distribution.run_command(command)
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/dist.py",
line 970, in run_command
    cmd_obj = self.get_command_obj(command)
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/dist.py",
line 846, in get_command_obj
    cmd_obj = self.command_obj[command] = klass(self)
  File
"/nix/store/fwabq51yh482v19qs7x1c619zp1yypmb-python2.7-distutils.cfg/lib/python2.7/site-packages/distutils/cmd.py",
line 59, in __init__
    raise TypeError, "dist must be a Distribution instance"
TypeError: dist must be a Distribution instance
note: keeping build directory `/tmp/nix-build-python2.7-mpi4py-1.3.1.drv-7'
builder for
`/nix/store/qwb90mn9cvdv5pzizvxag0a86agwpsip-python2.7-mpi4py-1.3.1.drv'
failed with exit code 1
error: build of
`/nix/store/qwb90mn9cvdv5pzizvxag0a86agwpsip-python2.7-mpi4py-1.3.1.drv'
failed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140701/e20727a3/attachment.html 


More information about the nix-dev mailing list