summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-03-10 10:35:20 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2020-03-20 11:44:59 -0700
commitec720bf28d04bb5eadafaea5607832428d92d9d5 (patch)
tree4fa1caf69226469430965dda3511b566e1bc888e
parent1e42f0a54589d73fab367de4389aa3318c087af0 (diff)
downloadspack-ec720bf28d04bb5eadafaea5607832428d92d9d5.tar.gz
spack-ec720bf28d04bb5eadafaea5607832428d92d9d5.tar.bz2
spack-ec720bf28d04bb5eadafaea5607832428d92d9d5.tar.xz
spack-ec720bf28d04bb5eadafaea5607832428d92d9d5.zip
bugfix: fix install_missing_compilers option bug from v0.14.0 (#15416)
* bugfix: ensure bootstrapped compilers built before packages using the compiler
-rw-r--r--lib/spack/spack/installer.py18
1 files changed, 18 insertions, 0 deletions
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.
#