Build checked workspace source in a sealed tenant-scoped VM

This commit is contained in:
Timothy J. Aveni
2026-10-06 21:16:21 -07:00
parent be8a19b5c5
commit 5c618e0e41
3 changed files with 21 additions and 1 deletions
+11 -1
View File
@@ -128,6 +128,7 @@ export async function buildImmutableCandidate(
log.once("open", () => resolve());
log.once("error", reject);
});
let logBytes = 0;
const run = async (executable: string, args: string[]) =>
await new Promise<string>((resolve, reject) => {
let output = "",
@@ -140,9 +141,18 @@ export async function buildImmutableCandidate(
};
log.on("error", failedLog);
child.stdout.on("data", (chunk) => {
output += chunk;
if (failure) return;
if (Buffer.byteLength(output) + chunk.length > 65536)
failedLog(new Error("Candidate checker output exceeds 64 KiB"));
else output += chunk;
});
child.stderr.on("data", (chunk) => {
if (failure) return;
logBytes += chunk.length;
if (logBytes > 16 * 1024 * 1024) {
failedLog(new Error("Candidate checker log exceeds 16 MiB"));
return;
}
log.write(chunk);
tail = (tail + String(chunk)).slice(-6000);
});