I'm trying to build my Rust project using "anchor build
", but I get this error message in the terminal
error: failed to run custom build command for `openssl-sys v0.9.72`
Caused by:
process didn't exit successfully: `/home/rokasb/bachelor-project/kratos/target/release/build/openssl-sys-9488c608e06265da/build-script-main` (exit status: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=BPFEL_UNKNOWN_UNKNOWN_OPENSSL_NO_VENDOR
BPFEL_UNKNOWN_UNKNOWN_OPENSSL_NO_VENDOR unset
cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
OPENSSL_NO_VENDOR unset
--- stderr
thread 'main' panicked at 'don't know how to configure OpenSSL for bpfel-unknown-unknown', /home/rokasb/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-src-111.18.0+1.1.1n/src/lib.rs:283:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
This are my dependencies and features in Cargo.toml file:
[dependencies]
anchor-lang = "0.21.0"
openssl = { version = "0.10", features = ["vendored"] }
[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []
vendored-openssl = ["openssl/vendored"]
It feels like I have tried everything to get openssl work in my project, but it always fails to build. I'm using Manjaro Linux. Any ideas what I could do to fix this problem and make openssl work with Rust?
I have tried following:
- changing PKG_CONFIG_PATH and OPENSSL_DIR manually
- updating rust with
rustup update
- deleting and installing openssl with different versions (using pacman)
- running this command
sudo pacman -S pkg-config openssl
- changing dependencies in Cargo.toml to:
[dependencies] openssl-sys = "0.9" openssl = "0.10"
- setting PKG_CONFIG_ALLOW_CROSS=1