diff --git a/lib/spack/spack/detection/common.py b/lib/spack/spack/detection/common.py index 6fba021b33..b8da6d9a20 100644 --- a/lib/spack/spack/detection/common.py +++ b/lib/spack/spack/detection/common.py @@ -309,10 +309,14 @@ def find_windows_kit_roots() -> List[str]: return glob.glob(kit_base) @staticmethod - def find_windows_kit_bin_paths(kit_base: Optional[str] = None) -> List[str]: + def find_windows_kit_bin_paths( + kit_base: Union[Optional[str], Optional[list]] = None + ) -> List[str]: """Returns Windows kit bin directory per version""" kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base assert kit_base, "Unexpectedly empty value for Windows kit base path" + if isinstance(kit_base, str): + kit_base = kit_base.split(";") kit_paths = [] for kit in kit_base: kit_bin = os.path.join(kit, "bin") @@ -320,10 +324,14 @@ def find_windows_kit_bin_paths(kit_base: Optional[str] = None) -> List[str]: return kit_paths @staticmethod - def find_windows_kit_lib_paths(kit_base: Optional[str] = None) -> List[str]: + def find_windows_kit_lib_paths( + kit_base: Union[Optional[str], Optional[list]] = None + ) -> List[str]: """Returns Windows kit lib directory per version""" kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base assert kit_base, "Unexpectedly empty value for Windows kit base path" + if isinstance(kit_base, str): + kit_base = kit_base.split(";") kit_paths = [] for kit in kit_base: kit_lib = os.path.join(kit, "Lib") diff --git a/var/spack/repos/builtin/packages/win-wdk/package.py b/var/spack/repos/builtin/packages/win-wdk/package.py index 07f2a59018..759c5f53c0 100644 --- a/var/spack/repos/builtin/packages/win-wdk/package.py +++ b/var/spack/repos/builtin/packages/win-wdk/package.py @@ -133,7 +133,7 @@ def install(self, spec, prefix): except ProcessError as pe: reg = winreg.WindowsRegistryView( "SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", - root_key=spack.util.windows_registry.HKEY_LOCAL_MACHINE, + root_key=spack.util.windows_registry.HKEY.HKEY_LOCAL_MACHINE, ) if not reg: # No Kits are available, failure was genuine