diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py index ddeed417132..4c5078ba6bd 100644 --- a/lib/spack/spack/cmd/compiler.py +++ b/lib/spack/spack/cmd/compiler.py @@ -79,7 +79,7 @@ def compiler_find(args): # Just let compiler_find do the # entire process and return an empty config from all_compilers # Default for any other process is init_config=True - compilers = [c for c in spack.compilers.find_compilers(*paths)] + compilers = [c for c in spack.compilers.find_compilers(paths)] new_compilers = [] for c in compilers: arch_spec = ArchSpec(None, c.operating_system, c.target) diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index e7a7f1d5895..bb0e431b5e7 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -185,19 +185,19 @@ def all_compiler_specs(scope=None, init_config=True): for s in all_compilers_config(scope, init_config)] -def find_compilers(*path_hints): +def find_compilers(path_hints=None): """Returns the list of compilers found in the paths given as arguments. Args: - *path_hints: list of path hints where to look for. If none is - given a sensible default based on the ``PATH`` environment - variable will be used + path_hints (list or None): list of path hints where to look for. + A sensible default based on the ``PATH`` environment variable + will be used if the value is None Returns: List of compilers found """ - # Turn the path hints into real paths that are to be searched - path_hints = path_hints or get_path('PATH') + if path_hints is None: + path_hints = get_path('PATH') default_paths = fs.search_paths_for_executables(*path_hints) # To detect the version of the compilers, we dispatch a certain number diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 4cca72c6cfb..fd580376df1 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1385,7 +1385,7 @@ def bootstrap_compiler(self, **kwargs): dep.concretize() dep.package.do_install(**kwargs) spack.compilers.add_compilers_to_config( - spack.compilers.find_compilers(dep.prefix) + spack.compilers.find_compilers([dep.prefix]) ) def do_install(self, **kwargs):