From a2b1f78e23713bd362227eecf5bfa3d5209aec5b Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 28 Apr 2026 12:22:04 +0200 Subject: [PATCH] Preserve restored deno_cache through configure-time wipe The CI Deno dev cache (Cache Deno development cache step in .github/workflows/actions/quarto-dev/action.yml) restores package/dist/bin/deno_cache before configure runs. configure.sh and configure.cmd then unconditionally wipe package/dist when bootstrapping Deno, destroying the just-restored cache before vendor.sh reaches it. The vendor scripts already gate their own cache wipe with QUARTO_SKIP_DENO_CACHE_WIPE=1; the configure-time wipe was missed. Apply the same gate to configure.sh and configure.cmd so the restored cache survives. Local devs (env var unset) keep the original wipe behavior. --- configure.cmd | 42 +++++++++++++++++++++++------------------- configure.sh | 6 +++++- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/configure.cmd b/configure.cmd index 7084016d175..73a40483445 100644 --- a/configure.cmd +++ b/configure.cmd @@ -15,27 +15,31 @@ if NOT DEFINED QUARTO_VENDOR_BINARIES ( if "%QUARTO_VENDOR_BINARIES%" == "true" ( - REM Windows-specific: Check if deno.exe is running before deleting package/dist - REM Extracted to package/scripts/windows/check-deno-in-use.cmd for maintainability - call package\scripts\windows\check-deno-in-use.cmd "!QUARTO_DIST_PATH!" - if "!ERRORLEVEL!"=="1" exit /B 1 - - echo Removing package/dist/ directory... - RMDIR /S /Q "!QUARTO_DIST_PATH!" 2>NUL - - REM Fallback: Verify deletion succeeded (defense in depth) - if exist "!QUARTO_DIST_PATH!" ( - echo. - echo ============================================================ - echo Error: Could not delete package/dist/ directory - echo This may be due to permissions, antivirus, or another process holding files - echo ============================================================ - echo. - echo Try closing applications and run configure.cmd again - exit /B 1 + REM CI sets QUARTO_SKIP_DENO_CACHE_WIPE=1 so the restored deno_cache survives + REM (matches the gate used by package\scripts\vendoring\vendor.cmd). + IF NOT "!QUARTO_SKIP_DENO_CACHE_WIPE!"=="1" ( + REM Windows-specific: Check if deno.exe is running before deleting package/dist + REM Extracted to package/scripts/windows/check-deno-in-use.cmd for maintainability + call package\scripts\windows\check-deno-in-use.cmd "!QUARTO_DIST_PATH!" + if "!ERRORLEVEL!"=="1" exit /B 1 + + echo Removing package/dist/ directory... + RMDIR /S /Q "!QUARTO_DIST_PATH!" 2>NUL + + REM Fallback: Verify deletion succeeded (defense in depth) + if exist "!QUARTO_DIST_PATH!" ( + echo. + echo ============================================================ + echo Error: Could not delete package/dist/ directory + echo This may be due to permissions, antivirus, or another process holding files + echo ============================================================ + echo. + echo Try closing applications and run configure.cmd again + exit /B 1 + ) ) - MKDIR !QUARTO_BIN_PATH!\tools + IF NOT EXIST "!QUARTO_BIN_PATH!\tools" MKDIR !QUARTO_BIN_PATH!\tools PUSHD !QUARTO_BIN_PATH!\tools ECHO Bootstrapping Deno... diff --git a/configure.sh b/configure.sh index 859f3a3f769..23b9550e4b5 100755 --- a/configure.sh +++ b/configure.sh @@ -37,7 +37,11 @@ if [[ "${QUARTO_VENDOR_BINARIES}" = "true" ]]; then # Ensure directory is there for Deno echo "Bootstrapping Deno..." - rm -rf "$QUARTO_DIST_PATH" + # CI sets QUARTO_SKIP_DENO_CACHE_WIPE=1 so the restored deno_cache survives + # (matches the gate used by package/scripts/vendoring/vendor.sh). + if [ "${QUARTO_SKIP_DENO_CACHE_WIPE}" != "1" ]; then + rm -rf "$QUARTO_DIST_PATH" + fi ## Binary Directory mkdir -p "$QUARTO_BIN_PATH/tools"