electrs: Can't build with rust 1.40.0

Building with rust 1.39.0 works fine. 1.40 gets the error below. This is on 32 bit armv7l hardware.

   Compiling librocksdb-sys v5.18.3
error: failed to run custom build command for `librocksdb-sys v5.18.3`

Caused by:
  process didn't exit successfully: `/home/bitcoin/electrs/target/release/build/librocksdb-sys-e908501be0012fa4/build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=rocksdb/
cargo:rerun-if-changed=snappy/
cargo:rerun-if-changed=lz4/
cargo:rerun-if-changed=zstd/
cargo:rerun-if-changed=zlib/
cargo:rerun-if-changed=bzip2/
NUM_JOBS = Some("8")
TARGET = Some("armv7-unknown-linux-gnueabihf")
OPT_LEVEL = Some("3")
HOST = Some("armv7-unknown-linux-gnueabihf")
CXX_armv7-unknown-linux-gnueabihf = None
CXX_armv7_unknown_linux_gnueabihf = None
HOST_CXX = None
CXX = None
CXXFLAGS_armv7-unknown-linux-gnueabihf = None
CXXFLAGS_armv7_unknown_linux_gnueabihf = None
HOST_CXXFLAGS = None
CXXFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = None

...

error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=armv7-a" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.7.0/fused-src/" "-I" "snappy/" "-I" "lz4/lib/" "-I" "zstd/lib/" "-I" "zstd/lib/dictBuilder/" "-I" "zlib/" "-I" "bzip2/" "-I" "." "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-parameter" "-DSNAPPY=1" "-DLZ4=1" "-DZSTD=1" "-DZLIB=1" "-DBZIP2=1" "-DNDEBUG=1" "-DOS_LINUX=1" "-DROCKSDB_PLATFORM_POSIX=1" "-DROCKSDB_LIB_IO_POSIX=1" "-o" "/home/bitcoin/electrs/target/release/build/librocksdb-sys-3d51c0756006fa16/out/rocksdb/utilities/transactions/pessimistic_transaction_db.o" "-c" "rocksdb/utilities/transactions/pessimistic_transaction_db.cc" with args "c++" did not execute successfully (status code exit code: 1).

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (15 by maintainers)

Most upvoted comments

Please try building electrs with #403 (comment):

$ RUSTFLAGS="-C link-args=-latomic" cargo build --release --locked

SUCCESS. Thank you, sir.

Also we had an issue recently that someone installed Rust using your guide on x86_64, which broke the system. Perhaps an explicit warning that the guide will only work on RPi would be useful?

Thanks for this hint, I added a warning: https://github.com/Stadicus/RaspiBolt/pull/682

– off-topic out 😃

To my knowledge, rustup doesn’t check signatures

In my guide, I install Rust manually, including signatures check: https://stadicus.github.io/RaspiBolt/raspibolt_50_electrs.html#install-dependencies

FWIW, this should have nothing to do with Rust version. IDK why it appears as if it has.

Do you think it’s just coincidence? I tried building several times on 1.41 and it failed every time, then it worked the first time on 1.48.

I’m thinking about switching to a raspi4 with 8GB ram running 64 bit raspbian, so if/when I do I’ll check out your repository. Thanks.

Looks like this issue is back… same setup as before with cargo 1.41.0, but now it won’t build v5.15.5 using the latest from master.

Maybe you can try to build it with RocksDB being dynamically linked: https://github.com/romanz/electrs/blob/master/doc/usage.md#dynamic-linking

We are supporting Rust 1.41 since it’s the version installed on stable Debian: https://packages.debian.org/stable/rustc

I just compiled Electrs a few days ago on a Raspberry Pi 4 using Rust 1.48.0 (see https://github.com/Stadicus/RaspiBolt/pull/673/commits/4a59a8e541f4cb34c67f2cb4289385cd54271455).

Not sure if that information helps. Is there a reason to stay on Rust 1.41?

FWIW, I can confirm that building with Rust 1.41 works like a charm on the Raspberry Pi 4 (Raspbian Buster, ARMv7)