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

OpenSSL not available at build time security.protocol SASL_SSL for target x86_64-unknown-linux-musl #447

Closed
JorritSalverda opened this issue Feb 18, 2022 · 8 comments

Comments

@JorritSalverda
Copy link

I'm trying to build a Lambda function in Rust by compiling with target x86_64-unknown-linux-musl

I use the following dependencies:

[dependencies]
rdkafka = { version = "0.28.0", features = ["ssl-vendored", "gssapi-vendored", "libz-static", "cmake-build"] }

This fails with the following error:

   Compiling rdkafka v0.28.0
     Running `rustc --crate-name rdkafka --edition=2018 /home/circleci/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-0.28.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="cmake-build"' --cfg 'feature="default"' --cfg 'feature="gssapi-vendored"' --cfg 'feature="libz"' --cfg 'feature="ssl-vendored"' --cfg 'feature="tokio"' -C metadata=32e46933e6b2fdaf -C extra-filename=-32e46933e6b2fdaf --out-dir /home/circleci/project/target/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps -L dependency=/home/circleci/project/target/release/deps --extern futures=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures-377b98cc301e94bd.rmeta --extern libc=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblibc-2af646c4c5f06a9b.rmeta --extern log=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblog-db0e8945ba31815e.rmeta --extern rdkafka_sys=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/librdkafka_sys-df13538b3fd11c2f.rmeta --extern serde=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde-c8bacc5b8655c7fd.rmeta --extern serde_derive=/home/circleci/project/target/release/deps/libserde_derive-264b095d31a4804b.so --extern serde_json=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde_json-4007c11b7e9e3d4a.rmeta --extern slab=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libslab-49deddba4a8ee04d.rmeta --extern tokio=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtokio-41a0d8122673589e.rmeta --cap-lints allow -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/rdkafka-sys-d40c6b830d808059/out/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/libz-sys-f4ee695a603d402f/out/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/libz-sys-f4ee695a603d402f/out/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/openssl-sys-f5ff16120aa88e7c/out/openssl-build/install/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/sasl2-sys-ee3d2a44df78346f/out/install/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/krb5-src-461e9be66ae41cc9/out/install/lib`
   Compiling lycp-receive-bitbucket-events-fn v0.1.0 (/home/circleci/project)
     Running `rustc --crate-name bootstrap --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=f856e2c9b4d945ea -C extra-filename=-f856e2c9b4d945ea --out-dir /home/circleci/project/target/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps -L dependency=/home/circleci/project/target/release/deps --extern env_logger=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libenv_logger-1fea8d76ed42cada.rlib --extern jsonwebtoken=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libjsonwebtoken-7a1902f69698f177.rlib --extern lambda_http=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblambda_http-04c232a7e52c8761.rlib --extern lambda_runtime=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblambda_runtime-ac8dfd596eefd386.rlib --extern libz_sys=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblibz_sys-7c70868989a3e841.rlib --extern log=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblog-db0e8945ba31815e.rlib --extern openssl_sys=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libopenssl_sys-abbb0abab20db867.rlib --extern rdkafka=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/librdkafka-32e46933e6b2fdaf.rlib --extern sasl2_sys=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libsasl2_sys-172621d1460a5d70.rlib --extern serde=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde-c8bacc5b8655c7fd.rlib --extern serde_json=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde_json-4007c11b7e9e3d4a.rlib --extern tokio=/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtokio-41a0d8122673589e.rlib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/ring-3ef025e449af207c/out -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/libz-sys-f4ee695a603d402f/out/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/libz-sys-f4ee695a603d402f/out/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/openssl-sys-f5ff16120aa88e7c/out/openssl-build/install/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/rdkafka-sys-d40c6b830d808059/out/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/sasl2-sys-ee3d2a44df78346f/out/install/lib -L native=/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/krb5-src-461e9be66ae41cc9/out/install/lib`
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/rcrt1.o" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crti.o" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtbeginS.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.0.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.1.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.10.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.11.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.12.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.13.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.14.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.15.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.2.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.3.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.4.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.5.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.6.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.7.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.8.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.bootstrap.998c94b3-cgu.9.rcgu.o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea.2kfub6bp6ah1kn8r.rcgu.o" "-Wl,--as-needed" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps" "-L" "/home/circleci/project/target/release/deps" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/ring-3ef025e449af207c/out" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/libz-sys-f4ee695a603d402f/out/lib" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/libz-sys-f4ee695a603d402f/out/lib" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/openssl-sys-f5ff16120aa88e7c/out/openssl-build/install/lib" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/rdkafka-sys-d40c6b830d808059/out/lib" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/sasl2-sys-ee3d2a44df78346f/out/install/lib" "-L" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/build/krb5-src-461e9be66ae41cc9/out/install/lib" "-L" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libenv_logger-1fea8d76ed42cada.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libatty-7262792cbba23f1f.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtermcolor-9f0d71d1786982fa.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libhumantime-0cc7eabcbfcfd624.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libregex-3725f35b33d3a107.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libaho_corasick-8f13a7dd2af9da24.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libregex_syntax-b7acd45e04c09e57.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/librdkafka-32e46933e6b2fdaf.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures-377b98cc301e94bd.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_executor-6a70ae8a5f671846.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/librdkafka_sys-df13538b3fd11c2f.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libnum_enum-2e29a357af00aeac.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblibz_sys-7c70868989a3e841.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libsasl2_sys-172621d1460a5d70.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libopenssl_sys-abbb0abab20db867.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblambda_http-04c232a7e52c8761.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde_urlencoded-d693199dbdb85f70.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libform_urlencoded-26b9fbc6521d2675.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libpercent_encoding-42285ebf6c4f2d79.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libmatches-a853cb363c4c4da7.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblambda_runtime-ac8dfd596eefd386.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libasync_stream-f0a9661977d271aa.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtokio_stream-36d529e5f1f2b0ff.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libhyper-a77ee14d132055b8.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libwant-0b77eae16cb4e55e.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtry_lock-5e0808483f733c10.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libsocket2-fd30887594b01306.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libhttparse-ab4a78290ea5faf8.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtower_service-78a982ebcb78ee0e.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtracing-4c879aefc41bca69.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtracing_core-e4fa45652688f984.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblazy_static-258098d24a2b776a.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libhttp_body-53118645a40c4cd0.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_util-04b836785b1db165.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_io-32b288629277cccb.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libslab-49deddba4a8ee04d.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_channel-d54720c1a80c5eb9.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_sink-5df5e87fea18ef41.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_task-47b30e83b3eebc2d.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libpin_utils-4394cbee8aedcf42.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfutures_core-8fc24b04381ade89.rlib" "/home/circleci/project/target
/x86_64-unknown-linux-musl/release/deps/libtokio-41a0d8122673589e.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libnum_cpus-d724bfb7944aaec6.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libmemchr-b046c405148836d7.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libmio-ffe89bbe5308dd67.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblog-db0e8945ba31815e.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libpin_project_lite-ae6ab6ccc90b11a5.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libhttpdate-09f88fef9b5a5b3b.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libhttp-b2f9de7ad492da3f.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libbytes-9d0db03194b42325.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libfnv-ba8071cf46efd2d9.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libjsonwebtoken-7a1902f69698f177.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libpem-7f90ddddedc2dc77.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde_json-4007c11b7e9e3d4a.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libryu-0f02235ef8a6c6b4.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libbase64-ba7e8793b3f95d27.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libsimple_asn1-99c97400efebc0a7.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libtime-6d371dc82c75a753.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libitoa-09414e27176224d8.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libquickcheck-7f3fb5f75304eddf.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/librand-7265a656bb4f6cd8.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/librand_core-d7a4487af02f2b5d.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libgetrandom-29316b62ac6fb26f.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libcfg_if-b8fd6a0378085686.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libthiserror-e82cf0e593419c94.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libnum_bigint-94a1272933dd4896.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libnum_integer-f673b2cf6eeba80e.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libnum_traits-70ecd94ca6b01d66.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libring-8f026fb465bca7b7.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libspin-67deaddcd0b8fbc8.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libuntrusted-1ce4315363f723d4.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libonce_cell-c9c835f96ec43d38.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/liblibc-2af646c4c5f06a9b.rlib" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libserde-c8bacc5b8655c7fd.rlib" "-Wl,--start-group" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-f1f62cc9e6771d77.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-a1f6971ef097cc69.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libminiz_oxide-9f64ed3ce323a628.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libadler-4962c9b0c8137f00.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libobject-e9e4caeb6a89006a.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libmemchr-9dd65da3ed25a9ab.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libaddr2line-69310b767ec19ac1.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libgimli-5037f6f23c6cbc17.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd_detect-52ec91ca38ac4833.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_demangle-325812b977f1d889.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libhashbrown-f7bfad9189072311.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_alloc-ea0f617d0459375b.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-8d0a211c64a7ed5e.rlib" "-lunwind" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libcfg_if-f22dd98dcc245ed7.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-d10ea08182b86972.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-8a17f8ca1ae02980.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_std_workspace_core-1d669f49cb8023cf.rlib" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-c7afc853c1f667bd.rlib" "-Wl,--end-group" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-dbfb6eb6080121e3.rlib" "-Wl,-Bdynamic" "-lresolv" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-nostartfiles" "-L" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib" "-L" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained" "-o" "/home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/bootstrap-f856e2c9b4d945ea" "-Wl,--gc-sections" "-static-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtendS.o" "/home/circleci/.rustup/toolchains/1.58.1-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtn.o"
  = note: /usr/bin/ld: /home/circleci/project/target/x86_64-unknown-linux-musl/release/deps/libsasl2_sys-172621d1460a5d70.rlib(dnsglue.o): undefined reference to symbol '__res_ninit@@GLIBC_2.2.5'
          /usr/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status
          
  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

When switching to the following compilation works fine though

[dependencies]
rdkafka = { version = "0.28.0", features = ["cmake-build"] }

[target.x86_64-unknown-linux-musl.dependencies]
openssl-sys = { version = "0.9.72", features = ["vendored"] }
sasl2-sys = { version = "0.1.19+2.1.27", features = ["gssapi-vendored"] }
libz-sys = { version = "1.1.3", features = ["static"] }

However my test to connect to confluent then fails with

Unsupported value "SASL_SSL" for configuration property "security.protocol": OpenSSL not available at build time security.protocol SASL_SSL

Could it be possible that you need to upgrade the openssl-sys, sasl2-sys and libz-sys versions?

@JorritSalverda
Copy link
Author

I've built a minimal sample at https://github.com/JorritSalverda/rdkafka-sasl2-test which even fails when I'm trying to run it on Ubuntu with openssl installed and using no features for the crate, see https://github.com/JorritSalverda/rdkafka-sasl2-test/runs/5263197385?check_suite_focus=true

I'll try each and every feature combination for the current target (not musl) first to see if anything works.

@JorritSalverda
Copy link
Author

Okay for Ubuntu I did get it work with

rdkafka = { version = "0.28.0", features = ["cmake-build", "ssl-vendored"] }

and by installing apt package libssl-dev.

Testing with target x86_64-unknown-linux-musl now.

@JorritSalverda JorritSalverda changed the title Fail to cross compile to x86_64-unknown-linux-musl with features = ["ssl-vendored", "gssapi-vendored", "cmake-build"] OpenSSL not available at build time security.protocol SASL_SSL for target x86_64-unknown-linux-musl Feb 20, 2022
@JorritSalverda
Copy link
Author

Linking for x86_64-unknown-linux-musl fails with

= note: /usr/bin/ld: /home/runner/work/rdkafka-sasl2-test/rdkafka-sasl2-test/target/x86_64-unknown-linux-musl/debug/deps/librdkafka_sys-4e836909b9284959.rlib(rdkafka_ssl.c.o): in function `rd_kafka_ssl_set_certs':
          /home/runner/.cargo/registry/src/git.luolix.top-1ecc62[99](https://github.com/JorritSalverda/rdkafka-sasl2-test/runs/5263749458?check_suite_focus=true#step:9:99)db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1348: undefined reference to `ENGINE_load_ssl_client_cert'
          /usr/bin/ld: /home/runner/work/rdkafka-sasl2-test/rdkafka-sasl2-test/target/x86_64-unknown-linux-musl/debug/deps/librdkafka_sys-4e836909b9284959.rlib(rdkafka_ssl.c.o): in function `rd_kafka_ssl_ctx_term':
          /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1421: undefined reference to `ENGINE_free'
          /usr/bin/ld: /home/runner/work/rdkafka-sasl2-test/rdkafka-sasl2-test/target/x86_64-unknown-linux-musl/debug/deps/librdkafka_sys-4e836909b9284959.rlib(rdkafka_ssl.c.o): in function `rd_kafka_ssl_ctx_init_engine':
          /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1442: undefined reference to `ENGINE_by_id'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1444: undefined reference to `ENGINE_by_id'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1453: undefined reference to `ENGINE_ctrl_cmd_string'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1456: undefined reference to `ENGINE_free'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1463: undefined reference to `ENGINE_ctrl_cmd_string'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1465: undefined reference to `ENGINE_free'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1472: undefined reference to `ENGINE_ctrl_cmd_string'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1473: undefined reference to `ENGINE_free'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1480: undefined reference to `ENGINE_init'
          /usr/bin/ld: /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1481: undefined reference to `ENGINE_free'
          /usr/bin/ld: /home/runner/work/rdkafka-sasl2-test/rdkafka-sasl2-test/target/x86_64-unknown-linux-musl/debug/deps/librdkafka_sys-4e836909b9284959.rlib(rdkafka_ssl.c.o): in function `rd_kafka_ssl_ctx_init':
          /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/rdkafka-sys-4.2.0+1.8.2/librdkafka/src/rdkafka_ssl.c:1627: undefined reference to `ENGINE_free'
          collect2: error: ld returned 1 exit status

See https://github.com/JorritSalverda/rdkafka-sasl2-test/runs/5263749458?check_suite_focus=true.

This is with packages musl-tools and libssl-dev installed and symlink to musl-g++ set with sudo ln -s /usr/bin/g++ /usr/bin/musl-g++.

@benesch
Copy link
Collaborator

benesch commented Feb 22, 2022

Could it be possible that you need to upgrade the openssl-sys, sasl2-sys and libz-sys versions?

We specify minimum versions of these libraries here. You are encouraged to update them to later versions, if desired, in your own project! No need to add them to your Cargo.toml; just run cargo update -p CRATE to pick up a newer version in your Cargo.lock.

Okay for Ubuntu I did get it work with

rdkafka = { version = "0.28.0", features = ["cmake-build", "ssl-vendored"] }

and by installing apt package libssl-dev.

To be blunt: the time I have available for debugging cross compilation issues is near zero. Unless you can demonstrate a specific bug in the rust-rdkafka build system that breaks cross compilation, I consider these sorts of issues as out of scope for this issue tracker.

Here's what I can offer you:

  • Something is going very wrong if you need to install libssl-dev. The point of ssl-vendored is that you don't use the system's libssl.
  • Run your build with cargo build -vv. That will print the openssl and librdkafka compilation logs and give us an actual shot at debugging this issue. Re-running with -vv is the first thing I do when debugging a cross-compilation error.
  • You're only symlinking musl-g++ as g++. I strongly suspect you need to symlink musl-gcc as gcc, or otherwise set CC=musl-gcc, unless there's some other magic that handles that.

@JorritSalverda
Copy link
Author

Hi @benesch, thanks for your response. With all the difficulty in getting it to work I'll take a stab at running the lambda function with target x86_64-unknown-linux-gnu. Unfortunately the provided.al2 runtime for AWS Lambda has an outdated glibc version, but the upcoming Amazon Linux 2022 will have one that's new enough, see https://aws.amazon.com/linux/amazon-linux-2022/. It's not an option to choose directly as runtime for Lambda yet, but there's a Docker image for it at https://hub.docker.com/r/amazon/aws-lambda-provided.

@benesch
Copy link
Collaborator

benesch commented Mar 1, 2022

Ok, I'm going to close this, then. Offer still stands to take a quick look at the output of cargo build -vv, but absent more information there's nothing more I can do.

  • You're only symlinking musl-g++ as g++. I strongly suspect you need to symlink musl-gcc as gcc, or otherwise set CC=musl-gcc, unless there's some other magic that handles that.

Did you try this, out of curiosity? I'd say that setting CC=musl-gcc has a good chance of fixing the issue.

@JorritSalverda
Copy link
Author

Hi @benesch I've tested with CC=musl-gcc and the -vv flag, but still fails unfortunately. See https://github.com/JorritSalverda/rdkafka-sasl2-test/runs/5373707178?check_suite_focus=true for the logs. Thx foir having a look.

@zaibacu
Copy link

zaibacu commented Mar 17, 2022

Hello, I'm having same issue.

rdkafka_ssl.c:1627: undefined reference to `ENGINE_free'

I'm almost positive this is due to incorrect OpenSSL version. rdkafka only works with openssl 1.1. Got very similar results when used latest openssl-dev version on linux, and fixed it by compiling 1.1 version manually.

My guess is that openssl-sys = ["vendored"] may be installing later openssl version by default.
Tried using DEP_OPENSSL_VERSION_NUMBER: "0x1_01_01_00_0" but it doesn't seem to help

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

3 participants