File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ const { linkPackages } =
1010const PREFER_OFFLINE = process . env . NEXT_TEST_PREFER_OFFLINE === '1'
1111const useRspack = process . env . NEXT_TEST_USE_RSPACK === '1'
1212
13+ function createTempId ( ) {
14+ // Windows path length limits can cause Turbopack to fail resolving packages
15+ // from very deep pnpm virtual-store paths. Keep temp folder names short.
16+ const bytes = process . platform === 'win32' ? 16 : 32
17+ return randomBytes ( bytes ) . toString ( 'hex' )
18+ }
19+
1320async function installDependencies ( cwd , tmpDir ) {
1421 const args = [
1522 'install' ,
@@ -62,7 +69,7 @@ async function createNextInstall({
6269 const origRepoDir = path . join ( __dirname , '../../' )
6370 const installDir = path . join (
6471 tmpDir ,
65- `next-install-${ randomBytes ( 32 ) . toString ( 'hex' ) } ` ,
72+ `next-install-${ createTempId ( ) } ` ,
6673 subDir
6774 )
6875 let tmpRepoDir
@@ -78,7 +85,7 @@ async function createNextInstall({
7885 } else {
7986 tmpRepoDir = path . join (
8087 tmpDir ,
81- `next-repo-${ randomBytes ( 32 ) . toString ( 'hex' ) } ` ,
88+ `next-repo-${ createTempId ( ) } ` ,
8289 subDir
8390 )
8491 require ( 'console' ) . log ( 'Creating temp repo dir' , tmpRepoDir )
You can’t perform that action at this time.
0 commit comments