The module-hash cargo feature controls if the hash module in yara is compiled or not. That module exposes hashing functionality through OpenSSL.
For a project I do not need hashing functionality and I don't want to include OpenSSL, so I disable the yara-rusts module-hash cargo feature, but then building yara fails with the error:
error: could not find native static library `ssl`, perhaps an -L flag is missing?
After investigation, it seems that we need to also set the environment variable YARA_CRYPTO_LIB=disable so that yara-sys doesn't include it.
Could it be possible to automatically set YARA_CRYPTO_LIB=disable when the module-hash cargo feature is not enabled? That would require a build.rs for yara-rust with that logic.
The
module-hash
cargo feature controls if thehash
module in yara is compiled or not. That module exposes hashing functionality through OpenSSL.For a project I do not need hashing functionality and I don't want to include OpenSSL, so I disable the
yara-rust
smodule-hash
cargo feature, but then buildingyara
fails with the error:After investigation, it seems that we need to also set the environment variable
YARA_CRYPTO_LIB=disable
so thatyara-sys
doesn't include it.Could it be possible to automatically set
YARA_CRYPTO_LIB=disable
when themodule-hash
cargo feature is not enabled? That would require abuild.rs
foryara-rust
with that logic.