From 0d50d0b25792dc89e296f286f110c64191014099 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Fri, 7 Mar 2025 01:59:24 +0800 Subject: [PATCH] build: Add force-non-host to install minimal toolchain While executing `rustup toolchain add --profile minimal 1.82.0-x86_64-unknown-linux-musl`, it errors out with: ``` error: toolchain '1.82.0-x86_64-unknown-linux-musl' may not be able to run on this system note: add the `--force-non-host` flag to install the toolchain anyway ``` Add `--force-non-host` to install minimal musl toolchain for x86_64. Signed-off-by: Ruoqing He --- resources/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/Dockerfile b/resources/Dockerfile index 286f0d9b7..b9906602c 100644 --- a/resources/Dockerfile +++ b/resources/Dockerfile @@ -107,7 +107,9 @@ ENV OPENSSL_INCLUDE_DIR=/usr/include/ RUN export ARCH="$(uname -m)" \ && nohup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain "$RUST_TOOLCHAIN" \ && rustup target add "$ARCH"-unknown-linux-musl --toolchain "$RUST_TOOLCHAIN" \ - && if [ "$TARGETARCH" = "amd64" ]; then rustup toolchain add --profile minimal $RUST_TOOLCHAIN-x86_64-unknown-linux-musl; fi \ + && if [ "$TARGETARCH" = "amd64" ]; then \ + rustup toolchain add --profile minimal --force-non-host \ + $RUST_TOOLCHAIN-x86_64-unknown-linux-musl; fi \ && if [ "$TARGETARCH" = "amd64" ]; then rustup component add rustfmt; fi \ && if [ "$TARGETARCH" = "amd64" ]; then rustup component add clippy; fi \ && rm -rf "$CARGO_HOME/registry" \