~nickbp/kapiti

c0d7d13d18e7d1f860811970447bd0c661418d7d — Nick Parker 1 year, 1 month ago 6c95e9a
Hack to fix build-deps wanting to see bench source code: Hide it
2 files changed, 9 insertions(+), 4 deletions(-)

M Cargo.toml
M Dockerfile
M Cargo.toml => Cargo.toml +5 -3
@@ 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

M Dockerfile => Dockerfile +4 -1
@@ 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