Create a bazel build element
Background
Create an element that provides support for building with bazel.
Specifically, a bst would declare itself of kind bazel and BuildStream would take care of generating the WORKSPACE file by recursively scanning the dependencies of the element being built.
Task description
-
bazelwould be executed inside the sandbox (not using a host tool) - The workspace file would identify the built sources to consume with
new_local_repositoryrules; if it encounters a dependency of typebazelit would stage the sources rather than the binaries and consume theBUILDfile to leveragebazel. -
bazelwould need access to a persistent disk cache (use_set_mount_source?) between BuildStream runs so as to take advantage of its built in caching. Thebazelserver will actually be torn down between runs but it is said to serialize its state between runs so the startup time will no be prohibitive. - Toolchain generation: we need to generate correct toolchain for the target platform and have that be considered as part of the key for the element.