abderrahim commented on code in PR #2036:
URL: https://github.com/apache/buildstream/pull/2036#discussion_r2292980724
##########
src/buildstream/_artifactcache.py:
##########
@@ -361,6 +361,9 @@ def _push_artifact_proto(self, element, artifact,
artifact_digest, remote):
referenced_directories.append(artifact_proto.sources)
if artifact_proto.buildroot:
referenced_directories.append(artifact_proto.buildroot)
+ if artifact_proto.buildsandbox:
+ for subsandbox_digest in
artifact_proto.buildsandbox.subsandbox_digests:
Review Comment:
I think we need to push these in `_push_artifact_blobs()` as well.
##########
tests/integration/project/elements/digest-environment/base-buildtree.bst:
##########
@@ -0,0 +1,12 @@
+kind: manual
Review Comment:
This file is identical to `base.bst`, any reason to have a separate element?
##########
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:
I am not sure what this brings us. Why are we storing two different sets of
environment variables in the artifact? Are they supposed to be different?
A bit of digging later: It seems the only relevance of the "static"
environment is to compute the cache key, but we don't recompute the cache key
from a loaded artifact. Am I missing something?
##########
src/buildstream/buildelement.py:
##########
@@ -286,10 +306,20 @@ def configure_sandbox(self, sandbox):
sandbox.set_work_directory(command_dir)
# Setup environment
- sandbox.set_environment(self.get_environment())
+ env = self.get_environment()
- def stage(self, sandbox):
Review Comment:
nit: removing the empty line after `def stage(self, sandbox):` results in a
confusing diff.
--
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]