Skip to content

Commit a2b1f78

Browse files
committed
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.
1 parent 8262be2 commit a2b1f78

2 files changed

Lines changed: 28 additions & 20 deletions

File tree

configure.cmd

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,31 @@ if NOT DEFINED QUARTO_VENDOR_BINARIES (
1515

1616
if "%QUARTO_VENDOR_BINARIES%" == "true" (
1717

18-
REM Windows-specific: Check if deno.exe is running before deleting package/dist
19-
REM Extracted to package/scripts/windows/check-deno-in-use.cmd for maintainability
20-
call package\scripts\windows\check-deno-in-use.cmd "!QUARTO_DIST_PATH!"
21-
if "!ERRORLEVEL!"=="1" exit /B 1
22-
23-
echo Removing package/dist/ directory...
24-
RMDIR /S /Q "!QUARTO_DIST_PATH!" 2>NUL
25-
26-
REM Fallback: Verify deletion succeeded (defense in depth)
27-
if exist "!QUARTO_DIST_PATH!" (
28-
echo.
29-
echo ============================================================
30-
echo Error: Could not delete package/dist/ directory
31-
echo This may be due to permissions, antivirus, or another process holding files
32-
echo ============================================================
33-
echo.
34-
echo Try closing applications and run configure.cmd again
35-
exit /B 1
18+
REM CI sets QUARTO_SKIP_DENO_CACHE_WIPE=1 so the restored deno_cache survives
19+
REM (matches the gate used by package\scripts\vendoring\vendor.cmd).
20+
IF NOT "!QUARTO_SKIP_DENO_CACHE_WIPE!"=="1" (
21+
REM Windows-specific: Check if deno.exe is running before deleting package/dist
22+
REM Extracted to package/scripts/windows/check-deno-in-use.cmd for maintainability
23+
call package\scripts\windows\check-deno-in-use.cmd "!QUARTO_DIST_PATH!"
24+
if "!ERRORLEVEL!"=="1" exit /B 1
25+
26+
echo Removing package/dist/ directory...
27+
RMDIR /S /Q "!QUARTO_DIST_PATH!" 2>NUL
28+
29+
REM Fallback: Verify deletion succeeded (defense in depth)
30+
if exist "!QUARTO_DIST_PATH!" (
31+
echo.
32+
echo ============================================================
33+
echo Error: Could not delete package/dist/ directory
34+
echo This may be due to permissions, antivirus, or another process holding files
35+
echo ============================================================
36+
echo.
37+
echo Try closing applications and run configure.cmd again
38+
exit /B 1
39+
)
3640
)
3741

38-
MKDIR !QUARTO_BIN_PATH!\tools
42+
IF NOT EXIST "!QUARTO_BIN_PATH!\tools" MKDIR !QUARTO_BIN_PATH!\tools
3943
PUSHD !QUARTO_BIN_PATH!\tools
4044

4145
ECHO Bootstrapping Deno...

configure.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ if [[ "${QUARTO_VENDOR_BINARIES}" = "true" ]]; then
3737
# Ensure directory is there for Deno
3838
echo "Bootstrapping Deno..."
3939

40-
rm -rf "$QUARTO_DIST_PATH"
40+
# CI sets QUARTO_SKIP_DENO_CACHE_WIPE=1 so the restored deno_cache survives
41+
# (matches the gate used by package/scripts/vendoring/vendor.sh).
42+
if [ "${QUARTO_SKIP_DENO_CACHE_WIPE}" != "1" ]; then
43+
rm -rf "$QUARTO_DIST_PATH"
44+
fi
4145

4246
## Binary Directory
4347
mkdir -p "$QUARTO_BIN_PATH/tools"

0 commit comments

Comments
 (0)