Skip to content

Commit 025d9f1

Browse files
committed
test: keep Bun registry cache off the Windows Dev Drive
1 parent b1c17ad commit 025d9f1

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/tools/src/local-npm-registry.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ function buildRegistryEnv(registry: string): Record<string, string> {
539539
const noProxy = [process.env.NO_PROXY ?? process.env.no_proxy, '127.0.0.1']
540540
.filter(Boolean)
541541
.join(',');
542+
// Windows snapshot jobs put TEMP on a ReFS Dev Drive, where Bun's
543+
// cache/temp renames can fail with ENOTSUP. Keep its throwaway cache in
544+
// the user profile and its temporary files on the same filesystem.
545+
const bunCacheRoot = process.platform === 'win32' ? homedir() : tmpdir();
546+
const bunCacheDir = mkdtempSync(path.join(bunCacheRoot, 'vp-local-registry-bun-'));
542547
return {
543548
NPM_CONFIG_REGISTRY: registry,
544549
npm_config_registry: registry,
@@ -550,7 +555,8 @@ function buildRegistryEnv(registry: string): Record<string, string> {
550555
NPM_CONFIG_NOPROXY: noProxy,
551556
npm_config_noproxy: noProxy,
552557
YARN_GLOBAL_FOLDER: mkdtempSync(path.join(tmpdir(), 'vp-local-registry-yarn-')),
553-
BUN_INSTALL_CACHE_DIR: mkdtempSync(path.join(tmpdir(), 'vp-local-registry-bun-')),
558+
BUN_INSTALL_CACHE_DIR: bunCacheDir,
559+
BUN_TMPDIR: path.join(bunCacheDir, '.tmp'),
554560
};
555561
}
556562

0 commit comments

Comments
 (0)