Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projects with postgresql-simple fail to match SSL symbols #8

Open
avanov opened this issue Oct 23, 2019 · 4 comments
Open

Projects with postgresql-simple fail to match SSL symbols #8

avanov opened this issue Oct 23, 2019 · 4 comments

Comments

@avanov
Copy link
Contributor

avanov commented Oct 23, 2019

Hi!

I run into an issue with a project with postgresql-simple not being able to compile due to the following SSL linking error:

Successfully tagged alpine-haskell-gmp:8.6.5
docker build -t project-build-env:latest -f ./Dockerfile.buildenv .
Sending build context to Docker daemon  804.4kB
Step 1/2 : FROM alpine-haskell-gmp:8.6.5 as compiler
 ---> 2fd2d497ca2a
Step 2/2 : RUN apk add --no-cache zlib-dev postgresql-dev
 ---> Using cache
 ---> 6a1258bc4b40
Successfully built 6a1258bc4b40
Successfully tagged project-build-env:latest
cd /Users/maxlaptop/projects/myproject_com/backend && stack --docker --docker-repo project-build-env:latest --docker-stack-exe image build
Building all executables for `backend' once. After a successful build of all of them, only specified executables will be rebuilt.
backend-0.1.0.0: build (lib + exe)
Preprocessing library for backend-0.1.0.0..
Building library for backend-0.1.0.0..
Preprocessing executable 'backend-exe' for backend-0.1.0.0..
Building executable 'backend-exe' for backend-0.1.0.0..
Linking .stack-work/dist/x86_64-linux-dka075fe0186587453922b8d3c52e5c1f8/Cabal-2.4.0.1/build/backend-exe/backend-exe ...
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-connect.o): in function `parseServiceFile':
fe-connect.c:(.text+0xdb0): undefined reference to `ldap_init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xdce): undefined reference to `ldap_set_option'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xde2): undefined reference to `ldap_simple_bind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xe15): undefined reference to `ldap_result'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xe3c): undefined reference to `ldap_msgfree'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xe57): undefined reference to `ldap_set_option'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xe8d): undefined reference to `ldap_search_st'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xeaf): undefined reference to `ldap_msgfree'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xebc): undefined reference to `ldap_err2string'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0xeda): undefined reference to `ldap_unbind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x1197): undefined reference to `ldap_msgfree'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x11a7): undefined reference to `ldap_unbind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x11bc): undefined reference to `ldap_unbind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x11f3): undefined reference to `ldap_count_entries'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x1229): undefined reference to `ldap_msgfree'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x1231): undefined reference to `ldap_unbind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x1279): undefined reference to `ldap_first_entry'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x12a7): undefined reference to `ldap_get_values_len'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x12c7): undefined reference to `ldap_msgfree'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x13b3): undefined reference to `ldap_value_free_len'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x13bb): undefined reference to `ldap_unbind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x146d): undefined reference to `ldap_value_free_len'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-connect.c:(.text+0x1475): undefined reference to `ldap_unbind'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `SSLerrmessage':
fe-secure-openssl.c:(.text+0x64): undefined reference to `ERR_reason_error_string'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `initialize_SSL':
fe-secure-openssl.c:(.text+0x112): undefined reference to `TLS_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x11a): undefined reference to `SSL_CTX_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x133): undefined reference to `SSL_CTX_set_options'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x147): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1b1): undefined reference to `SSL_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1ce): undefined reference to `SSL_set_ex_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1f5): undefined reference to `BIO_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x20c): undefined reference to `BIO_set_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x21e): undefined reference to `SSL_set_bio'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x231): undefined reference to `BIO_int_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x240): undefined reference to `SSL_CTX_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x285): undefined reference to `SSL_clear_options'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x314): undefined reference to `ENGINE_by_id'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x32c): undefined reference to `ENGINE_init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x347): undefined reference to `ENGINE_load_private_key'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x35f): undefined reference to `SSL_use_PrivateKey'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x452): undefined reference to `SSL_CTX_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x4d1): undefined reference to `SSL_check_private_key'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x4df): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x53d): undefined reference to `SSL_set_verify'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x5c1): undefined reference to `BIO_s_socket'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x5c9): undefined reference to `BIO_get_new_index'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x5e0): undefined reference to `BIO_meth_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x5ff): undefined reference to `BIO_meth_set_write'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x61a): undefined reference to `BIO_meth_set_read'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x62a): undefined reference to `BIO_meth_get_gets'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x639): undefined reference to `BIO_meth_set_gets'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x649): undefined reference to `BIO_meth_get_puts'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x658): undefined reference to `BIO_meth_set_puts'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x668): undefined reference to `BIO_meth_get_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x677): undefined reference to `BIO_meth_set_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x683): undefined reference to `BIO_meth_get_create'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x692): undefined reference to `BIO_meth_set_create'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x69e): undefined reference to `BIO_meth_get_destroy'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x6ad): undefined reference to `BIO_meth_set_destroy'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x6b9): undefined reference to `BIO_meth_get_callback_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x6c8): undefined reference to `BIO_meth_set_callback_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x6f0): undefined reference to `BIO_meth_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x71c): undefined reference to `ERR_put_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x721): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x760): undefined reference to `SSL_CTX_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x777): undefined reference to `SSL_CTX_use_certificate_chain_file'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x791): undefined reference to `SSL_set_options'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x7e9): undefined reference to `SSL_CTX_load_verify_locations'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x800): undefined reference to `SSL_CTX_get_cert_store'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x837): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x8c4): undefined reference to `SSL_use_PrivateKey_file'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x8d2): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x93c): undefined reference to `X509_STORE_load_locations'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x952): undefined reference to `X509_STORE_set_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x9c6): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xa3f): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xa87): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xad0): undefined reference to `ENGINE_finish'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xadc): undefined reference to `ENGINE_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xaf1): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xb31): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xb99): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xbfe): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `openssl_verify_peer_name_matches_certificate_name':
fe-secure-openssl.c:(.text+0xc4c): undefined reference to `ASN1_STRING_get0_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xc57): undefined reference to `ASN1_STRING_length'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `my_sock_read':
fe-secure-openssl.c:(.text+0xcad): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xccb): undefined reference to `BIO_clear_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xcfa): undefined reference to `BIO_set_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `my_sock_write':
fe-secure-openssl.c:(.text+0xd1d): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xd3b): undefined reference to `BIO_clear_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xd6a): undefined reference to `BIO_set_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_read':
fe-secure-openssl.c:(.text+0xdd7): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xdea): undefined reference to `SSL_read'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xdfb): undefined reference to `SSL_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0xe41): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_read_pending':
fe-secure-openssl.c:(.text+0xfec): undefined reference to `SSL_pending'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_write':
fe-secure-openssl.c:(.text+0x103a): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x104c): undefined reference to `SSL_write'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x105d): undefined reference to `SSL_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x10a1): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_get_peer_certificate_hash':
fe-secure-openssl.c:(.text+0x127d): undefined reference to `X509_get_signature_nid'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x128b): undefined reference to `OBJ_find_sigid_algs'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x12ae): undefined reference to `OBJ_nid2sn'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x12b6): undefined reference to `EVP_get_digestbyname'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x12d7): undefined reference to `X509_digest'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1371): undefined reference to `EVP_sha256'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x13c7): undefined reference to `OBJ_nid2sn'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_verify_peer_name_matches_certificate_guts':
fe-secure-openssl.c:(.text+0x144c): undefined reference to `X509_get_ext_d2i'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1460): undefined reference to `OPENSSL_sk_num'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1494): undefined reference to `OPENSSL_sk_value'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x14d8): undefined reference to `OPENSSL_sk_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1528): undefined reference to `X509_get_subject_name'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1542): undefined reference to `X509_NAME_get_index_by_NID'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1555): undefined reference to `X509_NAME_get_entry'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x155d): undefined reference to `X509_NAME_ENTRY_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1587): undefined reference to `OPENSSL_sk_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_init':
fe-secure-openssl.c:(.text+0x15e8): undefined reference to `OPENSSL_init_ssl'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_close':
fe-secure-openssl.c:(.text+0x1611): undefined reference to `SSL_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x161d): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1640): undefined reference to `X509_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x165c): undefined reference to `ENGINE_finish'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1668): undefined reference to `ENGINE_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `pgtls_open_client':
fe-secure-openssl.c:(.text+0x16b0): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x16bc): undefined reference to `SSL_connect'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x16d2): undefined reference to `SSL_get_peer_certificate'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1721): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1773): undefined reference to `SSL_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x177b): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(fe-secure-openssl.o): in function `PQsslAttribute':
fe-secure-openssl.c:(.text+0x19d4): undefined reference to `SSL_get_current_cipher'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x19e1): undefined reference to `SSL_CIPHER_get_bits'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1a14): undefined reference to `SSL_get_version'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1a24): undefined reference to `SSL_get_current_cipher'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1a2c): undefined reference to `SSL_CIPHER_get_name'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: fe-secure-openssl.c:(.text+0x1a3c): undefined reference to `SSL_get_current_compression'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(pg_strong_random.o): in function `pg_strong_random':
pg_strong_random.c:(.text+0x11): undefined reference to `RAND_status'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: pg_strong_random.c:(.text+0x1b): undefined reference to `RAND_poll'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: pg_strong_random.c:(.text+0x2f): undefined reference to `RAND_bytes'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha256_init':
sha2_openssl.c:(.text+0x1): undefined reference to `SHA256_Init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha256_update':
sha2_openssl.c:(.text+0x11): undefined reference to `SHA256_Update'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha256_final':
sha2_openssl.c:(.text+0x2a): undefined reference to `SHA256_Final'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha512_init':
sha2_openssl.c:(.text+0x31): undefined reference to `SHA512_Init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha512_update':
sha2_openssl.c:(.text+0x41): undefined reference to `SHA512_Update'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha512_final':
sha2_openssl.c:(.text+0x5a): undefined reference to `SHA512_Final'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha384_init':
sha2_openssl.c:(.text+0x61): undefined reference to `SHA384_Init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha384_update':
sha2_openssl.c:(.text+0x71): undefined reference to `SHA384_Update'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha384_final':
sha2_openssl.c:(.text+0x8a): undefined reference to `SHA384_Final'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha224_init':
sha2_openssl.c:(.text+0x91): undefined reference to `SHA224_Init'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha224_update':
sha2_openssl.c:(.text+0xa1): undefined reference to `SHA224_Update'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/libpq.a(sha2_openssl.o): in function `pg_sha224_final':
sha2_openssl.c:(.text+0xba): undefined reference to `SHA224_Final'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

--  While building package backend-0.1.0.0 using:
      /Users/maxlaptop/.stack/setup-exe-cache/x86_64-linux-dka075fe0186587453922b8d3c52e5c1f8/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-dka075fe0186587453922b8d3c52e5c1f8/Cabal-2.4.0.1 build lib:backend exe:backend-exe --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Received ExitFailure 1 when running
Raw command: /usr/local/bin/docker start -a -i c3749aad2724aa2a6ca81e0c4ec2b51656454a69dd7fef53bf58799f9897e8a6

make: *** [Makefile:38: build-backend] Error 1

The project has the following dependencies:

  - base
  - bytestring
  - servant
  - servant-server
  - servant-blaze
  - servant-static-th
  - blaze-html
  - wai
  - warp
  - warp-tls
  - aeson
  - text
  - envy
  - wai-logger
  - resource-pool
  - postgresql-simple
  - fast-logger
  - time
  - mtl
  - transformers

I'm going to investigate it further, and so far it seems like a problem similar to pyca/cryptography#4264 , but I wonder if anyone else has seen this specifically with Stack builds before?

@avanov
Copy link
Contributor Author

avanov commented Nov 17, 2019

Related issue on static-haskell-nix - nh2/static-haskell-nix#57

@bford-ff
Copy link

@avanov did you ever manage to fix this issue? I've just run into the same thing...

@avanov
Copy link
Contributor Author

avanov commented Jan 26, 2020

@bford-ff I ended up switching to https://github.com/nh2/static-haskell-nix (the working example is at https://github.com/nh2/static-haskell-nix/tree/master/static-stack2nix-builder-example), as I couldn't find a way to instruct Alpine/APK to discover necessary symbols.

And it seems it's becoming the default method of building official Stack distributions - https://opencollective.com/static-haskell-nix/updates/official-stack-static-binaries-now-built-via-static-haskell-nix

@bford-ff
Copy link

Thanks! That's what I'm using at the moment too, but I'm a bit concerned about the overhead for a team that doesn't know nix :-/

I can't seem to see the close issue button, but please feel free to close this issue :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants