From bcb7e96c590c10f2c924f8b0eaf25cfad3c1ab15 Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:26:33 +0100 Subject: [PATCH] Another attempt at fixing Docker cross-platform builds --- Cargo.toml | 3 --- Dockerfile | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 98ce953..55053ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,6 @@ repository.workspace = true resolver = "2" publish = false -[profile.release] -lto = true - [profile.dev] debug = 0 diff --git a/Dockerfile b/Dockerfile index 8ff9816..1bbabc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ ARG TARGETPLATFORM ARG BUILDPLATFORM # the compiler will otherwise ask for aarch64-linux-musl-gcc -ENV CC_aarch64_unknown_linux_musl=gcc +ENV CC_aarch64_unknown_linux_musl="clang" +ENV AR_aarch64_unknown_linux_musl="llvm-ar" ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld" # Stupid workaound with tempfiles since environment variables @@ -15,7 +16,7 @@ RUN case $TARGETPLATFORM in \ *) echo "Unsupported platform ${TARGETPLATFORM}"; exit 1;; \ esac -RUN apk add --no-cache musl-dev gcc \ +RUN apk add --no-cache musl-dev llvm19 clang \ && rustup target add "$(cat /tmp/rust_target)" \ && cargo install cargo-chef --locked \ && rm -rf "$CARGO_HOME/registry"