synapse icon indicating copy to clipboard operation
synapse copied to clipboard

openbsd install error

Open cypa opened this issue 8 years ago • 3 comments

[edited by @richvdh to fix formatting]

Description

Installing on openbsd 6.3 64bit fails on this step

$ pip install https://github.com/matrix-org/synapse/tarball/master
....

building '_openssl' extension
  creating build/temp.openbsd-6.3-amd64-2.7/build
  creating build/temp.openbsd-6.3-amd64-2.7/build/temp.openbsd-6.3-amd64-2.7
  cc -pthread -fno-strict-aliasing -OPT:Olimit=0 -O2 -pipe -DNDEBUG -O2 -pipe -fPIC -fPIC -I/usr/local/include/python2.7 -c build/temp.openbsd-6.3-amd64-2.7/_openssl.c -o build/temp.openbsd-6.3-amd64-2.7/build/temp.openbsd-6.3-amd64-2.7/_openssl.o -Wconversion -Wno-error=sign-conversion
  build/temp.openbsd-6.3-amd64-2.7/_openssl.c:2155:25: warning: implicit conversion changes signedness: 'const int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
          return session->master_key_length;
          ~~~~~~ ~~~~~~~~~^~~~~~~~~~~~~~~~~
  build/temp.openbsd-6.3-amd64-2.7/_openssl.c:2157:27: warning: implicit conversion changes signedness: 'const int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
          outlen = session->master_key_length;
                 ~ ~~~~~~~~~^~~~~~~~~~~~~~~~~
  build/temp.openbsd-6.3-amd64-2.7/_openssl.c:2269:19: warning: incompatible pointer to integer conversion initializing 'const long' with an expression of type 'void *' [-Wint-conversion]
  static const long SSL_OP_NO_DTLSv1 = NULL;
                    ^                  ~~~~
  build/temp.openbsd-6.3-amd64-2.7/_openssl.c:2270:19: warning: incompatible pointer to integer conversion initializing 'const long' with an expression of type 'void *' [-Wint-conversion]
  static const long SSL_OP_NO_DTLSv1_2 = NULL;
                    ^                    ~~~~
  build/temp.openbsd-6.3-amd64-2.7/_openssl.c:2334:6: error: conflicting types for 'X509_get0_signature'
  void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
       ^
  /usr/include/openssl/x509.h:906:6: note: previous declaration is here
  void X509_get0_signature(const ASN1_BIT_STRING **psig,

...

    /usr/include/openssl/x509.h:907:24: note: passing argument to parameter 'palg' here
        const X509_ALGOR **palg, const X509 *x);
                           ^
    44 warnings and 7 errors generated.
    error: command 'cc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/local/_synapse/.synapse/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-03olTR/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-OPhL48/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/_synapse/.synapse/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-install-03olTR/cryptography/

Steps to reproduce

take steps to install on openbsd from github main page docs

  • Install method: pip
  • Platform: openbsd 6.3 64-bit

cypa avatar Jun 12 '18 06:06 cypa

This looks like a problem building python-cryptography; I suggest seeking help there.

(It looks like an incompatibility with your version of openssl)

richvdh avatar Jun 12 '18 07:06 richvdh

When you create the virtualenv, you need:

virtualenv --system-site-packages

to use the py-cryptography from OpenBSD (pkg_add py-cryptography).

mpwp avatar Jun 12 '18 16:06 mpwp

I don't know how to include it in the docs, maybe that's enough by the way. It's not just the different version of openssl, actually, the cryptography python library doesn't compile due to a someway different gcc.

mpwp avatar Jun 12 '18 16:06 mpwp