summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-07-14 19:14:05 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-07-16 12:18:13 +0900
commitc915c8b7c4f067346a03be597fd1451b2ceebc00 (patch)
tree1f0256fd8fce1270c5eeac92bbb421152d6a0f86
parentc068f54fc7fe694928239a6218fe6661a67a95a5 (diff)
downloadbuildstream-c915c8b7c4f067346a03be597fd1451b2ceebc00.tar.gz
_frontend: Added toplevel `--max-jobs` configuration
While this is currently only relevant for `bst build`, it is a current implementation detail that user configuration which gets overridden by command line options must use toplevel options. This patch allows invocations such as the following to override the max-jobs: bst --max-jobs 16 build target.bst This also updates the completions test to expect the new toplevel option. This is a part of #1033
-rw-r--r--src/buildstream/_frontend/app.py1
-rw-r--r--src/buildstream/_frontend/cli.py2
-rw-r--r--tests/frontend/completions.py1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/buildstream/_frontend/app.py b/src/buildstream/_frontend/app.py
index 0479b8c19..f04e9595e 100644
--- a/src/buildstream/_frontend/app.py
+++ b/src/buildstream/_frontend/app.py
@@ -191,6 +191,7 @@ class App():
'fetchers': 'sched_fetchers',
'builders': 'sched_builders',
'pushers': 'sched_pushers',
+ 'max_jobs': 'build_max_jobs',
'network_retries': 'sched_network_retries',
'pull_buildtrees': 'pull_buildtrees',
'cache_buildtrees': 'cache_buildtrees'
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index fda81598d..1f5d500a8 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -241,6 +241,8 @@ def print_version(ctx, param, value):
help="Maximum simultaneous build tasks")
@click.option('--pushers', type=click.INT, default=None,
help="Maximum simultaneous upload tasks")
+@click.option('--max-jobs', type=click.INT, default=None,
+ help="Number of parallel jobs allowed for a given build task")
@click.option('--network-retries', type=click.INT, default=None,
help="Maximum retries for network tasks")
@click.option('--no-interactive', is_flag=True, default=False,
diff --git a/tests/frontend/completions.py b/tests/frontend/completions.py
index 773eec040..3619242ac 100644
--- a/tests/frontend/completions.py
+++ b/tests/frontend/completions.py
@@ -35,6 +35,7 @@ MAIN_OPTIONS = [
"--error-lines ",
"--fetchers ",
"--log-file ",
+ "--max-jobs ",
"--message-lines ",
"--network-retries ",
"--no-colors ",