Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fukc-gihtub
Copy link

It causes intermittent build failures like this one:

warning: unused import: `bindings::*`
  --> /home/chicken/testhashcat/hashcat/Rust/hashcat-sys/src/lib.rs:10:9
   |
10 | pub use bindings::*;
   |         ^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

gcc    -std=gnu99 -flto=auto -march=native -mtune=native -W -Wall -Wextra -O2 -fomit-frame-pointer -fno-plt -pipe -Iinclude/ -IOpenCL/ -Ideps/LZMA-SDK/C -Ideps/zlib -Ideps/zlib/contrib -Ideps/OpenCL-Headers -DWITH_BRAIN -Ideps/xxHash -DWITH_CUBIN -Ideps/unrar -DWITH_HWMON src/modules/module_00121.c obj/combined.NATIVE.a -o modules/module_00121.so -flto=auto -Wno-lto-type-mismatch -s -lstdc++ -lpthread -ldl -lrt -lm -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=700
error[E0432]: unresolved imports `hashcat_sys::bridge_context_t`, `hashcat_sys::generic_io_t`, `hashcat_sys::generic_io_tmp_t`, `hashcat_sys::salt_t`
  --> src/interop.rs:14:19
   |
14 | use hashcat_sys::{bridge_context_t, generic_io_t, generic_io_tmp_t, salt_t};
   |                   ^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^  ^^^^^^ no `salt_t` in the root
   |                   |                 |             |
   |                   |                 |             no `generic_io_tmp_t` in the root
   |                   |                 no `generic_io_t` in the root
   |                   no `bridge_context_t` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `dynamic_hash` (lib) due to 1 previous error
make: *** [src/bridges/bridge_rust_generic_hash.mk:64: bridges/subs/dynamic_hash.so] Error 101
make: *** Waiting for unfinished jobs....
cp Rust/bridges/generic_hash/target/release/libgeneric_hash.so bridges/subs/generic_hash.so

@pwrbob
Copy link
Contributor

pwrbob commented Jan 14, 2026

This can lead to problems if architecture-dependent #ifdefs are ever used. According to the bindgen user manual, when doing this in a build.rs script, the file should always be regenerated. I'm working on a Rust bridge that will have this property.
Source: https://rust-lang.github.io/rust-bindgen/library-usage.html

Concerning the error: I don't quite understand how you are getting these errors. Are there maybe multiple instances of cargo compiling different crates at the same time, with one overwriting the bindings.rs file while another is trying to read it? If so, a better solution may be to use .NOTPARALLEL: $(RUST_SUBS_DIR)/%.so or similar in bridge_rust_generic_hash.mk. Cargo parallelizes compilation internally, so this will not introduce a lot of slowdown.

@fukc-gihtub
Copy link
Author

There are no architecture-dependent ifdefs in hashcat_types.h currently, so I don't think we need to run bindgen. It also introduces a libclang dependency: #4603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants