Skip to content

Commit d598bb0

Browse files
FE-881: use junctions for Windows directory links
Pass a directory link type when sharing node_modules on Windows so lazy slice seeding can link folder targets reliably. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b1800a4 commit d598bb0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/orchestrator/src/cow-copy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { spawnSync } from 'node:child_process';
2-
import { cpSync, existsSync, readdirSync, symlinkSync } from 'node:fs';
2+
import { cpSync, existsSync, lstatSync, readdirSync, symlinkSync } from 'node:fs';
33
import { join, resolve } from 'node:path';
44

55
/**
@@ -50,7 +50,11 @@ export function copyMissingTopLevelEntries(
5050
if (existsSync(destPath)) continue;
5151
const sourcePath = join(source, entry);
5252
if (symlink.has(entry)) {
53-
symlinkSync(sourcePath, destPath);
53+
symlinkSync(
54+
sourcePath,
55+
destPath,
56+
process.platform === 'win32' && lstatSync(sourcePath).isDirectory() ? 'junction' : undefined,
57+
);
5458
} else {
5559
cowCopy(sourcePath, destPath);
5660
}

0 commit comments

Comments
 (0)