Skip to content

Commit fc9b82d

Browse files
committed
Test
1 parent 0695531 commit fc9b82d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/windows-testing/convert-symlinks.mjs

+4-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ async function transformDir(p) {
7575
} else {
7676
dereferenceFns.push(async () => {
7777
await fs.unlink(subPath);
78-
await fs.cp(realTarget, subPath, { recursive: true });
78+
// Note: NodeJS `fs.cp` can have issues when sources are readonly.
79+
await exec(`cp -R ${realTarget} ${subPath}`);
7980
});
8081
}
8182
} else if (file.isDirectory()) {
@@ -86,7 +87,7 @@ async function transformDir(p) {
8687
await Promise.all(directoriesToVisit.map((d) => transformDir(d)));
8788
}
8889

89-
function exec(cmd, maxRetries = 2) {
90+
function exec(cmd, maxRetries = 3) {
9091
return new Promise((resolve, reject) => {
9192
childProcess.exec(cmd, { cwd: rootDir }, (error) => {
9293
if (error !== null) {
@@ -119,7 +120,7 @@ try {
119120
// Re-link symlinks to work inside Windows.
120121
// This is done in batches to avoid flakiness due to WSL
121122
// See: https://github.com/microsoft/WSL/issues/8677.
122-
const batchSize = 100;
123+
const batchSize = 75;
123124
for (let i = 0; i < relinkFns.length; i += batchSize) {
124125
await Promise.all(relinkFns.slice(i, i + batchSize).map((fn) => fn()));
125126
}

0 commit comments

Comments
 (0)