From 06a03a285a7d4f37b88fa1291bd3ec30223748c3 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 28 Jan 2025 11:35:54 -0600 Subject: [PATCH] Set `JEMALLOC_SYS_WITH_LG_PAGE=16` in arm Docker builds (#10943) We do this in our standard binary release pipeline, but not in our Docker images. See https://github.com/astral-sh/uv/issues/10942 --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d6aa98385..744909a18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN case "$TARGETPLATFORM" in \ "linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \ *) exit 1 ;; \ esac + # Update rustup whenever we bump the rust version COPY rust-toolchain.toml rust-toolchain.toml RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target $(cat rust_target.txt) --profile minimal --default-toolchain none @@ -34,7 +35,10 @@ RUN rustup target add $(cat rust_target.txt) COPY crates crates COPY ./Cargo.toml Cargo.toml COPY ./Cargo.lock Cargo.lock -RUN cargo zigbuild --bin uv --bin uvx --target $(cat rust_target.txt) --release +RUN case "${TARGETPLATFORM}" in \ + "linux/arm64") export JEMALLOC_SYS_WITH_LG_PAGE=16;; \ + esac && \ + cargo zigbuild --bin uv --bin uvx --target $(cat rust_target.txt) --release RUN cp target/$(cat rust_target.txt)/release/uv /uv \ && cp target/$(cat rust_target.txt)/release/uvx /uvx # TODO(konsti): Optimize binary size, with a version that also works when cross compiling