summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-10-28 15:57:56 +0000
committerDarius Makovsky <traveltissues@protonmail.com>2019-10-30 12:46:16 +0000
commitb447e9f59537def81b24ab2e0e91e827d6f194bb (patch)
tree14e5735bdbe81b879ba905f03dc5c36266a62bc5
parente49274adb29076ecfb2fb529b531a5ffca1c8491 (diff)
downloadbuildstream-b447e9f59537def81b24ab2e0e91e827d6f194bb.tar.gz
source.py: _get_unique_key in _track
Ensure that sources advertising BST_NO_PRESTAGE_KEY have keys after tracking.
-rw-r--r--src/buildstream/source.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/buildstream/source.py b/src/buildstream/source.py
index d37b04ae6..132856a6b 100644
--- a/src/buildstream/source.py
+++ b/src/buildstream/source.py
@@ -169,7 +169,7 @@ from typing import Iterable, Iterator, Optional, Tuple, TYPE_CHECKING
from . import _yaml, utils
from .node import MappingNode
from .plugin import Plugin
-from .types import Consistency, SourceRef, Union
+from .types import Consistency, SourceRef, Union, List
from ._exceptions import BstError, ImplError, ErrorDomain
from ._loader.metasource import MetaSource
from ._projectrefs import ProjectRefStorage
@@ -1060,7 +1060,12 @@ class Source(Plugin):
# Args:
# previous_sources (list): List of Sources listed prior to this source
#
- def _track(self, previous_sources):
+ def _track(self, previous_sources: List['Source']) -> SourceRef:
+ if self.BST_NO_PRESTAGE_KEY:
+ # ensure that these sources have a key after tracking
+ self._get_unique_key()
+ return None
+
if self.BST_REQUIRES_PREVIOUS_SOURCES_TRACK:
self.__ensure_previous_sources(previous_sources)
with self.__stage_previous_sources(previous_sources) \