From c0d7d13d18e7d1f860811970447bd0c661418d7d Mon Sep 17 00:00:00 2001 From: Nick Parker Date: Mon, 22 Aug 2022 00:36:30 +1200 Subject: [PATCH] Hack to fix build-deps wanting to see bench source code: Hide it --- Cargo.toml | 8 +++++--- Dockerfile | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5866469..6b1480f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,8 @@ futures-delay-queue = "0.5" # for benchmarks proptest = "1.0" # for property tests tempfile = "3" # for benchmarks -[[bench]] -name = "server" -harness = false +# Hack to fix 'cargo build-deps' in Dockerfile: +# Hide this bench section entirely, for whatever reason build-deps wants to see server.rs. +[[bench]] # build-deps: skip +name = "server" # build-deps: skip +harness = false # build-deps: skip diff --git a/Dockerfile b/Dockerfile index f05600b..9b4bf1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,10 @@ RUN apt-get update \ # Build dependencies on their own as separate step to improve cached builds # (only copy Cargo.* to avoid source changes breaking this cache) COPY Cargo.toml Cargo.lock /originz -RUN cd /originz && cargo build-deps --release +# Hack: fix for "can't find `server` bench at `benches/server.rs` [...]" +RUN cd /originz \ + && sed -i 's/.*build-deps: skip.*//g' Cargo.toml \ + && cargo build-deps --release COPY . /originz RUN cd /originz && cargo build --release -- 2.38.5