diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2018-11-05 13:16:53 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-11-17 13:07:59 +0000 |
commit | 199bfff16160cd0c7c0fe56af3723656f6148068 (patch) | |
tree | 3e0107a4865292edf25e4bedfec6591f48e06b22 /buildstream/_context.py | |
parent | b5b79056acdc0ad883e04d17de5948fb4a9d88e6 (diff) | |
download | buildstream-199bfff16160cd0c7c0fe56af3723656f6148068.tar.gz |
Add cli main and user config option for 'pull-buildtrees' context.
_context.py: Add pull_buildtrees global user context, the default
of which is set to False via the addition of pull-buildtrees to
userconfig.yaml cache group.
_frontend/app.py & cli.py: Add --pull-buildtrees as a bst main
option, which when passed will override the default or user defined
context for pull_buildtrees.
tests/completions/completions.py: Update for the added flag.
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r-- | buildstream/_context.py | 8 |
1 files changed, 7 insertions, 1 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, [ |