diff options
author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-07-04 12:37:04 +0100 |
---|---|---|
committer | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-07-04 12:40:37 +0100 |
commit | b2ef1b48cd22b221f7421aef255fd11fddda2a38 (patch) | |
tree | c3dccfe189909a44eab8cfe7f4717214e86e3c0d | |
parent | 8ab6899db498f5a45b7ea2bcad31b7807de4667b (diff) | |
download | buildstream-b2ef1b48cd22b221f7421aef255fd11fddda2a38.tar.gz |
_sandboxremote: Send environment variables.
-rw-r--r-- | buildstream/sandbox/_sandboxremote.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/buildstream/sandbox/_sandboxremote.py b/buildstream/sandbox/_sandboxremote.py index 18d8cdc78..aa60c22ce 100644 --- a/buildstream/sandbox/_sandboxremote.py +++ b/buildstream/sandbox/_sandboxremote.py @@ -60,9 +60,12 @@ class SandboxRemote(Sandbox): self.cascache.setup_remotes(use_config=True) # Should do that once per sandbox really (or less often) return self.cascache - def __run_remote_command(self, cascache, command, input_root_digest): - remote_command = remote_execution_pb2.Command(arguments=command) - # (Ignore environment for now) + def __run_remote_command(self, cascache, command, input_root_digest, environment): + environment_variables = [] + for(k,v) in environment.items(): + environment_variables.append(remote_execution_pb2.Command.EnvironmentVariable(name=k, value=v)) + remote_command = remote_execution_pb2.Command(arguments=command, environment_variables = environment_variables) + # Serialise this into the cascache... command_digest = cascache.add_object(buffer=remote_command.SerializeToString()) @@ -173,7 +176,7 @@ class SandboxRemote(Sandbox): # Now transmit the command to execute if source_push_successful or cascache.verify_key_pushed(ref, self._get_project()): - response = self.__run_remote_command(cascache, command, upload_vdir.ref) + response = self.__run_remote_command(cascache, command, upload_vdir.ref, env) if response is None or response.HasField("error"): # Build failed, so return a failure code |