You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:29:10 UTC
[buildstream] branch willsalmon/expandsandbox created (now e19ce72)
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a change to branch willsalmon/expandsandbox
in repository https://gitbox.apache.org/repos/asf/buildstream.git.
at e19ce72 Test that sandbox variables are expanded
This branch includes the following new commits:
new ca1ca12 Expand sandbox values from environment
new e19ce72 Test that sandbox variables are expanded
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[buildstream] 01/02: Expand sandbox values from environment
Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a commit to branch willsalmon/expandsandbox
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit ca1ca124f95d22aa5315c192e879137b5169a59d
Author: William Salmon <po...@gmail.com>
AuthorDate: Fri May 8 16:54:11 2020 +0100
Expand sandbox values from environment
If sandbox: target_arch was a variable it was not being expanded, this
fixes this.
---
src/buildstream/element.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 862f009..01975fe 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -305,11 +305,13 @@ class Element(Plugin):
# Extract remote execution URL
if meta.is_junction:
self.__remote_execution_specs = None
+ sandbox_config = Node.from_dict({})
else:
self.__remote_execution_specs = project.remote_execution_specs
+ sandbox_config = Node.from_dict(self.__expand_environment(project._sandbox.clone()))
# Extract Sandbox config
- self.__sandbox_config = self.__extract_sandbox_config(context, project, meta)
+ self.__sandbox_config = self.__extract_sandbox_config(context, sandbox_config, meta)
def __lt__(self, other):
return self.name < other.name
@@ -2643,11 +2645,7 @@ class Element(Plugin):
# Sandbox-specific configuration data, to be passed to the sandbox's constructor.
#
@classmethod
- def __extract_sandbox_config(cls, context, project, meta):
- if meta.is_junction:
- sandbox_config = Node.from_dict({})
- else:
- sandbox_config = project._sandbox.clone()
+ def __extract_sandbox_config(cls, context, sandbox_config, meta):
# Get the platform to ask for host architecture
platform = context.platform
[buildstream] 02/02: Test that sandbox variables are expanded
Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a commit to branch willsalmon/expandsandbox
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit e19ce72915c418af89ab19e6976ff43c3ab0b40d
Author: William Salmon <po...@gmail.com>
AuthorDate: Fri May 8 17:50:04 2020 +0100
Test that sandbox variables are expanded
---
tests/sandboxes/project/project.conf | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/sandboxes/project/project.conf b/tests/sandboxes/project/project.conf
index d309960..951279a 100644
--- a/tests/sandboxes/project/project.conf
+++ b/tests/sandboxes/project/project.conf
@@ -13,6 +13,7 @@ options:
arch:
type: arch
description: Current architecture
+ variable: target_arch
values:
- x86-64
- aarch64
@@ -22,3 +23,8 @@ split-rules:
/tests
- |
/tests/*
+
+## This is not *needed* for the tests to pass but having it in the tests, tests that build-arch can be expanded.
+sandbox:
+ build-arch: '%{target_arch}'
+