From d570fe0ed0eae99a5ff9575a6c2dfcf3f5e2b0bf Mon Sep 17 00:00:00 2001 From: Aman Sharma Date: Fri, 2 Oct 2026 19:45:41 +0200 Subject: [PATCH] fix: make the benchmark image's cargo registry writable and add clippy COPY recreates /usr/local/cargo and /usr/local/rustup as root-only, so cargo couldn't download crates as the host uid. Also installs clippy and rustfmt, which the rust image leaves out. Co-Authored-By: Claude Opus 5.5 --- benchmark/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmark/Dockerfile b/benchmark/Dockerfile index 66d8ca7d..60f81708 100644 --- a/benchmark/Dockerfile +++ b/benchmark/Dockerfile @@ -3,7 +3,8 @@ FROM node:22-trixie # A toolchain for every benchmarked ecosystem (npm, git and curl come with # the base image), so agents can query registries and generate lockfiles as # on a dev machine. Containers run as the host uid with HOME=/tmp, so caches -# land under /tmp; the rust image's toolchain dirs are already world-writable. +# land under /tmp; COPY recreates the rust toolchain dirs non-writable, so chmod +# them back as the rust image does. COPY --from=rust:1-trixie /usr/local/rustup /usr/local/rustup COPY --from=rust:1-trixie /usr/local/cargo /usr/local/cargo COPY --from=golang:1-trixie /usr/local/go /usr/local/go @@ -12,7 +13,8 @@ COPY --from=maven:3 /usr/share/maven /usr/share/maven COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo JAVA_HOME=/opt/java/openjdk \ PATH=/usr/local/cargo/bin:/usr/local/go/bin:/opt/java/openjdk/bin:/usr/share/maven/bin:$PATH -RUN apt-get update && apt-get install -y --no-install-recommends python3-pip python3-venv python-is-python3 gh \ +RUN chmod a+w /usr/local/cargo /usr/local/rustup && rustup component add clippy rustfmt \ + && apt-get update && apt-get install -y --no-install-recommends python3-pip python3-venv python-is-python3 gh \ && rm -rf /var/lib/apt/lists/* RUN npm install -g @anthropic-ai/claude-code