The best way to control Claude Code, Codex and more from any computer or phone
test(scripts): keep Windows packaging checks host-portable (#9589)
Co-authored-by: Claude Code <noreply@anthropic.com>
Julius Marminge committed
Sep 4, 2026 at 13:33 UTC
0a590fa01af66ec135d2ebf2d5542b08a37dc275
2 files changed
+29
-20
scripts/build-desktop-artifact.test.ts
+9
-5
@@ -1040,6 +1040,9 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1040
),
1041
);
1042
1043
+ // The fixture's t3code.exe is a text placeholder, not an executable. These
1044
+ // cases reach the native-load probe, so pin only that host-platform check to
1045
+ // Linux. Host-native paths and the real Windows tar/archive checks still run.
1046
it.effect("validates every ASAR-unpacked native in the packaged Windows payload", () =>
1047
Effect.scoped(
1048
Effect.gen(function* () {
@@ -1068,7 +1071,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1071
assert.isBelow(result.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT);
1072
assert.deepStrictEqual(secondAsar, firstAsar);
1073
}),
1071
- ),
1074
+ ).pipe(Effect.provideService(HostProcessPlatform, "linux")),
1075
);
1076
1077
it.effect("validates the emitted WSL archive and its SHA-256 sidecar", () =>
@@ -1087,7 +1090,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1090
1091
assert.equal(result.packagedAppDir, fixture.packagedAppDir);
1092
}),
1090
- ),
1093
+ ).pipe(Effect.provideService(HostProcessPlatform, "linux")),
1094
);
1095
1096
it.effect("rejects a Windows package missing its expected WSL runtime", () =>
@@ -1235,11 +1238,12 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1238
command.args.some((arg) => arg.endsWith("build-browser-secret.mjs")),
1239
);
1240
assert.isDefined(helper);
1241
+ const path = yield* Path.Path;
1242
assert.deepStrictEqual(helper.args.slice(-4), [
1243
"--arch",
1244
"x64",
1245
"--output",
1242
- "/stage/resources/browser-secret/t3-browser-secret",
1246
+ path.join("/stage/resources", "browser-secret", "t3-browser-secret"),
1247
]);
1248
}).pipe(
1249
Effect.provide(
@@ -1461,7 +1465,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1465
assert.instanceOf(error, BundleNotSelfContainedError);
1466
assert.include(error.output, "t3code-deliberately-missing-package");
1467
}),
1464
- ),
1468
+ ).pipe(Effect.provideService(HostProcessPlatform, "linux")),
1469
);
1470
1471
it.effect("preserves both Linux icon resize failures with structural context", () => {
@@ -1701,7 +1705,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1705
assert.equal(config.appId, "com.t3tools.t3code");
1706
assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");
1707
assert.equal(mac.provisioningProfile, "/tmp/t3code.provisionprofile");
1704
- assert.match(String(mac.sign), /\/scripts\/sign-macos\.ts$/);
1708
+ assert.match(String(mac.sign), /[\\/]scripts[\\/]sign-macos\.ts$/);
1709
assert.deepStrictEqual(mac.protocols, [
1710
{ name: "T3 Code", schemes: ["t3code", "t3code-dev"] },
1711
]);
scripts/lib/cli-external-packages.test.ts
+20
-15
@@ -153,21 +153,26 @@ it.layer(NodeServices.layer)("external package dependency closure", (it) => {
153
const isRuntimeExternal = (name: string) =>
154
CLI_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => name.startsWith(prefix));
155
156
- it.effect("finds the runtime-external packages on disk", () =>
157
- Effect.gen(function* () {
158
- const installed = yield* readInstalledPackages;
159
- const found = [...installed.keys()].filter(isRuntimeExternal);
160
-
161
- // Without this the closure check below can pass vacuously: if nothing is
162
- // read, nothing is checked. These are the packages whose closure actually
163
- // broke WSL, so require them by name.
164
- for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
165
- assert.ok(
166
- found.includes(required),
167
- `expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,
168
- );
169
- }
170
- }),
156
+ // A cold walk of the pnpm store can exceed the root timeout when the Windows
157
+ // lane runs four filesystem-heavy workspace suites at once.
158
+ it.effect(
159
+ "finds the runtime-external packages on disk",
160
+ () =>
161
+ Effect.gen(function* () {
162
+ const installed = yield* readInstalledPackages;
163
+ const found = [...installed.keys()].filter(isRuntimeExternal);
164
+
165
+ // Without this the closure check below can pass vacuously: if nothing is
166
+ // read, nothing is checked. These are the packages whose closure actually
167
+ // broke WSL, so require them by name.
168
+ for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
169
+ assert.ok(
170
+ found.includes(required),
171
+ `expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,
172
+ );
173
+ }
174
+ }),
175
+ 120_000,
176
);
177
178
it.effect("keeps every runtime dependency of an external package external too", () =>