stout77
December 13, 2022, 11:39pm
1
@chriso probably aware of this, but i
On github I noticed problems cross compiling OpenSSL for ARM and came across this, so linking here:
References from here;
opened 10:42AM - 29 Mar 20 UTC
closed 11:58AM - 29 Mar 20 UTC
question
Not sure what I am doing wrong, but I can't get `cross` to work with `openssl-sy… s` crate.
I have tried both `aarch64-unknown-linux-gnu` and `aarch64-unknown-linux-musl`
Any suggestions?
```
cross build --target aarch64-unknown-linux-gnu
Compiling openssl-sys v0.9.54
Compiling sct v0.5.0
Compiling webpki v0.19.1
Compiling futures-util v0.3.4
Compiling tokio-util v0.2.0
Compiling serde_urlencoded v0.6.1
Compiling serde_json v1.0.48
Compiling failure v0.1.7
Compiling uuid v0.7.4
Compiling xsd-types v0.1.0 (https://github.com/lumeohq/xsd-parser-rs?rev=05cd3be1#05cd3be1)
Compiling flexi_logger v0.15.2
Compiling tokio v0.1.22
error: failed to run custom build command for `openssl-sys v0.9.54`
Caused by:
process didn't exit successfully: `/target/debug/build/openssl-sys-5b14a6ca64ca7ff2/build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
run pkg_config fail: "Cross compilation detected. Use PKG_CONFIG_ALLOW_CROSS=1 to override"
--- stderr
thread 'main' panicked at '
Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
compilation process.
Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.
$HOST = x86_64-unknown-linux-gnu
$TARGET = aarch64-unknown-linux-gnu
openssl-sys = 0.9.54
', /cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.54/build/find_normal.rs:150:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
```
chriso
December 14, 2022, 11:42am
2
Hey, thanks for the message.
Have you specifically came across trouble building safe
or sn_node
for ARM? We are using cross
in the release process:
.ONESHELL:
arm-unknown-linux-musleabi:
# The outer process that calls this, i.e., the build agent on Github Actions, must be performing
# set +e, because even if the compilation fails it just continues and no error is reported.
@set -e
rm -rf target
rm -rf artifacts
mkdir artifacts
cargo install cross
cross build --release --target arm-unknown-linux-musleabi --bin sn_node
cross build --release --target arm-unknown-linux-musleabi --features limit-client-upload-size --bin safe
find target/arm-unknown-linux-musleabi/release -maxdepth 1 -type f -exec cp '{}' artifacts \;
.ONESHELL:
armv7-unknown-linux-musleabihf:
# The outer process that calls this, i.e., the build agent on Github Actions, must be performing
# set +e, because even if the compilation fails it just continues and no error is reported.
@set -e
rm -rf target
rm -rf artifacts
When this was last run on Friday it completed OK. I also tried it locally and had no problem.
2 Likes
stout77
December 14, 2022, 12:28pm
3
Ah ok, thanks but no, I currently have no problems with that, although I had in the past. It’s just that I saw that failing a few times in a number of github PR checks, and remembered these article that helped me in the past.
All good then
2 Likes