juergbi commented on code in PR #2147:
URL: https://github.com/apache/buildstream/pull/2147#discussion_r3879364823
##########
src/buildstream/element.py:
##########
@@ -2076,6 +2091,17 @@ def _shell(self, scope=None, *, mounts=None,
isolate=False, prompt=None, command
if prompt is not None:
environment["PS1"] = prompt
+ with self.timed_activity("Staging other_targets",
silent_nested=True), self.__collect_overlaps(sandbox):
+ self.stage_dependency_artifacts(sandbox, other_elements)
+
+ if other_elements:
+ # Stage artifacts from other_elements into the sandbox.
+ for element in other_elements:
+ # Stage deps in the sandbox root
+ with element.timed_activity("Integrating sandbox"),
sandbox.batch():
+ for dep in element._dependencies(_Scope.RUN):
+ dep.integrate(sandbox)
Review Comment:
> Temporary stack element would have made buildtree ones unhelpful.
> The downside of using a temporary element is the shell command needs to
attempt to run a build on the temporary element, before it can shell, to cache
it's build result.
Not being able to use a cached build seems like a major downside to me. I
was originally thinking of injecting it in the in-memory representation, not
creating a temporary file. But maybe that's not feasible.
A possible mitigation with the temporary file approach could be using
different approaches for build and runtime shells. A temporary stack element
for runtime shells and what your branch is doing now for build shells. Or have
you already considered this as not tenable for some reason?
--
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]