juergbi commented on code in PR #2036:
URL: https://github.com/apache/buildstream/pull/2036#discussion_r2293453302
##########
src/buildstream/_artifact.py:
##########
@@ -681,6 +696,21 @@ def pull(self, *, pull_buildtrees):
return True
+ def configure_sandbox(self, sandbox):
+ artifact = self._get_proto()
+
+ if artifact.buildsandbox and artifact.buildsandbox.environment:
+ env = {}
+ for env_var in artifact.buildsandbox.environment:
+ env[env_var.name] = env_var.value
+ else:
+ env = self.load_environment()
Review Comment:
Loading the (new) sandbox environment in `load_environment()` would be wrong
as it is used to set `Element.__environment`, which should not contain e.g.
digest environment variables. It's possible that `Element.__environment` loaded
from the artifact is not actually used right now, however, it may be used in
the future e.g. by `bst inspect`. I didn't want to change anything in this
regard to keep the risk of breakage or compatibility problems to a minimum.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]