You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 07:17:50 UTC

[buildstream] 01/02: Expand sandbox values from environment

This is an automated email from the ASF dual-hosted git repository.

tvb 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