From c25a98943f5aa1d2a9289c6a049803966e5b6a7c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 7 Sep 2026 04:02:54 +0000 Subject: [PATCH 1/2] build(docker): stop copying the gitignored Cargo.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both Dockerfiles ran `COPY Cargo.toml Cargo.lock ./`, but Cargo.lock is gitignored on purpose — this is a library crate consumed by sibling repos via git dependency, so a committed lock is never used downstream and only goes stale. It is therefore absent from the build context, and the COPY fails the Railway build outright with "failed to calculate checksum ... /Cargo.lock: not found" — BuildKit's wording for a missing source, not a corrupt one. Cargo resolves fresh instead. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012wrzeZAdwGYTCKoxamwQht --- Dockerfile | 11 +++++++++-- Dockerfile.avx512 | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a68d33c8..d9637afe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,8 +29,15 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ WORKDIR /app -# Copy workspace files first for layer caching -COPY Cargo.toml Cargo.lock ./ +# Copy workspace files first for layer caching. +# +# Cargo.lock is deliberately NOT copied: it is gitignored (see .gitignore — this +# is a library crate consumed by sibling repos via git dependency, so a committed +# lock is never used by a downstream build), which means it is absent from the +# build context and `COPY Cargo.toml Cargo.lock ./` fails the build outright with +# "failed to calculate checksum ... /Cargo.lock: not found" — BuildKit's wording +# for a missing source, not a corrupt one. Cargo resolves fresh here instead. +COPY Cargo.toml ./ COPY ndarray-rand/Cargo.toml ndarray-rand/Cargo.toml COPY crates/ crates/ diff --git a/Dockerfile.avx512 b/Dockerfile.avx512 index 72fcbb0b..041b683e 100644 --- a/Dockerfile.avx512 +++ b/Dockerfile.avx512 @@ -26,7 +26,9 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ WORKDIR /app -COPY Cargo.toml Cargo.lock ./ +# Cargo.lock is gitignored and therefore absent from the build context; copying +# it fails the build at this line. See the same note in ./Dockerfile. +COPY Cargo.toml ./ COPY ndarray-rand/Cargo.toml ndarray-rand/Cargo.toml COPY crates/ crates/ From d23bcdd0afafb713f1566ab3e62257627704be28 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 7 Sep 2026 04:09:17 +0000 Subject: [PATCH 2/2] build(docker): bump the toolchain pin to the channel the repo requires MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The images installed 1.97.1 and asserted in prose that rust-toolchain.toml required it. The channel moved to 1.98.1 on 2026-09-01 and Cargo.toml declares rust-version = "1.98", so the pinned toolchain refuses the build outright: "rustc 1.97.1 is not supported by the following package: ndarray requires rustc 1.98". This was the next failure waiting behind the Cargo.lock COPY. The prose no longer restates the number, per rust-toolchain.toml's own warning that a stale comment on a version pin is how the next reader learns the wrong one — which is how the mismatch survived the bump. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012wrzeZAdwGYTCKoxamwQht --- Dockerfile | 21 ++++++++++++--------- Dockerfile.avx512 | 6 +++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index d9637afe..f4fcf29b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ # ndarray — Railway compile-test image (AVX2 default) # Verifies the HPC module builds cleanly (default + jit-native features) -# Requires Rust 1.97.1 (LazyLock, simd_caps, modern std APIs) # # CPU detection & SIMD dispatch documentation: see Dockerfile.md # AVX-512 pinned variant: see Dockerfile.avx512 @@ -15,17 +14,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates gcc libc6-dev pkg-config libssl-dev \ && rm -rf /var/lib/apt/lists/* -# Install Rust 1.97.1 via rustup — MUST match rust-toolchain.toml (channel = -# "1.97.1") and Cargo.toml's `rust-version = "1.97"`. rust-toolchain.toml is -# deliberately NOT copied into the image (rustup would try to download a second -# toolchain at build time), so this pin is the only thing keeping the image in -# step with the repo — bump it whenever rust-toolchain.toml moves. +# Install Rust via rustup. The version below MUST match rust-toolchain.toml's +# `channel` and satisfy Cargo.toml's `rust-version`; the number is deliberately +# not restated in this prose, per rust-toolchain.toml's own warning that "a stale +# comment on a version pin is how the next reader learns the wrong number" — that +# is exactly how this file came to pin 1.97.1 while the repo required 1.98, which +# fails at once with "rustc 1.97.1 is not supported by the following package". +# rust-toolchain.toml is deliberately NOT copied into the image (rustup would +# download a second toolchain at build time), so this pin is the only thing +# keeping the image in step with the repo — bump it whenever the channel moves. ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ - sh -s -- -y --default-toolchain 1.97.1 --profile minimal \ - && rustc --version | grep -q "1.97.1" + sh -s -- -y --default-toolchain 1.98.1 --profile minimal \ + && rustc --version | grep -q "1.98.1" WORKDIR /app @@ -83,4 +86,4 @@ RUN cargo test --release --lib -- hpc:: 2>&1 && echo "=== HPC TESTS OK ===" # Minimal runtime image — just proves it compiled FROM debian:bookworm-slim COPY --from=builder /app/target/release/libndarray.rlib /usr/local/lib/ -CMD ["echo", "ndarray build verified — Rust 1.97.1"] +CMD ["echo", "ndarray build verified"] diff --git a/Dockerfile.avx512 b/Dockerfile.avx512 index 041b683e..3cc76f9c 100644 --- a/Dockerfile.avx512 +++ b/Dockerfile.avx512 @@ -21,8 +21,8 @@ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ - sh -s -- -y --default-toolchain 1.97.1 --profile minimal \ - && rustc --version | grep -q "1.97.1" + sh -s -- -y --default-toolchain 1.98.1 --profile minimal \ + && rustc --version | grep -q "1.98.1" WORKDIR /app @@ -59,4 +59,4 @@ RUN cargo test --release --lib -- hpc:: 2>&1 && echo "=== AVX-512 HPC TESTS OK = FROM debian:bookworm-slim COPY --from=builder /app/target/release/libndarray.rlib /usr/local/lib/ -CMD ["echo", "ndarray AVX-512 build verified — Rust 1.97.1, target-cpu=x86-64-v4"] +CMD ["echo", "ndarray AVX-512 build verified — target-cpu=x86-64-v4"]