I’m stuck while building a package that includes OpenSSL. The error message I get is:
error: failed to run custom build command for `openssl-sys v0.9.67`
Caused by:
process didn't exit successfully: `/Users/jost/Desktop/holochain/lair-keystore-client/target/release/build/openssl-sys-8609751769bb813c/build-script-main` (exit status: 101)
I’m running macOS on aarch64-darwin.
Here’s the nix expression snippet with build inputs:
The commented lines don’t make a difference, I’ve tried including openssl and/or openssl.dev, as well as pkg-config, as well as setting those env vars manually - to no avail.
I’m able to cargo build the binary successfully when I enter a nix-shell. But to build the package, nix-build seems to use the equivalent of a --pure shell, and when I build the binary from such a pure shell, I get the error.
So there must be something in my environment which enables the build, that isn’t present in the pure env. I haven’t been able to figure out what it is. There are no OPENSSL env vars set anyway.
Searched all the websites in the world I believe. Can anyone help me out?
Rust packages that rely on FFI often rely on pkg-config to discover the libraries, then you need the library in buildInputs and pkg-config in nativeBuildInputs.
Through another repo that uses the “vendored” openssl crate in Rust, I finally found out that perl is the package that I need to add, because that openssl crate uses perl under the hood to configure it. It’s mentioned on the openssl crate page openssl - Rust.