Unified · Split
| @@ -144,6 +144,8 @@ rustup target add aarch64-pc-windows-msvc · 143 unmodified lines | ||
| 144 | 144 | |
| 145 | 145 | Windows supplies `tar.exe`; it is checked when `--wsl-prebuild` makes the artifact include the WSL |
| 146 | 146 | runtime. NSIS is downloaded by electron-builder and does not need a separate installation. |
| 147 | +When `T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR=true` points the build at an existing resource monitor, | |
| 148 | +the artifact script skips the Rust and Visual Studio checks because it does not compile the monitor. | |
| 147 | 149 | Unsigned local builds need no Azure credentials. Builds using `--signed` additionally require the |
| 148 | 150 | Azure Trusted Signing configuration described below. |
| 149 | 151 | |
| @@ -930,6 +930,48 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => { · 929 unmodified lines | ||
| 930 | 930 | ), |
| 931 | 931 | ); |
| 932 | 932 | |
| 933 | + it.effect("does not require MSVC when reusing a prebuilt Windows resource monitor", () => | |
| 934 | + Effect.scoped( | |
| 935 | + Effect.gen(function* () { | |
| 936 | + const fs = yield* FileSystem.FileSystem; | |
| 937 | + const path = yield* Path.Path; | |
| 938 | + const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-windows-preflight-" }); | |
| 939 | + const pythonPath = path.join(tempDir, "python.exe"); | |
| 940 | + yield* fs.writeFileString(pythonPath, "python"); | |
| 941 | + const commands: string[] = []; | |
| 942 | + const spawner = Layer.succeed( | |
| 943 | + ChildProcessSpawner.ChildProcessSpawner, | |
| 944 | + ChildProcessSpawner.make((command) => { | |
| 945 | + const childProcess = command as unknown as { readonly command: string }; | |
| 946 | + commands.push(childProcess.command); | |
| 947 | + return Effect.succeed(mockProcess(childProcess.command === "powershell.exe" ? 1 : 0)); | |
| 948 | + }), | |
| 949 | + ); | |
| 950 | + | |
| 951 | + yield* preflightWindowsDesktopBuild({ | |
| 952 | + arch: "x64", | |
| 953 | + bundlesWslRuntime: true, | |
| 954 | + }).pipe( | |
| 955 | + Effect.provide( | |
| 956 | + Layer.merge( | |
| 957 | + spawner, | |
| 958 | + ConfigProvider.layer( | |
| 959 | + ConfigProvider.fromEnv({ | |
| 960 | + env: { | |
| 961 | + npm_config_python: pythonPath, | |
| 962 | + T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: "true", | |
| 963 | + }, | |
| 964 | + }), | |
| 965 | + ), | |
| 966 | + ), | |
| 967 | + ), | |
| 968 | + ); | |
| 969 | + | |
| 970 | + assert.notInclude(commands, "powershell.exe"); | |
| 971 | + }), | |
| 972 | + ), | |
| 973 | + ); | |
| 974 | + | |
| 933 | 975 | it.effect("rejects a PATH-discovered Python executable that is not Python 3", () => |
| 934 | 976 | Effect.scoped( |
| 935 | 977 | Effect.gen(function* () { |
| @@ -1730,16 +1730,18 @@ export const preflightWindowsDesktopBuild = Effect.fn("preflightWindowsDesktopBu · 1729 unmodified lines | ||
| 1730 | 1730 | rustTargetIsInstalled(rustTarget), |
| 1731 | 1731 | ]).pipe(Effect.map(([cargo, target]) => cargo && target)), |
| 1732 | 1732 | python: Effect.succeed(python !== undefined), |
| 1733 | − msvc: desktopBuildProbeSucceeds( | |
| 1734 | − ChildProcess.make("powershell.exe", [ | |
| 1735 | − "-NoLogo", | |
| 1736 | − "-NoProfile", | |
| 1737 | − "-NonInteractive", | |
| 1738 | − "-Command", | |
| 1739 | − windowsVswherePrerequisiteScript(input.arch), | |
| 1740 | − ]), | |
| 1741 | − "Visual Studio Build Tools", | |
| 1742 | − ), | |
| 1733 | + msvc: reuseResourceMonitor | |
| 1734 | + ? Effect.succeed(true) | |
| 1735 | + : desktopBuildProbeSucceeds( | |
| 1736 | + ChildProcess.make("powershell.exe", [ | |
| 1737 | + "-NoLogo", | |
| 1738 | + "-NoProfile", | |
| 1739 | + "-NonInteractive", | |
| 1740 | + "-Command", | |
| 1741 | + windowsVswherePrerequisiteScript(input.arch), | |
| 1742 | + ]), | |
| 1743 | + "Visual Studio Build Tools", | |
| 1744 | + ), | |
| 1743 | 1745 | tar: input.bundlesWslRuntime |
| 1744 | 1746 | ? desktopBuildProbeSucceeds(ChildProcess.make("tar.exe", ["--version"]), "tar") |
| 1745 | 1747 | : Effect.succeed(true), |