Extend compiler find search paths for Windows

This commit is contained in:
Massimiliano Culpo 2024-06-05 21:51:18 +02:00
parent 8f38ca4b6b
commit e59c64ca20
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C

View File

@ -8,6 +8,7 @@
""" """
import collections import collections
import os import os
import sys
import warnings import warnings
from typing import Dict, List, Optional from typing import Dict, List, Optional
@ -20,11 +21,11 @@
import spack.compiler import spack.compiler
import spack.config import spack.config
import spack.error import spack.error
import spack.operating_systems
import spack.paths import spack.paths
import spack.platforms import spack.platforms
import spack.spec import spack.spec
import spack.version import spack.version
from spack.operating_systems import windows_os
from spack.util.environment import get_path from spack.util.environment import get_path
from spack.util.naming import mod_to_class from spack.util.naming import mod_to_class
@ -287,6 +288,8 @@ def find_compilers(
if path_hints is None: if path_hints is None:
path_hints = get_path("PATH") path_hints = get_path("PATH")
default_paths = fs.search_paths_for_executables(*path_hints) default_paths = fs.search_paths_for_executables(*path_hints)
if sys.platform == "win32":
default_paths.extend(windows_os.WindowsOs().compiler_search_paths)
compiler_pkgs = spack.repo.PATH.packages_with_tags(COMPILER_TAG, full=True) compiler_pkgs = spack.repo.PATH.packages_with_tags(COMPILER_TAG, full=True)
detected_packages = spack.detection.by_path( detected_packages = spack.detection.by_path(
compiler_pkgs, path_hints=default_paths, max_workers=max_workers compiler_pkgs, path_hints=default_paths, max_workers=max_workers