calculate make_jobs in ninja (#32384)

This is in case ninja's setup_dependent_package is called before its
module is initialized by build_environment
This commit is contained in:
Tom Scogland 2022-08-26 02:37:53 -07:00 committed by GitHub
parent b31cd189a7
commit a2f0588004
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack.build_environment import MakeExecutable
from spack.build_environment import MakeExecutable, determine_number_of_jobs
from spack.package import *
from spack.util.executable import which_string
@ -74,6 +74,8 @@ def install(self, spec, prefix):
def setup_dependent_package(self, module, dspec):
name = "ninja"
module.ninja = MakeExecutable(
which_string(name, path=[self.spec.prefix.bin], required=True), module.make_jobs
which_string(name, path=[self.spec.prefix.bin], required=True),
determine_number_of_jobs(parallel=self.parallel),
)