nix-community/pypi2nix

Can't convert python cffi

Opened this issue · 1 comments

I tried using both the nixos-20.09 and nixpkgs-unstable channel of pypi2nix. Created a minimally reproducible error below:

❯ cat requirements.txt
cffi==1.14.4
❯ pypi2nix -r requirements.txt
INFO: pypi2nix v2.0.4 running ...
INFO: Downloading wheels and creating wheelhouse ...
INFO: Downloading runtime requirements
WARNING: You are using pip version 20.0.dev0; however, version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
INFO: Build wheels of setup and runtime requirements
  ERROR: Command errored out with exit status 1:
   command: /nix/store/9w0bfzra6v9n6xc6cp42zlmb54z0f1qn-python3-3.8.6-env/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/tmp9ac_lpwp/pip-wheel-ub74iabv/cffi/setup.py'"'"'; __file__='"'"'/tmp/tmp9ac_lpwp/pip-wheel-ub74iabv/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/tmp9ac_lpwp/pip-wheel-aghfvwxd
       cwd: /tmp/tmp9ac_lpwp/pip-wheel-ub74iabv/cffi/
  Complete output (36 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/cffi
  copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/error.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/__init__.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/api.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/commontypes.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/cparser.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/model.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/verifier.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/recompiler.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/lock.py -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/_embedding.h -> build/lib.linux-x86_64-3.8/cffi
  copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.8/cffi
  running build_ext
  building '_cffi_backend' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/c
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/nix/store/9w0bfzra6v9n6xc6cp42zlmb54z0f1qn-python3-3.8.6-env/include -I/nix/store/jdp800qwb3v330ggl6iq722ww96q2444-python3-3.8.6/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/c/_cffi_backend.o
  c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     15 | #include <ffi.h>
        |          ^~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cffi
ERROR: Failed to build one or more wheels
ERROR: Collecting cffi==1.14.4
ERROR:   Downloading cffi-1.14.4.tar.gz (471 kB)
ERROR:   Saved /tmp/tmp9ac_lpwp/download/cffi-1.14.4.tar.gz
ERROR: Collecting pycparser
ERROR:   Downloading pycparser-2.20.tar.gz (161 kB)
ERROR:   Saved /tmp/tmp9ac_lpwp/download/pycparser-2.20.tar.gz
ERROR: Successfully downloaded cffi pycparser
ERROR: Looking in links: file:///tmp/tmp9ac_lpwp/download
ERROR: Processing /tmp/tmp9ac_lpwp/download/cffi-1.14.4.tar.gz
ERROR: Processing /tmp/tmp9ac_lpwp/download/pycparser-2.20.tar.gz
ERROR: Building wheels for collected packages: cffi, pycparser
ERROR:   Building wheel for cffi (setup.py): started
ERROR:   Building wheel for cffi (setup.py): finished with status 'error'
ERROR:   Running setup.py clean for cffi
ERROR:   Building wheel for pycparser (setup.py): started
ERROR:   Building wheel for pycparser (setup.py): finished with status 'done'
ERROR:   Created wheel for pycparser: filename=pycparser-2.20-py2.py3-none-any.whl size=112041 sha256=b9e42fc6a259dc608d47b610937882e963421b9da46eae323be6c7510c8f7c77
ERROR:   Stored in directory: /tmp/tmp9ac_lpwp/cache/wheels/6c/62/a9/9cc1e4a26d24c6279dc05c4ec7859424edabc51b5ff94c85dc
ERROR: Successfully built pycparser
ERROR: Failed to build cffi
Do you want to report above issue (a browser will open with prefilled details of issue)? [y/N]:
Error: While trying to run the command something went wrong.

I have exactly the same problem with django's djsoer