Skip to content

Commit 13da9fc

Browse files
committed
don't rebuild build.rs if it hasn't been modified
Copy and `touch` `build.rs` before copying source
1 parent 89aa564 commit 13da9fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ RUN cargo build --release
3939
# build. The touch on all the .rs files is needed, otherwise cargo assumes the
4040
# source code didn't change thanks to mtime weirdness.
4141
RUN rm -rf src build.rs
42-
COPY --chown=cratesfyi src src/
42+
4343
COPY --chown=cratesfyi build.rs build.rs
44+
RUN touch build.rs
45+
COPY --chown=cratesfyi src src/
46+
RUN find src -name "*.rs" -exec touch {} \;
4447
COPY --chown=cratesfyi templates/style.scss templates/
45-
RUN touch build.rs && find src -name "*.rs" -exec touch {} \; && cargo build --release
48+
49+
RUN cargo build --release
4650

4751
ADD templates templates/
4852
ADD css $CRATESFYI_PREFIX/public_html

0 commit comments

Comments
 (0)