Skip to content

Commit cc16106

Browse files
committed
fix: render work folders beside the output also avoid mkdtemp on deep Windows paths
1 parent 9e12ccc commit cc16106

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎packages/core/src/noBareMkdtemp.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const ALLOWED = new Set([
1313
"cli/src/media-use/lib/lut-preset-provider.mjs",
1414
"producer/src/server.ts",
1515
"producer/src/regression-harness.ts",
16-
"producer/src/services/render/renderDirOwner.ts",
1716
"aws-lambda/src/s3PlanV2Publisher.ts",
1817
"gcp-cloud-run/src/gcsPlanV2Publisher.ts",
1918
]);

‎packages/producer/src/services/render/renderDirOwner.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import {
22
existsSync,
33
lstatSync,
4-
mkdtempSync,
54
readFileSync,
65
readdirSync,
76
readlinkSync,
87
rmSync,
98
writeFileSync,
109
} from "node:fs";
1110
import { hostname, uptime } from "node:os";
12-
import { dirname, join } from "node:path";
11+
import { basename, dirname, join } from "node:path";
1312
import { RENDER_TEMP_DIR } from "@hyperframes/core/project-folders";
13+
import { createStagingDir } from "@hyperframes/core/atomic-file";
1414

1515
const OWNER_FILE = "owner.json";
1616
/** Where a staging dir parks the previous output while swapping in the new one. */
@@ -42,7 +42,7 @@ function pidScope(): { host: string; boot?: string; pidns?: string } {
4242

4343
/** A render's private temp dir, stamped with the process that owns it so a later sweep can tell it was abandoned. */
4444
export function createOwnedRenderDir(prefix: string): string {
45-
const dir = mkdtempSync(prefix);
45+
const dir = createStagingDir(dirname(prefix), basename(prefix));
4646
const owner = { pid: process.pid, ...pidScope() };
4747
writeFileSync(join(dir, OWNER_FILE), JSON.stringify(owner));
4848
return dir;

0 commit comments

Comments
 (0)