@@ -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