diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2021-05-04 09:53:30 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-04 18:46:05 +0000 |
commit | 0b620c24c55859f325ce23daa90b3c1c55bc76cb (patch) | |
tree | bf8433cead65d063f2277322315d62084c3324e3 /site_scons | |
parent | e33ea913e252228b4b6a158b74bdab2c1a301f1e (diff) | |
download | mongo-0b620c24c55859f325ce23daa90b3c1c55bc76cb.tar.gz |
SERVER-56623 make icecream guard from hanging system on large -j
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/next/ninja.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/site_scons/site_tools/next/ninja.py b/site_scons/site_tools/next/ninja.py index 2af826898ab..21742e31629 100644 --- a/site_scons/site_tools/next/ninja.py +++ b/site_scons/site_tools/next/ninja.py @@ -574,10 +574,10 @@ class NinjaState: "restat": 1, }, } - + num_jobs = self.env.get('NINJA_MAX_JOBS', self.env.GetOption("num_jobs")) self.pools = { - "local_pool": self.env.GetOption("num_jobs"), - "install_pool": self.env.GetOption("num_jobs") / 2, + "local_pool": num_jobs, + "install_pool": num_jobs / 2, "scons_pool": 1, } @@ -643,12 +643,14 @@ class NinjaState: ninja.variable("builddir", get_path(self.env['NINJA_BUILDDIR'])) for pool_name, size in self.pools.items(): - ninja.pool(pool_name, size) + ninja.pool(pool_name, min(self.env.get('NINJA_MAX_JOBS', size), size)) for var, val in self.variables.items(): ninja.variable(var, val) for rule, kwargs in self.rules.items(): + if self.env.get('NINJA_MAX_JOBS') is not None and 'pool' not in kwargs: + kwargs['pool'] = 'local_pool' ninja.rule(rule, **kwargs) generated_source_files = sorted({ |