[BuildStream] Out of source builds



Following on from the last proposal for https://gitlab.com/BuildStream/buildstream/issues/512 I have had another go:

I have changed the subject as i think this is sufficient difference between the last and this proposal and this is not
as workspace focused alto it will allow for the the preservation of out of workspace artifacts in workspaces to
facilitate incremental builds when build out of source in a workspace.

Overview
========
Out of source builds can already be achieved by setting 4 or 5 variables in the build elements yaml.
However this is not very satisfactory.
Proposal
========
To improve this feature it is proposed:
  * update as many build elements to behave as consistently as possible while implementing:
    - allow for build's that just need you to set, to achieve out of source builds.
      * `%{directory}`: of the source.
      * `%{command-subdir}`: were the build command is executed, and usually were the artifacts are created.
      * `%{source-subdir}`: were in the source to find the `configure.ac` or equivalent.
  * fix bug that causes `command-subdir` not to be created if it dose not exists in a workspace (this 
    will make workspace behavior match non workspace behavior)
  * Add a switch that can be set per element or per project that will set `directory` and `command-subdir` 
    to sensible defaults for out of source builds, 
  * Documentation
    - add a section for common source variables.
    - cover the new switch.
    - `BuildElement` docs for project authors.


Implementation
==============

Most of this should be done by altering the build elemetns .yaml in buildstream/plugins/elements/

The switch may need some more python code and the workspace bug will need a small amount of python code.

The work would be split in to Issues then MR's covering:
 * fix workspace bug for creating command-subdir directories.
 * fix .yaml files to work with directory, sommand-sub-dir and source-subdir.
 * add global/element switch.
 * documentation. 

Many Thanks
Will


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]