skade / leveldb-sys

MIT License
7 stars 15 forks source link

Build error on Alpine Linux #24

Closed OTLabs closed 3 years ago

OTLabs commented 3 years ago

Building leveldb-sys as part of lighthouse produces following error on Alpine Linux (https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/369543#L663):

663   Compiling leveldb-sys v2.0.8
664     Running `rustc --crate-name build_script_build /home/buildozer/.cargo/registry/src/github.com-1ecc6299db9ec823/leveldb-sys-2.0.8/src/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C metadata=b50afc3d07209b33 -C extra-filename=-b50afc3d07209b33 --out-dir /builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/build/leveldb-sys-b50afc3d07209b33 -L dependency=/builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/deps --extern cmake=/builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/deps/libcmake-b2bc141211f241e7.rlib --extern num_cpus=/builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/deps/libnum_cpus-d1c8c541a88113e3.rlib --cap-lints allow`
1019 error: could not find native static library `stdc++`, perhaps an -L flag is missing?
1023 error: aborting due to previous error
1024 error: could not compile `leveldb-sys`
1025 Caused by:
1026  process didn't exit successfully: `rustc --crate-name leveldb_sys /home/buildozer/.cargo/registry/src/github.com-1ecc6299db9ec823/leveldb-sys-2.0.8/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=3440c20d9607ecbc -C extra-filename=-3440c20d9607ecbc --out-dir /builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/deps -L dependency=/builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/deps --extern libc=/builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/deps/liblibc-752357d5792dd1c8.rmeta --cap-lints allow -L native=/builds/otlabs/aports/testing/lighthouse/src/lighthouse-1.2.2/target/release/build/leveldb-sys-ae74cd4a77e9445c/out/lib -l static=leveldb -l static=stdc++` (exit code: 1)
skade commented 3 years ago

It seems like lighthouse doesn't properly depend on libstdc++. https://gitlab.alpinelinux.org/otlabs/aports/-/commit/757077009c63ff19babde456c80651370f34dab3

https://pkgs.alpinelinux.org/package/edge/main/x86/libstdc++

Please reopen if this is not the issue.

OTLabs commented 3 years ago

It is not the issue.

Setting export RUSTFLAGS="$RUSTFLAGS -L /usr/lib/" makes leveldb-sys compile fine.