Preserve jobserver file descriptors into build environment (#30302)

This ensures that multiple spack instances called from `make` will respect the maximum number of jobs in the POSIX jobserver across packages.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
Tom Scogland
2022-05-05 21:09:58 -07:00
committed by GitHub
parent 3137e7c61b
commit d3a0ac1c0a
3 changed files with 33 additions and 14 deletions

View File

@@ -281,10 +281,10 @@ def bootstrap_args(self):
self.generator = make
if not sys.platform == 'win32':
args.extend(
['--prefix={0}'.format(self.prefix),
'--parallel={0}'.format(make_jobs)]
)
args.append('--prefix={0}'.format(self.prefix))
if spack.build_environment.should_set_parallel_jobs(jobserver_support=True):
args.append('--parallel={0}'.format(make_jobs))
if '+ownlibs' in spec:
# Build and link to the CMake-provided third-party libraries