From 3495b74e76ba82894342c25e723a5ab0ad882f23 Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Wed, 5 Aug 2026 21:32:51 +0300 Subject: [PATCH] build: Adjust Dockerfile to new Cargo build-dir layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cargo layout change: https://github.com/rust-lang/cargo/issues/15010 (now enabled in nightly) Determined that `rm` is still needed: Cargo rebuilds a crate only if a source file's mtime is newer than the previous build's start time. Docker `COPY` preserves the real `src/lib.rs` mtime, which would be older than the dummy build's start — so Cargo wrongly deems the crate fresh and skips rebuild. --- varia/Dockerfile.tests | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/varia/Dockerfile.tests b/varia/Dockerfile.tests index 53b8b2e..5d39a0f 100644 --- a/varia/Dockerfile.tests +++ b/varia/Dockerfile.tests @@ -11,9 +11,10 @@ RUN rustup component add rustfmt clippy # Build Cargo dependencies for cache COPY Cargo.toml ./ RUN mkdir src/ && \ - echo "pub fn main() {println!(\"dummy function\")}" > src/lib.rs && \ + echo 'pub fn main() {println!("dummy function")}' > src/lib.rs && \ cargo build --lib --tests --examples --color=always && \ - rm -rdv target/*/deps/rocket_sentry-* \ + rm -rfv target/*/build/rocket-sentry \ + target/*/deps/rocket_sentry-* \ target/*/.fingerprint/rocket-sentry-* # Do the actual build