fix(desktop): skip cached monitor compiler check (#9184)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-02 00:36:07 -07:00
1 parent 827345a07a
commit 7a8df3338f
3 files changed
+56 -10

No files matched your search

+42
View File
@@ -930,6 +930,48 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
),
);
it.effect("does not require MSVC when reusing a prebuilt Windows resource monitor", () =>
Effect.scoped(
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-windows-preflight-" });
const pythonPath = path.join(tempDir, "python.exe");
yield* fs.writeFileString(pythonPath, "python");
const commands: string[] = [];
const spawner = Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
ChildProcessSpawner.make((command) => {
const childProcess = command as unknown as { readonly command: string };
commands.push(childProcess.command);
return Effect.succeed(mockProcess(childProcess.command === "powershell.exe" ? 1 : 0));
}),
);
yield* preflightWindowsDesktopBuild({
arch: "x64",
bundlesWslRuntime: true,
}).pipe(
Effect.provide(
Layer.merge(
spawner,
ConfigProvider.layer(
ConfigProvider.fromEnv({
env: {
npm_config_python: pythonPath,
T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: "true",
},
}),
),
),
),
);
assert.notInclude(commands, "powershell.exe");
}),
),
);
it.effect("rejects a PATH-discovered Python executable that is not Python 3", () =>
Effect.scoped(
Effect.gen(function* () {
+12 -10
View File
@@ -1730,16 +1730,18 @@ export const preflightWindowsDesktopBuild = Effect.fn("preflightWindowsDesktopBu
rustTargetIsInstalled(rustTarget),
]).pipe(Effect.map(([cargo, target]) => cargo && target)),
python: Effect.succeed(python !== undefined),
msvc: desktopBuildProbeSucceeds(
ChildProcess.make("powershell.exe", [
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-Command",
windowsVswherePrerequisiteScript(input.arch),
]),
"Visual Studio Build Tools",
),
msvc: reuseResourceMonitor
? Effect.succeed(true)
: desktopBuildProbeSucceeds(
ChildProcess.make("powershell.exe", [
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-Command",
windowsVswherePrerequisiteScript(input.arch),
]),
"Visual Studio Build Tools",
),
tar: input.bundlesWslRuntime
? desktopBuildProbeSucceeds(ChildProcess.make("tar.exe", ["--version"]), "tar")
: Effect.succeed(true),