Skip to content

Commit 8b184cb

Browse files
authored
[backport] Fix Dart Sass failing in enterprise Windows with Group Policy restrictions (#14369)
* Fall back to direct sass.bat execution when safeWindowsExec fails Enterprise Windows environments with Group Policy / AppLocker rules that block .bat execution from %TEMP% cause the safeWindowsExec temp wrapper to fail, breaking dart-sass invocation (regression from #14002). Try safeWindowsExec first (handles spaces in paths), then fall back to direct execProcess call (v1.8 behavior) when it fails. Fixes #14367 * Add changelog entry for #14367
1 parent e541ca7 commit 8b184cb

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

news/changelog-1.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## In this release
44

55
- ([#14304](https://github.com/quarto-dev/quarto-cli/issues/14304)): Fix `quarto install tinytex` silently ignoring extraction failures. When archive extraction fails (e.g., `.tar.xz` on a system without `xz-utils`), the installer now reports a clear error instead of proceeding and failing with a confusing `NotFound` message.
6+
- ([#14367](https://github.com/quarto-dev/quarto-cli/issues/14367)): Fix Dart Sass invocation failing on enterprise Windows systems where Group Policy blocks `.bat` execution from `%TEMP%`. When the `safeWindowsExec` temp wrapper is blocked, Quarto now falls back to calling `sass.bat` directly.
67

78
## In previous releases
89

src/core/dart-sass.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,22 @@ export async function dartCommand(
125125
});
126126
},
127127
);
128-
return processResult(result);
128+
if (result.success) {
129+
return processResult(result);
130+
}
131+
132+
// safeWindowsExec failed — fall back to direct execution (v1.8 behavior).
133+
// Enterprise environments may block .bat execution from %TEMP% via
134+
// Group Policy / AppLocker, causing the temp wrapper to fail.
135+
// See https://github.com/quarto-dev/quarto-cli/issues/14367
136+
debug("[DART] safeWindowsExec failed, falling back to direct execution");
137+
const directResult = await execProcess({
138+
cmd: sass,
139+
args,
140+
stdout: "piped",
141+
stderr: "piped",
142+
});
143+
return processResult(directResult);
129144
}
130145

131146
// Non-Windows: direct execution

0 commit comments

Comments
 (0)