diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2019-04-10 18:58:00 +0100 |
---|---|---|
committer | Chandan Singh <csingh43@bloomberg.net> | 2019-04-10 18:58:00 +0100 |
commit | 645e5387c2f81765654ce4543ce1f00092e3381b (patch) | |
tree | d12f39ae67301824004e070aece20e42093b1a67 | |
parent | b9cdf82c6c33d18ae08d17dce5fa041486893ec0 (diff) | |
download | buildstream-chandan/symbolic-junction.tar.gz |
WIP: Allow symbolic links to subprojectschandan/symbolic-junction
TODO:
- [ ] Decide on the proper name of the "element" configuration option
- [ ] Check if this works in various corner cases
- [ ] Add tests
- [ ] Add docs
-rw-r--r-- | buildstream/_loader/loader.py | 9 | ||||
-rw-r--r-- | buildstream/plugins/elements/junction.py | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py index 6d8310cfa..23612979b 100644 --- a/buildstream/_loader/loader.py +++ b/buildstream/_loader/loader.py @@ -578,7 +578,14 @@ class Loader(): else: raise - loader = project.loader + # Check if an element was specified to use as a symlink + if element.junctioned_element: + loader = project.loader._get_loader(element.junctioned_element, rewritable=rewritable, ticker=ticker, + level=level+1, fetch_subprojects=fetch_subprojects, + provenance=provenance) + else: + loader = project.loader + self._loaders[filename] = loader return loader diff --git a/buildstream/plugins/elements/junction.py b/buildstream/plugins/elements/junction.py index ec7832bc6..f7ee2ab72 100644 --- a/buildstream/plugins/elements/junction.py +++ b/buildstream/plugins/elements/junction.py @@ -48,6 +48,9 @@ Overview # Optionally look in a subpath of the source repository for the project path: projects/hello + # Optionally specify the element in the subproject to use as junction + element: junctions/sub-project.bst + .. note:: Junction elements may not specify any dependencies as they are simply @@ -140,6 +143,7 @@ class JunctionElement(Element): BST_FORBID_RDEPENDS = True def configure(self, node): + self.junctioned_element = self.node_get_member(node, str, 'element', default=None) self.path = self.node_get_member(node, str, 'path', default='') self.options = self.node_get_member(node, Mapping, 'options', default={}) |