electrs icon indicating copy to clipboard operation
electrs copied to clipboard

electrs-librocksdb-sys build fails on GCC 15

Open yuvadm opened this issue 4 months ago • 10 comments

Have you read the documentation? Yes.

Did you double-check that you installed all dependencies? Yes.

Which command failed? cargo build --locked --release

What was the error message? Build fails while compiling electrs-librocksdb-sys, seems that standard int types are not declared

error: ‘uint64_t’ has not been declared
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’

System OS name and version: Arch Linux gcc/g++ version: 15.2.1 rustc version: rustc 1.89.0 (29483883e 2025-08-04) cargo version: cargo 1.89.0 (c24e10642 2025-06-23)

Compilation Linking: static Cross compilation: no Target architecture: x86_64

Additional context https://github.com/facebook/rocksdb/issues/13365

Workaround: This command works successfully:

CXXFLAGS="-include cstdint" cargo build --locked --release

yuvadm avatar Aug 17 '25 18:08 yuvadm

Upstream bug: https://github.com/facebook/rocksdb/issues/13365

yuvadm avatar Aug 17 '25 18:08 yuvadm

Thanks for reporting this issue!

It also happens on #1125 (using RocksDB 9.10.0). The above workaround seems to work there as well :)

$ docker run -it --rm archlinux:latest bash
Unable to find image 'archlinux:latest' locally
latest: Pulling from library/archlinux
99c7ced3048a: Pull complete 
f99f76e6e581: Pull complete 
Digest: sha256:104d24b4464e89a16566d3e68ce0e2707aa15258c690ee9bef755930e8bc1c2d
Status: Downloaded newer image for archlinux:latest

# pacman -S gcc clang git cargo 
 gcc-15.2.1+r22+gc4e96a094636-1-x86_64 downloading...
 gcc-libs-15.2.1+r22+gc4e96a094636-1-x86_64 downloading...
 binutils-2.45+r29+g2b2e51a31ec7-1-x86_64 downloading...
 libisl-0.27-1-x86_64 downloading...
 jansson-2.14.1-1-x86_64 downloading...
 libmpc-1.3.1-2-x86_64 downloading...
 clang-20.1.8-1-x86_64 downloading...
 llvm-libs-20.1.8-1-x86_64 downloading...
 compiler-rt-20.1.8-1-x86_64 downloading...
 libedit-20250104_3.1-1-x86_64 downloading...
 perl-5.42.0-1-x86_64 downloading...
 git-2.50.1-3-x86_64 downloading...
 db5.3-5.3.28-5-x86_64 downloading...
 zlib-ng-2.2.5-1-x86_64 downloading...
 perl-mailtools-2.22-2-any downloading...
 perl-timedate-2.33-8-any downloading...
 perl-error-0.17030-2-any downloading...
 rust-1:1.89.0-1-x86_64 downloading...

# git clone https://github.com/romanz/electrs -b debian-testing

# cd electrs; CXXFLAGS="-include cstdint" cargo build --release
   Compiling rust-librocksdb-sys v0.32.0+9.10.0
   Compiling rust-rocksdb v0.36.0
   Compiling electrs v0.10.10 (/electrs)
    Finished `release` profile [optimized] target(s) in 2m 59s

romanz avatar Aug 18 '25 06:08 romanz

Fixed in:

  • https://github.com/rust-rocksdb/rust-rocksdb/pull/1007
  • https://github.com/zaidoon1/rust-rocksdb/pull/152

romanz avatar Aug 18 '25 06:08 romanz

Is this fixed by updating rust-rocksdb in Cargo.toml to the latest version? https://github.com/zaidoon1/rust-rocksdb/pull/152 is included in 0.42.0, but it mentions an issue with builds on windows which was addressed but not released yet (at the time of writing this comment the latest version is 0.43.0).

antonilol avatar Aug 25 '25 14:08 antonilol

I recently install electrs on a server but I got a wraning not an erro:

Compiling electrs-rocksdb v0.19.0-e3
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
   --> /home/admin/rust/electrs/target/release/build/electrs-9070409b19eca5b5/out/configure_me_config.rs:886:1
    |
886 | #[automatically_derived]
    | ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_attributes)]` on by default

warning: `#[automatically_derived]` only has an effect on trait implementation blocks
   --> /home/admin/rust/electrs/target/release/build/electrs-9070409b19eca5b5/out/configure_me_config.rs:409:5
    |
409 |     #[automatically_derived]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: `electrs` (lib) generated 2 warnings
    Building [=======================> ] 182/183: electrs(bin)     

ghost avatar Oct 05 '25 17:10 ghost

@rdmxq how are those warnings related to this issue?

yuvadm avatar Oct 05 '25 17:10 yuvadm

@rdmxq how are those warnings related to this issue?

I am not sure, as I saw it's related to rocksdb I thought it's a similar issue.

ghost avatar Oct 05 '25 17:10 ghost

I think it is unrelated to this issue, this warning is from a dependency crate configure_me (actually a file generated by it) and can be ignored.

antonilol avatar Oct 05 '25 18:10 antonilol

I think it is unrelated to this issue, this warning is from a dependency crate configure_me (actually a file generated by it) and can be ignored.

Thanks for the info then, sorry for disturbing.

ghost avatar Oct 05 '25 18:10 ghost

For information, I have issued a PR on configure_me crate that corrects the warnings about #[automatically_derived] attributes.

Thierry61 avatar Oct 14 '25 14:10 Thierry61