diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-07-14 20:16:45 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-07-14 20:23:27 +0900 |
commit | 5ab0aa9b72b4d5a950a3e6f0f50e6ed5d2d50012 (patch) | |
tree | 1168ad5730bb5540977e4e9582339d1e224b4ef0 | |
parent | c13024b4ae801dbbf2d2106ff1c7850edc675722 (diff) | |
download | buildstream-5ab0aa9b72b4d5a950a3e6f0f50e6ed5d2d50012.tar.gz |
_project.py: Use the user specified max-jobs
Only use automatic max-jobs by default if the user has not
requested a specific value for max-jobs.
This is a part of #1033
-rw-r--r-- | buildstream/_project.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py index c9325174d..1660c4770 100644 --- a/buildstream/_project.py +++ b/buildstream/_project.py @@ -591,7 +591,12 @@ class Project(): # Based on some testing (mainly on AWS), maximum effective # max-jobs value seems to be around 8-10 if we have enough cores # users should set values based on workload and build infrastructure - output.base_variables['max-jobs'] = str(min(len(os.sched_getaffinity(0)), 8)) + if self._context.build_max_jobs == 0: + # User requested automatic max-jobs + output.base_variables['max-jobs'] = str(min(len(os.sched_getaffinity(0)), 8)) + else: + # User requested explicit max-jobs setting + output.base_variables['max-jobs'] = str(self._context.build_max_jobs) # Export options into variables, if that was requested output.options.export_variables(output.base_variables) |