apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
484 stars 136 forks source link

Can't roll back cryptogtraphy; was not uninstalled #509

Open aaplmike opened 6 years ago

aaplmike commented 6 years ago

Can't get past this error. Latest python-cryptography already installed. Any ideas?


    build/temp.linux-x86_64-2.7/_openssl.c:2074:15: error: ‘SSLv2_method’ redeclared as different kind of symbol
     SSL_METHOD* (*SSLv2_method)(void) = NULL;
                   ^
    In file included from build/temp.linux-x86_64-2.7/_openssl.c:497:0:
    /usr/include/openssl/ssl.h:2021:19: note: previous declaration of ‘SSLv2_method’ was here
     const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
                       ^
    build/temp.linux-x86_64-2.7/_openssl.c:2075:15: error: ‘SSLv2_client_method’ redeclared as different kind of symbol
     SSL_METHOD* (*SSLv2_client_method)(void) = NULL;
                   ^
    In file included from build/temp.linux-x86_64-2.7/_openssl.c:497:0:
    /usr/include/openssl/ssl.h:2023:19: note: previous declaration of ‘SSLv2_client_method’ was here
     const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
                       ^
    build/temp.linux-x86_64-2.7/_openssl.c:2076:15: error: ‘SSLv2_server_method’ redeclared as different kind of symbol
     SSL_METHOD* (*SSLv2_server_method)(void) = NULL;
                   ^
    In file included from build/temp.linux-x86_64-2.7/_openssl.c:497:0:
    /usr/include/openssl/ssl.h:2022:19: note: previous declaration of ‘SSLv2_server_method’ was here
     const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
                       ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
  Can't roll back cryptography; was not uninstalled
Command "/usr/local/CalendarServer/.develop/virtualenv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-RLipO8/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-F29vIY-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/CalendarServer/.develop/virtualenv/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-build-RLipO8/cryptography```
aaplmike commented 6 years ago

root@util2:/usr/local/CalendarServer# uname -a Linux util2 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux root@util2:/usr/local/CalendarServer# cat /etc/debian_version 8.10

dreness commented 6 years ago

Seems like a mismatch between the versions of cryptography and OpenSSL. Only a certain amount of version skew is tolerated, and that amount varies over time based on... entropy? luck?

Hopefully, installing a newer OpenSSL is all that's needed. Also, you can use a fresh virtualenv as a simplified test case:

virtualenv crypto_test
cd crypto_test
source bin/activate
pip install cryptography

If you make any changes to system-provided deps, you might need to delete the .develop directory (in the git checkout root dir) before retrying ./bin/develop to pick up the changes.

References:

troglodyne commented 5 years ago

The way I fixed this for myself was removing the version pinning in requirements-twisted-default.txt.

Presumably the implication for packagers is that they should patch this as part of their distribution process to be whatever version that happened to pick for you.