summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-01-03 18:38:47 +0100
committerJürg Billeter <j@bitron.ch>2019-01-10 13:50:15 +0100
commit06deb4c4eb2bba43a67b4ffc0f34ce2b9f16adfa (patch)
tree00efc41bcc7ca4c41992ddf5e32e5c5af154ea13
parent26e33346b2771b4a9f9c710335ff5b73eff8101e (diff)
downloadbuildstream-juerg/arch.tar.gz
element.py: Accept architecture aliases for sandbox configjuerg/arch
Accept common architecture aliases for the sandbox config for consistency with arch options.
-rw-r--r--buildstream/element.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 3bfe62275..c5fbf772c 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -2441,11 +2441,17 @@ class Element(Plugin):
# Sandbox config, unlike others, has fixed members so we should validate them
_yaml.node_validate(sandbox_config, ['build-uid', 'build-gid', 'build-os', 'build-arch'])
+ build_arch = self.node_get_member(sandbox_config, str, 'build-arch', default=None)
+ if build_arch:
+ build_arch = Platform.canonicalize_arch(build_arch)
+ else:
+ build_arch = host_arch
+
return SandboxConfig(
self.node_get_member(sandbox_config, int, 'build-uid'),
self.node_get_member(sandbox_config, int, 'build-gid'),
self.node_get_member(sandbox_config, str, 'build-os', default=host_os),
- self.node_get_member(sandbox_config, str, 'build-arch', default=host_arch))
+ build_arch)
# This makes a special exception for the split rules, which
# elements may extend but whos defaults are defined in the project.