Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions scripts/build-desktop-artifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,24 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
assert.deepStrictEqual(result.unpackedFiles, ["node_modules/native/addon.node"]);
assert.isBelow(result.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT);
assert.deepStrictEqual(secondAsar, firstAsar);

const cacheDir = path.join(fixture.packagedAppDir, "resources", "server-compile-cache");
yield* fs.makeDirectory(cacheDir, { recursive: true });
for (let index = result.fileCount; index < 99; index++) {
yield* fs.writeFileString(path.join(cacheDir, String(index)), "prepared bytecode");
}
const validate = validateWindowsPackagedPayload({
stageDistDir: fixture.stageDistDir,
appExecutableName: fixture.appExecutableName,
targetArch: "x64",
appVersion: WINDOWS_PAYLOAD_FIXTURE_VERSION,
});
assert.equal((yield* validate).fileCount, 99);
yield* fs.writeFileString(path.join(cacheDir, "unexpected"), "extra file");
const error = yield* validate.pipe(Effect.flip);
assert.instanceOf(error, WindowsPackagedPayloadValidationError);
assert.equal(error.reason, "file-limit-exceeded");
assert.equal(error.fileCount, 100);
}),
).pipe(Effect.provideService(HostProcess.Platform, "linux")),
);
Expand Down
3 changes: 2 additions & 1 deletion scripts/build-desktop-artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,8 @@ export function resolveWindowsServerAsarIgnoreGlobs(arch: typeof BuildArch.Type)
];
}

export const WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT = 96;
// The Windows release has 76 runtime files plus 22 prepared server cache entries and their manifest.
export const WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT = 99;
export const WINDOWS_SERVER_RESOURCE_SOURCE_DIR = "apps/desktop/prod-resources/windows-server";
export const WINDOWS_SERVER_EXTRA_RESOURCES = [
{
Expand Down
Loading