BuildStream-Migration-Bot commented on pull request #1429:
URL: https://github.com/apache/buildstream/pull/1429#issuecomment-773099665


   In GitLab by [[Gitlab user @tristanvb]](https://gitlab.com/tristanvb) on Sep 
22, 2020, 16:09
   
   Note that before very recently (this weekend), multiple calls to either 
`Element.stage_artifact()` or `Element.stage_dependency_artifacts()` have a bad 
side effect of failing to report overlap warnings.
   
   What's more, overlap whitelists cannot work across multiple calls.
   
   Another drawback of the original ScriptElement I noticed while porting it, 
is that the layout internally is stored as a list, and not a dictionary. That 
means ScriptElement stages multiple dependencies into the same staging location 
separately, instead of staging the common dependencies for the same sandbox 
location at once.
   
   This means that the staging order is not what one might expect, common 
dependencies written to the same target location later on in the layout will 
overwrite the same dependencies written before (which will also have side 
effects when intentionally overlapping files).
   
   The same goes for integration commands, if multiple elements are staged into 
`/` separately, the order of integration commands being run may conflict, and 
will almost certainly run redundant integration commands for common 
dependencies.
   
   It might be possible to at least address parts of this by:
   
   * Backporting `OverlapCollector`
   * Reporting warnings which were previously (erronously) ignored
   * Internally collecting the common dependencies targetting the same location 
and staging / running integration commands once for each target location (while 
preserving the current order dependent layout list for the target locations, 
which is bst-1 API)
   
   Since scriptelement is a core element, it could use some hidden facets of 
the `Element.dependencies()` and related APIs in order to stage/run integration 
commands on common dependencies of a list of elements (rather than being 
limited to iterating over one element's dependencies at a time).


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to