You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Help! The reqwest library depends on openssl, and when compiling Rust code that implements a network request, I'm encountering an openssl error. Urgent assistance needed!
#2221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
I am currently attempting to compile Rust code using the HarmonyOS toolchain. The scenario involves making a simple network request using the reqwest library. Here's my current Cargo.toml file.
[package]
name = "MyHarmonyLib"
version = "0.1.0"
edition = "2021"
[lib]
#name = "rust_lib"
crate-type = ["staticlib", "rlib"]
[dependencies]
libc = "0.2"
reqwest = { version = "0.11", features = ["multipart"] }
tokio = { version = "1.36", features = ["rt", "sync", "time", "macros", "net", "rt-multi-thread"] }
lazy_static = "1.4.0" # popular runtime library for asynchronous programming.
openssl-sys = "0.9"
openssl = { version = "0.10", features = ["vendored"] }
[[example]]
name = "example"
path = "example/main.rs"
However, I have encountered the following error message, and various methods I found online have failed to resolve the issue.
error: failed to run custom build command for `openssl-sys v0.9.102`
Caused by:
process didn't exit successfully: `/mnt/c/Users/l30052471/Desktop/HarmonyRustHttps/MyHarmonyRustLib/target/release/build/openssl-sys-79376e6e35b9f572/build-script-main` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_OHOS_OPENSSL_NO_VENDOR
AARCH64_UNKNOWN_LINUX_OHOS_OPENSSL_NO_VENDOR unset
cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
OPENSSL_NO_VENDOR unset
--- stderr
thread 'main' panicked at /home/boyan20/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-300.2.3+3.2.1/src/lib.rs:366:18:
don't know how to configure OpenSSL for aarch64-unknown-linux-ohos
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
mv: cannot stat 'target/aarch64-unknown-linux-ohos/release/libMyHarmonyLib.a': No such file or directory
The text was updated successfully, but these errors were encountered:
It looks like you're hitting the same issue as alpine (#1624): HarmonyOS is defining its own target "aarch64-unknown-linux-ohos" which openssl-src doesn't know how to deal with. You either need to use a pre-built version of OpenSSL (either dynamically or statically linked) and not use the vendored feature, or you need to teach openssl-src how to build in this environment.
I am currently attempting to compile Rust code using the HarmonyOS toolchain. The scenario involves making a simple network request using the reqwest library. Here's my current Cargo.toml file.
However, I have encountered the following error message, and various methods I found online have failed to resolve the issue.
The text was updated successfully, but these errors were encountered: