rust-rocksdb: error: failed to run custom build command for `librocksdb-sys v0.6.1+6.28.2`
i have a project that is dependant on that specific version of librocksdb-sys and wheni run cargo build --release it show the following
error:failed to run custom build command for `librocksdb-sys v0.6.1+6.28.2`
Caused by:
process didn't exit successfully: `/home/ezio/projects/testhex/target/debug/build/librocksdb-sys-2c05e423d101bec2/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at '"enum_(unnamed_at_rocksdb/include/rocksdb/c_h_860_1)" is not a valid Ident', /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:811:9
stack backtrace:
0: rust_begin_unwind
at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/panicking.rs:64:14
2: proc_macro2::fallback::validate_ident
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:811:9
3: proc_macro2::fallback::Ident::_new
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:753:9
4: proc_macro2::fallback::Ident::new
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:763:9
5: proc_macro2::Ident::new
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/lib.rs:972:21
6: bindgen::ir::context::BindgenContext::rust_ident_raw
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/ir/context.rs:878:9
7: bindgen::ir::context::BindgenContext::rust_ident
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/ir/context.rs:870:9
8: <bindgen::ir::enum_ty::Enum as bindgen::codegen::CodeGenerator>::codegen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:2907:21
9: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:1004:39
10: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:492:17
11: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:515:21
12: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:545:13
13: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:483:17
14: bindgen::codegen::codegen::{{closure}}
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:4287:9
15: bindgen::ir::context::BindgenContext::gen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/ir/context.rs:1190:19
16: bindgen::codegen::codegen
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/codegen/mod.rs:4251:5
17: bindgen::Bindings::generate
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/lib.rs:2374:32
18: bindgen::Builder::generate
at /home/ezio/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/lib.rs:1478:9
19: build_script_build::bindgen_rocksdb
at ./build.rs:36:20
20: build_script_build::main
at ./build.rs:325:5
21: core::ops::function::FnOnce::call_once
at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
i tried runing adding the same on an empty project with cargo add librocksdb-sys@0.6.1+6.28.2 and the same error appears
environment:
Default host: x86_64-unknown-linux-gnu
rustup home: /home/ezio/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu (default)
nightly-2022-11-11-x86_64-unknown-linux-gnu
nightly-2022-11-30-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.63.0-x86_64-unknown-linux-gnu
1.68.2-x86_64-unknown-linux-gnu
active toolchain
----------------
stable-x86_64-unknown-linux-gnu (default)
rustc 1.68.2 (9eb3afe9e 2023-03-27)
OS: opensuse tumbleweed (latest update)
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 16 (2 by maintainers)
Commits related to this issue
- Merge branch 'levsha/chore-update-rocksdb-' into 'master' chore: update rocksdb. This will also update librocksdb-sys as dependency and therefore should fix builds on MacOS with the new clang/llvm: ... — committed to dfinity/ic by marko-k0 8 months ago
- sample_projects/bin/with_git_submodule_dep Update rocksdb dependency version because of https://github.com/rust-rocksdb/rust-rocksdb/issues/768 — committed to nix-community/crate2nix by kolloch 6 months ago
- Update titan to use async init gc and avoid manifest io mutex (#768) * update titan to use async init gc and avoid manifest io mutex Signed-off-by: Connor1996 <zbk602423539@gmail.com> — committed to Shylock-Hg/rust-rocksdb by Connor1996 8 months ago
- sample_projects/bin/with_git_submodule_dep Update rocksdb dependency version because of https://github.com/rust-rocksdb/rust-rocksdb/issues/768 — committed to lelongg/crate2nix by kolloch 6 months ago
Thank you, this helped me out! I ran this before the compile I was trying to do, and it fixed the error.
Older Clang? It seems that this problem appears only with LLVM/Clang 16 that was released just a month ago or so.
I get a similar error on macOS with Apple Clang 15.x and RocksDb 7.x. The fix for me was to either:
bindgendependency to >=0.62I have similar error on Fedora 38.
Probably caused by this: https://github.com/rust-lang/rust-bindgen/issues/2488 / https://github.com/rust-lang/rust-bindgen/issues/2312