jquast / x84

A python telnet/ssh server for modern terminals. In spirit of classic software such as ami/x, teleguard, renegade, iniquity.

Home Page:http://x84.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed building wheel for cryptography on Ubuntu systems

opened this issue · comments

The first issue is:

  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
  In file included from build/temp.linux-x86_64-2.7/_openssl.c:2:0:
  /usr/include/python2.7/Python.h:47:10: fatal error: crypt.h: No such file or directory
   #include <crypt.h>
            ^~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cryptography

Later:

  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibcrypt/crypt_blowfish-1.3 -I/usr/include/python2.7 -c bcrypt/__pycache__/_bcrypt_cffi_6b390667x92a686ca.c -o build/temp.linux-x86_64-2.7/bcrypt/__pycache__/_bcrypt_cffi_6b390667x92a686ca.o
  In file included from bcrypt/__pycache__/_bcrypt_cffi_6b390667x92a686ca.c:209:0:
  bcrypt/crypt_blowfish-1.3/ow-crypt.h:27:14: error: conflicting types for ‘crypt_r’
   extern char *crypt_r(__const char *key, __const char *setting, void *data);
                ^~~~~~~
  In file included from bcrypt/crypt_blowfish-1.3/crypt.h:17:0,
                   from /usr/include/python2.7/Python.h:47,
                   from bcrypt/__pycache__/_bcrypt_cffi_6b390667x92a686ca.c:2:
  /usr/include/gnu-crypt.h:60:14: note: previous declaration of ‘crypt_r’ was here
   extern char *crypt_r (const char *__key, const char *__salt,
                ^~~~~~~
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for bcrypt
  Running setup.py clean for bcrypt
Failed to build cryptography bcrypt
Installing collected packages: cryptography, pyOpenSSL, paramiko, bcrypt, x84
  Found existing installation: cryptography 2.1.4
    Not uninstalling cryptography at /usr/lib/python2.7/dist-packages, outside environment /usr
  Running setup.py install for cryptography ... error

Unsure what to do about this. crypt.h appears to be part of gnulib. gnulib is definitely installed. Unsure if this is the same as /usr/include/gnu-crypt.h

Attempted to symlink it to see. Still fails.

lrwxrwxrwx  1 root root     13 Mar 13 18:55 crypt.h -> ./gnu-crypt.h
-rw-r--r--  1 root root   2259 Mar 13 18:40 gnu-crypt.h

This is: Ubuntu 18.04.4 LTS (bionic)

beforesymlink.txt
aftersymlink.txt

sudo apt-get install libcrypt-dev

maybe also suggest,

sudo apt-get install --reinstall python2-dev

because that should include anything required to #include "Python.h", which is all that is going on here to begin the problem on line 47, where it wants to incude crypt.h.

I destroyed the Digital Ocean droplet I was using and created a fresh one.

Did an apt-get update && apt-get upgrade

Then I did an apt-get install --install-suggests for the following packages, with all of the ones enumerated by the Dockerfile you link to:

  • python2.7
  • python2.7-dev
  • build-essential
  • libssl1.0.0
  • libssl-dev
  • libffi6
  • libffi-dev
  • python-pip
  • dosemu

And for the last, there is no package called libcrypt-dev, at least not in Ubuntu 18.04.4 LTS (bionic). There is one called libxcrypt-dev which I also installed with --install-suggests

This installs basically a massive kitchen sink of things.

It fails in the same places.

Something may have changed in Ubuntu; I don't know. Ironically, there is a comment on the Dockerfile which says:

switch to ubuntu; sick of debian breaking shit

I have a digital ocean at latest debian, also running x/84, I see the same issue, so I will take a look soon (telnet 1984.ws). Thanks for the report. I'm trying to make a "last release" that keeps this system running with Python 2 for many decades beyond the year 2020 :)

I wont be able to look at this for a while, I've got to relocate my home first, best wishes

I feel like we ran into this before, but with OpenSSL. I may poke around if I have time.

Fix in #304