diff options
-rw-r--r-- | buildstream/_context.py | 8 | ||||
-rw-r--r-- | buildstream/_frontend/app.py | 3 | ||||
-rw-r--r-- | buildstream/_frontend/cli.py | 2 | ||||
-rw-r--r-- | buildstream/data/userconfig.yaml | 3 | ||||
-rw-r--r-- | tests/completions/completions.py | 1 |
5 files changed, 15 insertions, 2 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py index 876b74712..960f37160 100644 --- a/buildstream/_context.py +++ b/buildstream/_context.py @@ -104,6 +104,9 @@ class Context(): # What to do when a build fails in non interactive mode self.sched_error_action = 'continue' + # Whether or not to attempt to pull build trees globally + self.pull_buildtrees = None + # Whether elements must be rebuilt when their dependencies have changed self._strict_build_plan = None @@ -178,13 +181,16 @@ class Context(): # our artifactdir - the artifactdir may not have been created # yet. cache = _yaml.node_get(defaults, Mapping, 'cache') - _yaml.node_validate(cache, ['quota']) + _yaml.node_validate(cache, ['quota', 'pull-buildtrees']) self.config_cache_quota = _yaml.node_get(cache, str, 'quota', default_value='infinity') # Load artifact share configuration self.artifact_cache_specs = ArtifactCache.specs_from_config_node(defaults) + # Load pull build trees configuration + self.pull_buildtrees = _yaml.node_get(cache, bool, 'pull-buildtrees') + # Load logging config logging = _yaml.node_get(defaults, Mapping, 'logging') _yaml.node_validate(logging, [ diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py index 6b292a44a..b42b94bc1 100644 --- a/buildstream/_frontend/app.py +++ b/buildstream/_frontend/app.py @@ -182,7 +182,8 @@ class App(): 'fetchers': 'sched_fetchers', 'builders': 'sched_builders', 'pushers': 'sched_pushers', - 'network_retries': 'sched_network_retries' + 'network_retries': 'sched_network_retries', + 'pull_buildtrees': 'pull_buildtrees' } for cli_option, context_attr in override_map.items(): option_value = self._main_options.get(cli_option) diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index 85632959f..b75bf455b 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -219,6 +219,8 @@ def print_version(ctx, param, value): help="Specify a project option") @click.option('--default-mirror', default=None, help="The mirror to fetch from first, before attempting other mirrors") +@click.option('--pull-buildtrees', is_flag=True, default=None, + help="Include an element's build tree when pulling remote element artifacts") @click.pass_context def cli(context, **kwargs): """Build and manipulate BuildStream projects diff --git a/buildstream/data/userconfig.yaml b/buildstream/data/userconfig.yaml index efe419cfc..f540a97f6 100644 --- a/buildstream/data/userconfig.yaml +++ b/buildstream/data/userconfig.yaml @@ -35,6 +35,9 @@ cache: # to the isize of the file system containing the cache. quota: infinity + # Whether to pull build trees when downloading element artifacts + pull-buildtrees: False + # # Scheduler # diff --git a/tests/completions/completions.py b/tests/completions/completions.py index e6d15e68a..83728743a 100644 --- a/tests/completions/completions.py +++ b/tests/completions/completions.py @@ -42,6 +42,7 @@ MAIN_OPTIONS = [ "-o ", "--option ", "--on-error ", + "--pull-buildtrees ", "--pushers ", "--strict ", "--verbose ", |