diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-07-14 19:14:05 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-07-15 23:30:40 +0900 |
commit | 0a19dfd7b0a7684e39bdab9c50d6ab97522fd9a1 (patch) | |
tree | fb8a53dd1799ad43996ed9dede6110fb3c93578a | |
parent | cadc772b9b7cd664420d094726035e1464aa12d1 (diff) | |
download | buildstream-0a19dfd7b0a7684e39bdab9c50d6ab97522fd9a1.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.py | 1 | ||||
-rw-r--r-- | src/buildstream/_frontend/cli.py | 2 | ||||
-rw-r--r-- | tests/frontend/completions.py | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/buildstream/_frontend/app.py b/src/buildstream/_frontend/app.py index cf4ac2b8d..92f595654 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 e9d67ca87..768ee0b68 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 ", |