Another attempt at fixing Docker cross-platform builds

This commit is contained in:
Lennart
2025-01-21 16:26:33 +01:00
parent 483ded96d5
commit bcb7e96c59
2 changed files with 3 additions and 5 deletions

View File

@@ -16,9 +16,6 @@ repository.workspace = true
resolver = "2" resolver = "2"
publish = false publish = false
[profile.release]
lto = true
[profile.dev] [profile.dev]
debug = 0 debug = 0

View File

@@ -4,7 +4,8 @@ ARG TARGETPLATFORM
ARG BUILDPLATFORM ARG BUILDPLATFORM
# the compiler will otherwise ask for aarch64-linux-musl-gcc # 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" ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"
# Stupid workaound with tempfiles since environment variables # Stupid workaound with tempfiles since environment variables
@@ -15,7 +16,7 @@ RUN case $TARGETPLATFORM in \
*) echo "Unsupported platform ${TARGETPLATFORM}"; exit 1;; \ *) echo "Unsupported platform ${TARGETPLATFORM}"; exit 1;; \
esac 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)" \ && rustup target add "$(cat /tmp/rust_target)" \
&& cargo install cargo-chef --locked \ && cargo install cargo-chef --locked \
&& rm -rf "$CARGO_HOME/registry" && rm -rf "$CARGO_HOME/registry"