Blockstream / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
301 stars 125 forks source link

Upgrade `librocksdb`/`bindgen` for compatibility with Clang15 (XCode 15) #65

Closed Nsandomeno closed 7 months ago

Nsandomeno commented 9 months ago

I was unable to compile a clean copy of new-index due to pre-existing dependencies on my machine with the following error:

error: failed to run custom build command for `librocksdb-sys v6.20.3`

...

electrs/target/release/build/librocksdb-sys-3b3cba65ffc3c8e0/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '"enum_(unnamed_at_rocksdb/include/rocksdb/c_h_854_1)" is not a valid Ident'

I then noticed some other comments/issues around this error message related to an incompatibility with Clang 15 and Rust bindgen (<=0.62). With some tinkering and upgrading rocksdb to 0.21.0 I'm able to compile and use this in Regtest, but I'm curious if this could be a stub for a larger dependency upgrade that I'd be happy to contribute to.

The goal was to use electrs with a local bitcoind Regtest node, derived from Polar (Docker), which works following this change... here are some details of my setup to reproduce the original issue:

OS: MacOS (Intel)
rustc: 1.72.1
cargo: 1.72.1
rustup: 1.26.0
ovitrif commented 9 months ago

Thanks a lot @Nsandomeno πŸ™‡πŸ»β€β™‚οΈ!

I was able to compile new-index after checking out on your PR gp pr checkout 65 πŸŽ‰

My env:


OS: MacOS (M1) (arm64)
rustc: 1.74.1
cargo: 1.74.1
rustup: 1.26.0
# command: cargo build --release
Nsandomeno commented 9 months ago

Glad it helped! I was pointed to https://github.com/mempool/electrs by someone on a Bitcoin Stack Exchange that is a maintained version (unfortunately after this little change). It has a similar fix.

On Fri, Dec 22, 2023 at 3:16β€―PM Ovi Trif @.***> wrote:

Thanks a lot @Nsandomeno https://github.com/Nsandomeno πŸ™‡πŸ»β€β™‚οΈ!

I was able to compile new-index after checking out on your PR gp pr checkout 65 πŸŽ‰

My env:

OS: MacOS (M1) (arm64)rustc: 1.74.1cargo: 1.74.1rustup: 1.26.0

β€” Reply to this email directly, view it on GitHub https://github.com/Blockstream/electrs/pull/65#issuecomment-1868041755, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALYRKSKBKJJTDEMHQ3CB57LYKXTBDAVCNFSM6AAAAABAZUYEW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGA2DCNZVGU . You are receiving this because you were mentioned.Message ID: @.***>

ovitrif commented 8 months ago

Glad it helped! I was pointed to https://github.com/mempool/electrs by someone on a Bitcoin Stack Exchange that is a maintained version (unfortunately after this little change). It has a similar fix.

Thank you bro, you're too kind πŸ€— . Lovely to meet such friendly folks in my early bitcoin dev journey πŸ‘πŸ»

Was able to build the mempool/electrs project, will take it for a spin and most prolly I'll use it as my main electrs daemon πŸŽ‰

souvikhaldar commented 8 months ago

Glad it helped! I was pointed to https://github.com/mempool/electrs by someone on a Bitcoin Stack Exchange that is a maintained version (unfortunately after this little change). It has a similar fix.

Thank you bro, you're too kind πŸ€— . Lovely to meet such friendly folks in my early bitcoin dev journey πŸ‘πŸ»

Was able to build the mempool/electrs project, will take it for a spin and most prolly I'll use it as my main electrs daemon πŸŽ‰

@ovitrif So which electrs implementation you went with and how has your experience been? I'm constantly facing "Too many open files" issue.

ovitrif commented 7 months ago

@souvikhaldar I'm still using this one for the moment, though not working often enough with it to experience the Too many open files issue

shesek commented 7 months ago

Hi @Nsandomeno, thanks for the contribution! I did this in a slightly different way as part of #67, closing this. Cheers :)