From ec720bf28d04bb5eadafaea5607832428d92d9d5 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Tue, 10 Mar 2020 10:35:20 -0700 Subject: bugfix: fix install_missing_compilers option bug from v0.14.0 (#15416) * bugfix: ensure bootstrapped compilers built before packages using the compiler --- lib/spack/spack/installer.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py index 4e8ec39733..a9965c9114 100644 --- a/lib/spack/spack/installer.py +++ b/lib/spack/spack/installer.py @@ -181,6 +181,9 @@ def _packages_needed_to_bootstrap_compiler(pkg): # concrete CompilerSpec has less info than concrete Spec # concretize as Spec to add that information dep.concretize() + # mark compiler as depended-on by the package that uses it + dep._dependents[pkg.name] = spack.spec.DependencySpec( + pkg.spec, dep, ('build',)) packages = [(s.package, False) for s in dep.traverse(order='post', root=False)] packages.append((dep.package, True)) @@ -1610,6 +1613,21 @@ class BuildTask(object): self.spec.dependencies() if package_id(d.package) != self.pkg_id) + # Handle bootstrapped compiler + # + # The bootstrapped compiler is not a dependency in the spec, but it is + # a dependency of the build task. Here we add it to self.dependencies + compiler_spec = self.spec.compiler + arch_spec = self.spec.architecture + if not spack.compilers.compilers_for_spec(compiler_spec, + arch_spec=arch_spec): + # The compiler is in the queue, identify it as dependency + dep = spack.compilers.pkg_spec_for_compiler(compiler_spec) + dep.architecture = arch_spec + dep.concretize() + dep_id = package_id(dep.package) + self.dependencies.add(dep_id) + # List of uninstalled dependencies, which is used to establish # the priority of the build task. # -- cgit v1.2.3-70-g09d2