Add BST_REQUIRES_PREVIOUS_SOURCE_STAGE option

Description

A follow up to !1214 (merged) and !1124 (merged), this MR cause sources to be cached separately where possible, by checking for a new BST_REQUIRES_PREVIOUS_SOURCE_STAGE option. The last listed source in an element that has this option will be cached, staged with all previous sources (and key generation appropriately depends on this too), and later listed sources are all cached by themselves.

Few points that might warrant further discussion:

  • Currently all sources previous to the last one with this new option are not cached. I'm unsure whether there's any benefit to caching them to share them among more elements.
  • As sources are cached separately, errors with overlapping files may not be encountered until later during the build stage. I don't think this is too much of an issue, but one test has been changed to account for this (tests/sources/local.py::test_stage_file_exists).

Changes proposed in this merge request:

  • - Add BST_REQUIRES_PREVIOUS_SOURCES_STAGE option to plugins. Only set to True for the patch plugin in the main repo.
  • - Add new method to given index of last source that has above option set to True
  • - Changes to methods that stage and export sources, such that they're done separately where possible.
  • - Add new tests that ensure right sources are cached separately.

This merge request, when approved, will close: #982 (closed)


Edited by Raoul Hidalgo Charman

Merge request reports

Loading