Bugfix: Install missing compilers for dependency packages (#11175)
Compilers are treated separately from other dependencies in Spack. #10761 added the option to automatically install compilers when a package specifies using a compiler that is not available in Spack. However, this did not work correctly for dependency packages (it would only build a compiler for the root of an install DAG). This commit enables the building of compilers for dependency packages.
This commit is contained in:
parent
a49de9eb09
commit
5f74f22dc6
1 changed files with 8 additions and 9 deletions
|
@ -1441,17 +1441,16 @@ def do_install(self, **kwargs):
|
|||
dep_kwargs['explicit'] = False
|
||||
dep_kwargs['install_deps'] = False
|
||||
for dep in self.spec.traverse(order='post', root=False):
|
||||
if spack.config.get('config:install_missing_compilers', False):
|
||||
tty.debug('Bootstrapping {0} compiler for {1}'.format(
|
||||
self.spec.compiler, self.name
|
||||
))
|
||||
comp_kwargs = kwargs.copy()
|
||||
comp_kwargs['explicit'] = False
|
||||
comp_kwargs['install_deps'] = True
|
||||
dep.package.bootstrap_compiler(**comp_kwargs)
|
||||
dep.package.do_install(**dep_kwargs)
|
||||
|
||||
# Then, install the compiler if it is not already installed.
|
||||
if install_deps:
|
||||
tty.debug('Boostrapping {0} compiler for {1}'.format(
|
||||
self.spec.compiler, self.name
|
||||
))
|
||||
comp_kwargs = kwargs.copy()
|
||||
comp_kwargs['explicit'] = False
|
||||
self.bootstrap_compiler(**comp_kwargs)
|
||||
|
||||
# Then, install the package proper
|
||||
tty.msg(colorize('@*{Installing} @*g{%s}' % self.name))
|
||||
|
||||
|
|
Loading…
Reference in a new issue