@@ -436,21 +436,55 @@ def INSTALLER_BINARY(self, no_cache: bool = False):
436436 if loaded is not None :
437437 return loaded
438438
439- local_installer = (
440- self ._installer_provider_root ()
441- / "node_modules"
442- / ".bin"
443- / str (
444- self .INSTALLER_BIN ,
445- )
446- )
447- if local_installer .is_file () and os .access (local_installer , os .X_OK ):
448- loaded = self ._load_installer_at (local_installer , no_cache = no_cache )
449- if loaded is not None :
450- return loaded
439+ from .binprovider_npm import NpmProvider
451440
452- loaded = self ._install_installer_binary (no_cache = no_cache )
453- return loaded
441+ installer_root = self ._installer_provider_root ()
442+ node_loaded = self ._cache_node_dependency (no_cache = no_cache )
443+ pnpm_package = self ._pnpm_package_for_node (
444+ node_loaded .loaded_version if node_loaded is not None else None ,
445+ )
446+ installer_provider = NpmProvider (
447+ install_root = installer_root ,
448+ postinstall_scripts = True ,
449+ min_release_age = 0 ,
450+ ).get_provider_with_overrides (
451+ overrides = {"pnpm" : {"install_args" : [pnpm_package ]}},
452+ )
453+ with installer_provider .mutation_lock ():
454+ local_installer = (
455+ installer_root
456+ / "node_modules"
457+ / ".bin"
458+ / str (
459+ self .INSTALLER_BIN ,
460+ )
461+ )
462+ if local_installer .is_file () and os .access (local_installer , os .X_OK ):
463+ loaded = installer_provider .load (
464+ self .INSTALLER_BIN ,
465+ quiet = True ,
466+ no_cache = True ,
467+ )
468+ if loaded and loaded .loaded_abspath :
469+ if loaded .loaded_version and loaded .loaded_sha256 :
470+ self .write_cached_binary (
471+ self .INSTALLER_BIN ,
472+ loaded .loaded_abspath ,
473+ loaded .loaded_version ,
474+ loaded .loaded_sha256 ,
475+ resolved_provider_name = (
476+ loaded .loaded_binprovider .name
477+ if loaded .loaded_binprovider is not None
478+ else self .name
479+ ),
480+ resolved_provider = loaded .loaded_binprovider ,
481+ cache_kind = "dependency" ,
482+ )
483+ self ._INSTALLER_BINARY = loaded
484+ self ._cache_node_dependency (no_cache = no_cache )
485+ return loaded
486+
487+ return self ._install_installer_binary (no_cache = no_cache )
454488
455489 @log_method_call (include_result = True )
456490 def exec (
0 commit comments