diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-08-13 19:01:00 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan@codethink.co.uk> | 2020-10-01 13:27:30 +0900 |
commit | 751c80d4938b7c3a798d056134f58844242939b3 (patch) | |
tree | a31bd535be946b3032d22b6296a49b735ba5e2b1 /src/buildstream/source.py | |
parent | 348108d933be748727ee8aec861ecd5c168db72e (diff) | |
download | buildstream-751c80d4938b7c3a798d056134f58844242939b3.tar.gz |
Refactor: Lazily instantiate ProvenanceInformation objectstristan/lazy-provenance
As a rule, throughout the codebase we should not be using internal
ProvenanceInformation objects in our APIs, but rather Node objects.
This is because ProvenanceInformation is generated on the fly from
a Node object, and it is needlessly expensive to instantiate one before
it is absolutely needed.
This patch unilaterally fixes the codebase to pass `provenance_node`
Node objects around as arguments rather than `provenance` ProvenanceInformation
objects.
Diffstat (limited to 'src/buildstream/source.py')
-rw-r--r-- | src/buildstream/source.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/buildstream/source.py b/src/buildstream/source.py index ce1cf8434..e0a2db45d 100644 --- a/src/buildstream/source.py +++ b/src/buildstream/source.py @@ -322,14 +322,13 @@ class Source(Plugin): alias_override: Optional[Tuple[str, str]] = None, unique_id: Optional[int] = None ): - provenance = meta.config.get_provenance() # Set element_name member before parent init, as needed for debug messaging self.__element_name = meta.element_name # The name of the element owning this source super().__init__( "{}-{}".format(meta.element_name, meta.element_index), context, project, - provenance, + meta.config, "source", unique_id=unique_id, ) |