fix(desktop): skip cached monitor compiler check (#9184)
This commit is contained in:
1 parent
827345a07a
commit
7a8df3338f
3 files changed
+56
-10
No files matched your search
@@ -144,6 +144,8 @@ rustup target add aarch64-pc-windows-msvc
|
||||
|
||||
Windows supplies `tar.exe`; it is checked when `--wsl-prebuild` makes the artifact include the WSL
|
||||
runtime. NSIS is downloaded by electron-builder and does not need a separate installation.
|
||||
When `T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR=true` points the build at an existing resource monitor,
|
||||
the artifact script skips the Rust and Visual Studio checks because it does not compile the monitor.
|
||||
Unsigned local builds need no Azure credentials. Builds using `--signed` additionally require the
|
||||
Azure Trusted Signing configuration described below.
|
||||
|
||||
|
||||
@@ -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* () {
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user