From 066bab50ba2d97957c0176eebb8a6cafa1db6a9a Mon Sep 17 00:00:00 2001 From: Christbru Date: Sat, 18 Oct 2025 18:59:55 -0500 Subject: [PATCH] Provide dummy main file to get through dependency validation then pass source files in to take advantage of github action caching to significantly speed up pushes. --- rust-engine/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rust-engine/Dockerfile b/rust-engine/Dockerfile index f93d1b1..4724dcb 100644 --- a/rust-engine/Dockerfile +++ b/rust-engine/Dockerfile @@ -9,12 +9,18 @@ RUN apt-get update && apt-get install -y \ libssl-dev \ && rm -rf /var/lib/apt/lists/* -# Copy ONLY Cargo.toml to resolve dependencies +# Copy ONLY Cargo.toml COPY Cargo.toml ./ -# KEY CHANGE: Generate lock file and fetch dependencies inside the container +# --- KEY CHANGE: Create a dummy main.rs BEFORE fetching dependencies --- +RUN mkdir src && echo "fn main() {}" > src/main.rs + +# Now, generate the lock file and fetch dependencies RUN cargo update && cargo fetch +# Remove the dummy file before copying the real source code +RUN rm -rf src + # Now copy the rest of your source code COPY src ./src