gtristan commented on PR #1991:
URL: https://github.com/apache/buildstream/pull/1991#issuecomment-2990278653

   I'll open a completely separate thread to follow up on the separate topic of 
"doing a whole stage" (I probably should have made that comment separately 
initially).
   
   @abderrahim writes:
   
   > Well, it depends. Currently an element plugin has no way to create a 
CasBasedDirectory using public API. The only way to get a CasBasedDirectory is 
throgh Sandbox.get_virtual_directory() (and even that advertises it returns a 
Directory base class). It also can't get the artifact contents of an element as 
a Directory: it only has access to Element.stage_artifact(). While this 
BuildElement is in core and can technically use private APIs, I tried to avoid 
going that route.
   
   I should point out that `SandboxDummy` is declared in 
`sandboxing/_sandboxdummy.py`, and not exposed in the toplevel `__init__.py`, 
and so it is not a public API, I'm not sure there is a sensible reason to make 
this public.
   
   It does appear in `sandbox/__init__.py` which may strictly speaking be a bug 
on our part, as it may mislead people into thinking it is public.
   
   > I think the difference we need to consider between the two approaches is 
whether or not to consider the dependencies? i.e. if I depend on gcc, is your 
expectation that this only gets the digest of the gcc artifact or should it be 
gcc and its runtime dependencies?
   
   I think this definitely needs to consider dependencies, although I'm not 
sure how that is related to using a `SandboxDummy`.
   
   Frankly, the use of `SandboxDummy` is not a huge deal breaker for me if it 
really saves you some lines of code, my concerns about using it are:
   * Bringing in unrelated lines of code, i.e. *the use of a sandbox object*
     * Is it possibly that sharing code in this way may cause sandbox related 
changes to break this feature ?
   * The possibility that those orthogonal lines of code may incur an 
unnecessary runtime overhead
     * Does this increase I/O in the calculation of the `digest-environment` ?
   
   


-- 
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]

Reply via email to