From 8aa187e8024c1f195ef48a5c5b33836ce82271fd Mon Sep 17 00:00:00 2001 From: Michael Uti Date: Fri, 12 Apr 2024 13:41:56 +0100 Subject: [PATCH] ci: use cross docker image that supports openssl for musl arch --- Cargo.toml | 8 -------- Cross.toml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 Cross.toml diff --git a/Cargo.toml b/Cargo.toml index 85edce3e7af..20ab2beac7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,11 +34,3 @@ inherits = "release" opt-level = 2 [profile.dev.package.adler] opt-level = 1 - -# Allows us build with cross across multiple platforms. -[workspace.metadata.cross.build] -# additional commands to run prior to building the package -pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH", - "apt-get update && apt-get --assume-yes install libssl-dev:$CROSS_DEB_ARCH", -] diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000000..8d989915a7e --- /dev/null +++ b/Cross.toml @@ -0,0 +1,16 @@ +[target.armv7-unknown-linux-musleabihf] +image = "rustembedded/cross:armv7-unknown-linux-musleabihf-0.1.16" + +[target.x86_64-unknown-linux-musl] +image = "rustembedded/cross:x86_64-unknown-linux-musl-0.1.16" + +[target.aarch64-unknown-linux-musl] +image = "rustembedded/cross:aarch64-unknown-linux-musl-0.1.16" + +[build] +pre-build = [ # additional commands to run prior to building the package + "dpkg --add-architecture $CROSS_DEB_ARCH", + # Cross runs the pre-build command for all target and libssl-dev:$CROSS_DEB_ARCH + # install fails for musl archs, so we fall back to using just the musl:0.1.16 of cross + "apt update && apt --assume-yes install libdbus-1-dev:$CROSS_DEB_ARCH libssl-dev:$CROSS_DEB_ARCH || exit 0", +]