clux / muslrust

Docker environment for building musl based static linux rust binaries
MIT License
958 stars 88 forks source link

libpq >= 12 fails to static link with openssl #81

Open clux opened 3 years ago

clux commented 3 years ago

Similar issue as before, and others have reported it too: https://github.com/sgrif/pq-sys/issues/27 This is why libpq is pinned to latest 11 release. we could upgrade, if pq-sys actually merged the fix :(

build log

``` ./test.sh pq + docker_build pq + local -r crate=pqcrate + docker run --rm -v /home/runner/work/muslrust/muslrust/test/pqcrate:/volume -v cargo-cache:/root/.cargo/registry -e RUST_BACKTRACE=1 clux/muslrust:temp cargo build Updating crates.io index Downloading crates ... Downloaded pq-sys v0.4.6 Compiling pkg-config v0.3.19 Compiling cc v1.0.68 Compiling autocfg v1.0.1 Compiling libc v0.2.97 Compiling bitflags v1.2.1 Compiling pq-sys v0.4.6 Compiling openssl v0.10.35 Compiling foreign-types-shared v0.1.1 Compiling once_cell v1.8.0 Compiling cfg-if v1.0.0 Compiling openssl-sys v0.9.64 Compiling foreign-types v0.3.2 Compiling pqcrate v0.1.0 (/volume) error: linking with `cc` failed: exit status: 1 | = note: "cc" "-m64" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crt1.o" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crti.o" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtbegin.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.1hftbp5vx4rs5tz7.rcgu.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.384p7u03hmdaoaf8.rcgu.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.3qduubka0xitgj0c.rcgu.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.4kqgrua8qp7696ql.rcgu.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.52ydmaq45nh7bzb4.rcgu.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.7ylijitxf4r67r5.rcgu.o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c.44o8ammlpytcjale.rcgu.o" "-Wl,--as-needed" "-L" "/volume/target/x86_64-unknown-linux-musl/debug/deps" "-L" "/volume/target/debug/deps" "-L" "/musl/lib" "-L" "/musl/lib" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libopenssl-9e6f4c7c82243f09.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libonce_cell-257079c73d6e0a81.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libbitflags-2b06d9303e6233ff.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libforeign_types-9a0e339477be781e.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libforeign_types_shared-0d04ac3b44ec5718.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libcfg_if-93cca5c086798193.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/libopenssl_sys-379f78d685c6567a.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-3f1a4e24e22ed966.rlib" "-Wl,--start-group" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-645ff18786bd8f4c.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-1e7397296328c849.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libminiz_oxide-b0dc2ee69d3cd28d.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libadler-d7bd6706a60956bd.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libobject-20323123b22dd8d9.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libaddr2line-b1856e39a6442059.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libgimli-dc23389320eb7017.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd_detect-09742bee4d7cdce6.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_demangle-13bbc2cbe6da9731.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libhashbrown-12c3bed34f07ecaa.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_alloc-074dd2bf98e1bb95.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-654bedcd013d11ca.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libcfg_if-dc501baf64ee4c09.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-9e3694f1b1e58590.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-6346596a31b8c817.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_core-3e240aff10db9180.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-60eab00334ec8288.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-91bbdb295abafcf0.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-nostartfiles" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained" "-o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/pqcrate-7882b05042e23d6c" "-Wl,--gc-sections" "-static" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtend.o" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtn.o" = note: /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure.o): In function `pqsecure_raw_read': fe-secure.c:(.text+0x211): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure.o): In function `pqsecure_raw_write': fe-secure.c:(.text+0x46c): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `pgtls_read': fe-secure-openssl.c:(.text+0x236): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `pgtls_write': fe-secure-openssl.c:(.text+0x598): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `pq_lockingcallback': fe-secure-openssl.c:(.text+0xb97): undefined reference to `pg_fprintf' fe-secure-openssl.c:(.text+0xbeb): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `initialize_SSL': fe-secure-openssl.c:(.text+0x1053): undefined reference to `pg_snprintf' fe-secure-openssl.c:(.text+0x11cb): undefined reference to `pg_snprintf' fe-secure-openssl.c:(.text+0x133f): undefined reference to `pg_snprintf' fe-secure-openssl.c:(.text+0x13b5): undefined reference to `pg_strerror_r' fe-secure-openssl.c:(.text+0x1a2b): undefined reference to `pg_snprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `open_client_SSL': fe-secure-openssl.c:(.text+0x1da6): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `SSLerrmessage': fe-secure-openssl.c:(.text+0x20d3): undefined reference to `pg_snprintf' fe-secure-openssl.c:(.text+0x2132): undefined reference to `pg_snprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-openssl.o): In function `PQsslAttribute': fe-secure-openssl.c:(.text+0x22a8): undefined reference to `pg_snprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-common.o): In function `wildcard_certificate_match': fe-secure-common.c:(.text+0x92): undefined reference to `pg_strcasecmp' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-secure-common.o): In function `pq_verify_peer_name_matches_certificate_name': fe-secure-common.c:(.text+0x225): undefined reference to `pg_strcasecmp' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `connectOptions2': fe-connect.c:(.text+0x106b): undefined reference to `pg_snprintf' fe-connect.c:(.text+0x1508): undefined reference to `pg_get_encoding_from_locale' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `connectNoDelay': fe-connect.c:(.text+0x1aed): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `getHostaddr': fe-connect.c:(.text+0x1b88): undefined reference to `inet_net_ntop' fe-connect.c:(.text+0x1bca): undefined reference to `inet_net_ntop' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `connectFailureMessage': fe-connect.c:(.text+0x1c65): undefined reference to `pg_getnameinfo_all' fe-connect.c:(.text+0x1c85): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x1e61): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x1ec2): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `setKeepalivesIdle': fe-connect.c:(.text+0x217a): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `setKeepalivesInterval': fe-connect.c:(.text+0x22a7): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o):fe-connect.c:(.text+0x23d4): more undefined references to `pg_strerror_r' follow /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `connectDBStart': fe-connect.c:(.text+0x2583): undefined reference to `pg_link_canary_is_frontend' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `PQconnectPoll': fe-connect.c:(.text+0x2dba): undefined reference to `pg_snprintf' fe-connect.c:(.text+0x2e0e): undefined reference to `pg_getaddrinfo_all' fe-connect.c:(.text+0x2eaf): undefined reference to `pg_getaddrinfo_all' fe-connect.c:(.text+0x2f93): undefined reference to `pg_snprintf' fe-connect.c:(.text+0x3004): undefined reference to `pg_getaddrinfo_all' fe-connect.c:(.text+0x336d): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x33df): undefined reference to `pg_set_noblock' fe-connect.c:(.text+0x3403): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x347f): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x3582): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x3759): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x381b): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x38d8): undefined reference to `getpeereid' fe-connect.c:(.text+0x3926): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x3979): undefined reference to `pqGetpwuid' fe-connect.c:(.text+0x39b4): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x3b32): undefined reference to `pg_strerror_r' fe-connect.c:(.text+0x3c50): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `release_conn_addrinfo': fe-connect.c:(.text+0x5a36): undefined reference to `pg_freeaddrinfo_all' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `internal_cancel': fe-connect.c:(.text+0x6124): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `parseServiceInfo': fe-connect.c:(.text+0x649f): undefined reference to `pg_snprintf' fe-connect.c:(.text+0x6559): undefined reference to `pg_snprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `PQsetClientEncoding': fe-connect.c:(.text+0x8d7a): undefined reference to `pg_get_encoding_from_locale' fe-connect.c:(.text+0x8dcf): undefined reference to `pg_sprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `defaultNoticeProcessor': fe-connect.c:(.text+0x90ab): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `passwordFromFile': fe-connect.c:(.text+0x9314): undefined reference to `pg_fprintf' fe-connect.c:(.text+0x9350): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `pqGetHomeDirectory': fe-connect.c:(.text+0x9862): undefined reference to `pqGetpwuid' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-connect.o): In function `default_threadlock': fe-connect.c:(.text+0x98fc): undefined reference to `pg_fprintf' fe-connect.c:(.text+0x9936): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-exec.o): In function `pqInternalNotice': fe-exec.c:(.text+0x15f7): undefined reference to `pg_vsnprintf' fe-exec.c:(.text+0x171d): undefined reference to `pg_sprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-exec.o): In function `pqSaveParameterStatus': fe-exec.c:(.text+0x19aa): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-exec.o): In function `PQfnumber': fe-exec.c:(.text+0x4288): undefined reference to `pg_tolower' fe-exec.c:(.text+0x43a0): undefined reference to `pg_tolower' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o): In function `pqGetc': fe-misc.c:(.text+0xe9): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o): In function `pqPutc': fe-misc.c:(.text+0x157): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o): In function `pqGets_internal': fe-misc.c:(.text+0x266): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o): In function `pqPuts': fe-misc.c:(.text+0x332): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o): In function `pqGetnchar': fe-misc.c:(.text+0x3f6): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o):fe-misc.c:(.text+0x433): more undefined references to `pg_fprintf' follow /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-misc.o): In function `pqSocketCheck': fe-misc.c:(.text+0x17d0): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-protocol2.o): In function `pqSetenvPoll': fe-protocol2.c:(.text+0x182): undefined reference to `pg_strcasecmp' fe-protocol2.c:(.text+0x19e): undefined reference to `pg_sprintf' fe-protocol2.c:(.text+0x1bf): undefined reference to `pg_sprintf' fe-protocol2.c:(.text+0x267): undefined reference to `pg_strcasecmp' fe-protocol2.c:(.text+0x295): undefined reference to `pg_sprintf' fe-protocol2.c:(.text+0x2c8): undefined reference to `pg_sprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-protocol3.o): In function `build_startup_packet': fe-protocol3.c:(.text+0x39a9): undefined reference to `pg_strcasecmp' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(pqexpbuffer.o): In function `appendPQExpBufferVA': pqexpbuffer.c:(.text+0x5b7): undefined reference to `pg_vsnprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(encnames.o): In function `pg_char_to_encoding': encnames.c:(.text+0x1d4): undefined reference to `pg_fprintf' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth.o): In function `pg_password_sendauth': fe-auth.c:(.text+0x6a3): undefined reference to `pg_md5_encrypt' fe-auth.c:(.text+0x6e0): undefined reference to `pg_md5_encrypt' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth.o): In function `pg_fe_getauthname': fe-auth.c:(.text+0xb10): undefined reference to `pqGetpwuid' fe-auth.c:(.text+0xb64): undefined reference to `pg_strerror_r' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth.o): In function `PQencryptPassword': fe-auth.c:(.text+0xc7d): undefined reference to `pg_md5_encrypt' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth.o): In function `PQencryptPasswordConn': fe-auth.c:(.text+0xece): undefined reference to `pg_md5_encrypt' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `pg_fe_scram_init': fe-auth-scram.c:(.text+0xb7): undefined reference to `pg_saslprep' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `build_client_first_message': fe-auth-scram.c:(.text+0x5e1): undefined reference to `pg_strong_random' fe-auth-scram.c:(.text+0x61a): undefined reference to `pg_b64_enc_len' fe-auth-scram.c:(.text+0x680): undefined reference to `pg_b64_encode' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `build_client_final_message': fe-auth-scram.c:(.text+0x94a): undefined reference to `pg_b64_enc_len' fe-auth-scram.c:(.text+0x99d): undefined reference to `pg_b64_encode' fe-auth-scram.c:(.text+0xac1): undefined reference to `pg_b64_enc_len' fe-auth-scram.c:(.text+0xaf3): undefined reference to `pg_b64_encode' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `read_server_first_message': fe-auth-scram.c:(.text+0xd3c): undefined reference to `pg_b64_dec_len' fe-auth-scram.c:(.text+0xdad): undefined reference to `pg_b64_decode' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `read_server_final_message': fe-auth-scram.c:(.text+0xfef): undefined reference to `pg_b64_dec_len' fe-auth-scram.c:(.text+0x1052): undefined reference to `pg_b64_decode' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `calculate_client_proof': fe-auth-scram.c:(.text+0x112d): undefined reference to `scram_SaltedPassword' fe-auth-scram.c:(.text+0x1147): undefined reference to `scram_ClientKey' fe-auth-scram.c:(.text+0x115c): undefined reference to `scram_H' fe-auth-scram.c:(.text+0x1177): undefined reference to `scram_HMAC_init' fe-auth-scram.c:(.text+0x11a9): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x11c4): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x11f6): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x1211): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x123b): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x1251): undefined reference to `scram_HMAC_final' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `verify_server_signature': fe-auth-scram.c:(.text+0x12f0): undefined reference to `scram_ServerKey' fe-auth-scram.c:(.text+0x130b): undefined reference to `scram_HMAC_init' fe-auth-scram.c:(.text+0x133d): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x1358): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x138a): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x13a5): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x13d7): undefined reference to `scram_HMAC_update' fe-auth-scram.c:(.text+0x13ed): undefined reference to `scram_HMAC_final' /volume/target/x86_64-unknown-linux-musl/debug/deps/libpq_sys-30779afa45d38741.rlib(fe-auth-scram.o): In function `pg_fe_scram_build_verifier': fe-auth-scram.c:(.text+0x1463): undefined reference to `pg_saslprep' fe-auth-scram.c:(.text+0x1492): undefined reference to `pg_strong_random' fe-auth-scram.c:(.text+0x14d2): undefined reference to `scram_build_verifier' collect2: error: ld returned 1 exit status error: aborting due to previous error error: could not compile `pqcrate` ```

clux commented 9 months ago

might need to look into this again; the upstream https://github.com/sgrif/pq-sys/issues/27#issuecomment-1844906054 got closed with a comment suggesting it "should work". not sure i am super hopeful, more and more references to people not getting static linking to work (even oxide in https://github.com/oxidecomputer/omicron/issues/213 ).

basically either we fix this now or we remove libpq entirely from the image because we can't ship a pq that's 5 major versions behind (see https://github.com/clux/muslrust/issues/126#issuecomment-1910404361). unfortunately i need to look at other things first, so leaving this open.

clux commented 8 months ago

blackdex has a pg 15 build at https://github.com/BlackDex/rust-musl/blob/6e8ffe65be307b6dfce570cd93265f36045c064c/Dockerfile.musl-base#L236-L285 :eyes: