question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

petlib fails to compile with openssl 1.1

See original GitHub issue
 Running setup.py develop for petlib
    Complete output from command /home/kali/Virtualenvs/petlib/bin/python2 -c "import setuptools, tokenize;__file__='/home/kali/leap/petlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
    running develop
    running egg_info
    writing requirements to petlib.egg-info/requires.txt
    writing petlib.egg-info/PKG-INFO
    writing top-level names to petlib.egg-info/top_level.txt
    writing dependency_links to petlib.egg-info/dependency_links.txt
    reading manifest file 'petlib.egg-info/SOURCES.txt'
    writing manifest file 'petlib.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/petlib._petlib.c'
    creating build
    creating build/temp.linux-x86_64-2.7
    building 'petlib._petlib' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-HVkOs2/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/petlib._petlib.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/petlib._petlib.o -Wno-deprecated-declarations
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘hmac_ctx_size’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:462:19: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
         return sizeof(HMAC_CTX);
                       ^~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:466:41: error: macro "ERR_load_crypto_strings" passed 1 arguments, but takes just 0
     extern void ERR_load_crypto_strings(void);
                                             ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:468:34: error: macro "ERR_free_strings" passed 1 arguments, but takes just 0
     extern void ERR_free_strings(void);
                                      ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:535:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     int setup_ssl_threads() {
         ^~~~~~~~~~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:1037:56: error: field ‘y’ has incomplete type
     struct _cffi_align_typedef_HMAC_CTX { char x; HMAC_CTX y; };
                                                            ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_BN_init’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:1882:3: warning: implicit declaration of function ‘BN_init’ [-Wimplicit-function-declaration]
       BN_init(x0);
       ^~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_CRYPTO_lock’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:3013:3: warning: implicit declaration of function ‘CRYPTO_lock’ [-Wimplicit-function-declaration]
       CRYPTO_lock(x0, x1, x2, x3);
       ^~~~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_HMAC_CTX_cleanup’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7195:3: warning: implicit declaration of function ‘HMAC_CTX_cleanup’ [-Wimplicit-function-declaration]
       HMAC_CTX_cleanup(x0);
       ^~~~~~~~~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_HMAC_CTX_init’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7231:3: warning: implicit declaration of function ‘HMAC_CTX_init’ [-Wimplicit-function-declaration]
       HMAC_CTX_init(x0);
       ^~~~~~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_checkfld__ECDSA_SIG’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7897:23: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
       { BIGNUM * *tmp = &p->r; (void)tmp; }
                           ^~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7900:51: error: field ‘y’ has incomplete type
     struct _cffi_align__ECDSA_SIG { char x; ECDSA_SIG y; };
                                                       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_checkfld__EVP_CIPHER_CTX’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7907:33: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { EVP_CIPHER const * *tmp = &p->cipher; (void)tmp; }
                                     ^~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7916:61: error: field ‘y’ has incomplete type
     struct _cffi_align__EVP_CIPHER_CTX { char x; EVP_CIPHER_CTX y; };
                                                                 ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_checkfld__EVP_CIPHER’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7923:12: error: dereferencing pointer to incomplete type ‘EVP_CIPHER {aka struct evp_cipher_st}’
       (void)((p->nid) | 0);  /* check that 'EVP_CIPHER.nid' is an integer */
                ^~
    build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:7929:53: error: field ‘y’ has incomplete type
     struct _cffi_align__EVP_CIPHER { char x; EVP_CIPHER y; };
                                                         ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8090:3: error: invalid use of incomplete typedef ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
       { "r", offsetof(ECDSA_SIG, r),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8093:3: error: invalid use of incomplete typedef ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
       { "s", offsetof(ECDSA_SIG, s),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8096:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "cipher", offsetof(EVP_CIPHER_CTX, cipher),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8099:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "encrypt", offsetof(EVP_CIPHER_CTX, encrypt),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8102:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "buf_len", offsetof(EVP_CIPHER_CTX, buf_len),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8105:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "num", offsetof(EVP_CIPHER_CTX, num),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8108:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "key_len", offsetof(EVP_CIPHER_CTX, key_len),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8111:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "flags", offsetof(EVP_CIPHER_CTX, flags),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8114:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "final_used", offsetof(EVP_CIPHER_CTX, final_used),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8117:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
       { "block_mask", offsetof(EVP_CIPHER_CTX, block_mask),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8120:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
       { "nid", offsetof(EVP_CIPHER, nid),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8123:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
       { "block_size", offsetof(EVP_CIPHER, block_size),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8126:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
       { "key_len", offsetof(EVP_CIPHER, key_len),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8129:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
       { "iv_len", offsetof(EVP_CIPHER, iv_len),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8132:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
       { "flags", offsetof(EVP_CIPHER, flags),
       ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:12: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
         sizeof(HMAC_CTX), offsetof(struct _cffi_align_typedef_HMAC_CTX, y), 2, 0 },
                ^~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:5: error: initializer element is not constant
         sizeof(HMAC_CTX), offsetof(struct _cffi_align_typedef_HMAC_CTX, y), 2, 0 },
         ^~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:5: note: (near initialization for ‘_cffi_struct_unions[9].size’)
    In file included from /usr/include/sched.h:28:0,
                     from /usr/include/pthread.h:23,
                     from /usr/include/openssl/crypto.h:406,
                     from /usr/include/openssl/bio.h:20,
                     from /usr/include/openssl/err.h:21,
                     from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:23: error: initializer element is not constant
         sizeof(HMAC_CTX), offsetof(struct _cffi_align_typedef_HMAC_CTX, y), 2, 0 },
                           ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:23: note: (near initialization for ‘_cffi_struct_unions[9].alignment’)
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:12: error: invalid application of ‘sizeof’ to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
         sizeof(ECDSA_SIG), offsetof(struct _cffi_align__ECDSA_SIG, y), 2, 2 },
                ^~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:5: error: initializer element is not constant
         sizeof(ECDSA_SIG), offsetof(struct _cffi_align__ECDSA_SIG, y), 2, 2 },
         ^~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:5: note: (near initialization for ‘_cffi_struct_unions[10].size’)
    In file included from /usr/include/sched.h:28:0,
                     from /usr/include/pthread.h:23,
                     from /usr/include/openssl/crypto.h:406,
                     from /usr/include/openssl/bio.h:20,
                     from /usr/include/openssl/err.h:21,
                     from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:24: error: initializer element is not constant
         sizeof(ECDSA_SIG), offsetof(struct _cffi_align__ECDSA_SIG, y), 2, 2 },
                            ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:24: note: (near initialization for ‘_cffi_struct_unions[10].alignment’)
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:12: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
         sizeof(EVP_CIPHER_CTX), offsetof(struct _cffi_align__EVP_CIPHER_CTX, y), 4, 8 },
                ^~~~~~~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:5: error: initializer element is not constant
         sizeof(EVP_CIPHER_CTX), offsetof(struct _cffi_align__EVP_CIPHER_CTX, y), 4, 8 },
         ^~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:5: note: (near initialization for ‘_cffi_struct_unions[11].size’)
    In file included from /usr/include/sched.h:28:0,
                     from /usr/include/pthread.h:23,
                     from /usr/include/openssl/crypto.h:406,
                     from /usr/include/openssl/bio.h:20,
                     from /usr/include/openssl/err.h:21,
                     from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:29: error: initializer element is not constant
         sizeof(EVP_CIPHER_CTX), offsetof(struct _cffi_align__EVP_CIPHER_CTX, y), 4, 8 },
                                 ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:29: note: (near initialization for ‘_cffi_struct_unions[11].alignment’)
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:12: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER {aka struct evp_cipher_st}’
         sizeof(EVP_CIPHER), offsetof(struct _cffi_align__EVP_CIPHER, y), 12, 5 },
                ^~~~~~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:5: error: initializer element is not constant
         sizeof(EVP_CIPHER), offsetof(struct _cffi_align__EVP_CIPHER, y), 12, 5 },
         ^~~~~~
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:5: note: (near initialization for ‘_cffi_struct_unions[12].size’)
    In file included from /usr/include/sched.h:28:0,
                     from /usr/include/pthread.h:23,
                     from /usr/include/openssl/crypto.h:406,
                     from /usr/include/openssl/bio.h:20,
                     from /usr/include/openssl/err.h:21,
                     from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:25: error: initializer element is not constant
         sizeof(EVP_CIPHER), offsetof(struct _cffi_align__EVP_CIPHER, y), 12, 5 },
                             ^
    build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:25: note: (near initialization for ‘_cffi_struct_unions[12].alignment’)
    build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘hmac_ctx_size’:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:463:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    At top level:
    build/temp.linux-x86_64-2.7/petlib._petlib.c:507:13: warning: ‘_ssl_thread_locking_function’ defined but not used [-Wunused-function]
     static void _ssl_thread_locking_function(int mode, int n, const char *file,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
misaakidiscommented, Feb 20, 2018

In fedora-based distros there is an OpenSSL 1.0 devel compatibility package: dnf install compat-openssl10-devel --allowerasing (disclaimer: the above command will downgrade the version of openssl-devel already installed)

0reactions
ossdev07commented, Dec 16, 2018

@gdanezis do you have any clue how to support both version of openssl (1.0.x and 1.1.x) and resolve their dependencies at run-time …

Read more comments on GitHub >

github_iconTop Results From Across the Web

petlib 0.0.45 documentation
On MacOS, install OpenSSL 1.1.x using homebrew: brew install openssl@1.1 ... To build the Sphinx HTML documentation go into docs and run: make...
Read more >
Building Python and OpenSSL from source, but ssl module fails
For build failure on _ssl module, try extra options like --with-openssl , CFLAGS and ... Python 3.7.0 wont compile with SSL Support 1.1.0....
Read more >
Unable to Compile the sgx-ra-sample in an Ubuntu* Docker ...
Attempted to make the sgx-ra-sample in an Ubuntu* Docker Container. · The command: g++ -tcd=c++11 -g -O2 -L/opt/sgxsdk/lib64 -L /opt/openssl/1.1.0i/lib -o sp sp....
Read more >
petlib Documentation - Read the Docs
On MacOS, install OpenSSL 1.1.x using homebrew: brew install openssl@1.1 ... make_docs: builds the html documentation in docs/_build/html.
Read more >
Issue 34028: Python 3.7.0 wont compile with SSL Support 1.1 ...
failed, self.failed_on_import)): 368 print() 369 print("Could not build the ssl module!") 370 print("Python requires an OpenSSL 1.0.2 or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found