Closed jm-observer closed 11 months ago
The CI builds artifacts with cross-rs/cross. I'm not familiar with it, but it seems to have Docker working under the hood.
The openssl is required by the tls
feature, and since you're doing cross-compiling, the ssl library of that target platform should be present. Maybe you can refer to openssl-sys
or tokio-native-tls
's documentation (I'm not sure if it will work though) for how to configure the build/cargo to find them.
And if the tls
feature is not nesserary to you, try disable it by passing --no-default-features --features client,server
to cargo. You may also want to pass --config target.$TARGET.linker=\"rust-lld\"
to cargo for it to use some linker other than the system's default.
By the way, I personally don't recommend messing around with Docker. I just build for aarch64-unknown-linux-musl
in GitHub Codespace (which is a x86_64 Linux platform I think) with just:
export TARGET=aarch64-unknown-linux-musl
rustup target add $TARGET
cargo build --release --target $TARGET \
--no-default-features --features noise,client,server,hot-reload \
--config target.$TARGET.linker=\"rust-lld\"
I used cross to cross-compile the target aarch64-unknown-linux-musl, but encountered an error: failed to run custom build command for
openssl-sys v0.9.83
. So why were you able to successfully cross-compile on GitHub's CI/CD?here is my cross.toml: