summaryrefslogtreecommitdiff
path: root/buildstream/_project.py
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-03-13 15:17:22 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-03-23 14:37:38 +0000
commitf4d3892e4b7276f25599ce6e9fbae840ab10c833 (patch)
tree5f300f0851a2b28bd4e569cc2b6d2fa4a4964d7c /buildstream/_project.py
parent7d92ef0f39f64eb7dfddb969d88487287733e5b2 (diff)
downloadbuildstream-f4d3892e4b7276f25599ce6e9fbae840ab10c833.tar.gz
Add 'sandbox' configuration key and build-uid/build-gid elements
This only affects SandboxBWrap at the moment. buildstream/_loader.py: Add Symbol.SANDBOX and allow it in validation buildstream/_metaelement.py: Add 'sandbox' variable and store it in the object buildstream/_project.py: Add 'sandbox' configuration key and load it from project.conf. buildstream/data/projectconfig.yaml: Default build-uid/build-gid values of 0 for 'sandbox'. buildstream/element.py: Add __extract_sandbox_config to find the final sandbox configuration. Pass this to the sandbox constructor. buildstream/sandbox/_sandboxbwrap.py: If sandbox configuration was supplied, use it for uid and gid instead of the default 0. buildstream/sandbox/_sandboxchroot.py: Throw exception if non-0 uid/gid were supplied. buildstream/sandbox/__init__.py: Import SandboxConfig. buildstream/sandbox/_private.py: New file, containing SandboxConfig. Made private to avoid documentation for this class.
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r--buildstream/_project.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index 85319b414..aeacf6bdf 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -173,7 +173,7 @@ class Project():
'aliases', 'name',
'artifacts', 'options',
'fail-on-overlap', 'shell',
- 'ref-storage'
+ 'ref-storage', 'sandbox'
])
# The project name, element path and option declarations
@@ -292,10 +292,13 @@ class Project():
if option.variable:
self._variables[option.variable] = option.get_value()
- # Load sandbox configuration
+ # Load sandbox environment variables
self._environment = _yaml.node_get(config, Mapping, 'environment')
self._env_nocache = _yaml.node_get(config, list, 'environment-nocache')
+ # Load sandbox configuration
+ self._sandbox = _yaml.node_get(config, Mapping, 'sandbox')
+
# Load project split rules
self._splits = _yaml.node_get(config, Mapping, 'split-rules')