Implement Element.configure_dependencies()

This is the main merge request to implement Element.configure_dependencies() as per the proposal to extend dependency attributes.

This patch goes a bit further to port all BuildStream internals and core elements to use the new Element.configure_dependencies(), and all usage of Element.search() is removed by this branch.

Main features of this branch in chronological order include:

  • Create Element.configure_dependencies()

    • Includes documentation and preliminary testing
  • Break API in ScriptElement such that Element.search() is no longer needed (element names were being used here, now we use Element instances directly in the ScriptElement.layout_add() API)

    • Behavior is slightly changed, such that order of calls to ScriptElement.layout_add() are no longer significant.

      This is because the old API would stage elements sequence, whereas the new behavior is the use the new selection arguments to Element.stage_dependency_artifacts() and Element.dependencies(), so that we do not traverse common dependencies more than once (this should also make the ScriptElement more performant whenever staging multiple artifacts with common dependencies).

  • Update script element to now expose dependency configurations in place of element names in the element's config section.

    • Includes documentation updates and test updates in the integration tests
  • Add new feature to BuildElement to also allow staging of dependencies into exotic new locations with a new location dependency configuration.

    • Includes additional cache key test and additional integration test
  • Add OverlapCollector (private API) and OverlapAction (public API)

    • The OverlapAction is a new parameter to Element.stage_artifact() and Element.stage_dependency_artifacts() and allows the caller to decide the behavior when overlaps occur due to multiple distinct invocations of these staging functions.

    • Consequently, it is now illegal to call the staging APIs outside of Element.stage() implementations (except for where the core calls these internally for the purposes of opening workspaces or checking out artifacts).

For the API breaks, these are addressed in bst-plugins-experimental with this merge request.

Edited by Tristan Van Berkom

Merge request reports

Loading