diff --git a/Justfile b/Justfile index 25ebe3e0e7..93050d4301 100644 --- a/Justfile +++ b/Justfile @@ -11,7 +11,11 @@ release-windows: #!/usr/bin/env sh if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "Linux" ]; then echo "Building Windows executable using Docker..." - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp \ + docker volume create goose-windows-cache || true + docker run --rm \ + -v "$(pwd)":/usr/src/myapp \ + -v goose-windows-cache:/usr/local/cargo/registry \ + -w /usr/src/myapp \ rust:latest \ sh -c "rustup target add x86_64-pc-windows-gnu && \ apt-get update && \ @@ -23,7 +27,7 @@ release-windows: cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/" else echo "Building Windows executable using Docker through PowerShell..." - powershell.exe -Command "docker run --rm -v ${PWD}:/usr/src/myapp -w /usr/src/myapp rust:latest sh -c 'rustup target add x86_64-pc-windows-gnu && apt-get update && apt-get install -y mingw-w64 && cargo build --release --target x86_64-pc-windows-gnu && GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) && cp \$GCC_DIR/libstdc++-6.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/'" + powershell.exe -Command "docker volume create goose-windows-cache; docker run --rm -v ${PWD}:/usr/src/myapp -v goose-windows-cache:/usr/local/cargo/registry -w /usr/src/myapp rust:latest sh -c 'rustup target add x86_64-pc-windows-gnu && apt-get update && apt-get install -y mingw-w64 && cargo build --release --target x86_64-pc-windows-gnu && GCC_DIR=\$(ls -d /usr/lib/gcc/x86_64-w64-mingw32/*/ | head -n 1) && cp \$GCC_DIR/libstdc++-6.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp \$GCC_DIR/libgcc_s_seh-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/ && cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/src/myapp/target/x86_64-pc-windows-gnu/release/'" fi echo "Windows executable and required DLLs created at ./target/x86_64-pc-windows-gnu/release/"