diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-04-29 19:39:53 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2019-04-30 11:52:59 +0000 |
commit | 7900c09a27c1b6de12f7eef52e25116ff590c973 (patch) | |
tree | eac30031538cfc65f6fb9c6e71cbe5d83182ac39 | |
parent | 9053ee3846e70d082dac893703b87f8b04b0f195 (diff) | |
download | buildstream-7900c09a27c1b6de12f7eef52e25116ff590c973.tar.gz |
source.py: Inherit unique ID in cloned sourcestristan/fix-cloned-plugin-ids
When cloning a Source, we should inherit the same unique ID for
the sake of sending a valid ID in any messages sent back to
the frontend from a source cloned in a child task.
-rw-r--r-- | buildstream/source.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/source.py b/buildstream/source.py index 6f4ff575b..daf2cb27c 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -286,10 +286,10 @@ class Source(Plugin): *Since: 1.4* """ - def __init__(self, context, project, meta, *, alias_override=None): + def __init__(self, context, project, meta, *, alias_override=None, unique_id=None): provenance = _yaml.node_get_provenance(meta.config) super().__init__("{}-{}".format(meta.element_name, meta.element_index), - context, project, provenance, "source") + context, project, provenance, "source", unique_id=unique_id) self.__source_cache = context.sourcecache @@ -1092,7 +1092,9 @@ class Source(Plugin): meta.first_pass = self.__first_pass - clone = source_kind(context, project, meta, alias_override=(alias, uri)) + clone = source_kind(context, project, meta, + alias_override=(alias, uri), + unique_id=self._unique_id) # Do the necessary post instantiation routines here # |