diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-07-14 20:13:48 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-07-14 20:23:27 +0900 |
commit | c13024b4ae801dbbf2d2106ff1c7850edc675722 (patch) | |
tree | 80f804598d8e64d0761dcffd558f0bbf74d92fa1 | |
parent | 32a4ebbfa9045c305fae4b701947cf6386d121c6 (diff) | |
download | buildstream-c13024b4ae801dbbf2d2106ff1c7850edc675722.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-- | buildstream/_frontend/app.py | 1 | ||||
-rw-r--r-- | buildstream/_frontend/cli.py | 2 | ||||
-rw-r--r-- | tests/completions/completions.py | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py index f48d9cbe1..cb9870c4d 100644 --- a/buildstream/_frontend/app.py +++ b/buildstream/_frontend/app.py @@ -192,6 +192,7 @@ class App(): 'fetchers': 'sched_fetchers', 'builders': 'sched_builders', 'pushers': 'sched_pushers', + 'max_jobs': 'build_max_jobs', 'network_retries': 'sched_network_retries' } for cli_option, context_attr in override_map.items(): diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index cf143f1c8..bbec3fd62 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -208,6 +208,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/completions/completions.py b/tests/completions/completions.py index 50b41f7b3..ce05fc3d1 100644 --- a/tests/completions/completions.py +++ b/tests/completions/completions.py @@ -32,6 +32,7 @@ MAIN_OPTIONS = [ "--error-lines ", "--fetchers ", "--log-file ", + "--max-jobs ", "--message-lines ", "--network-retries ", "--no-colors ", |