Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/buildstream/_frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def show(app, elements, deps, except_, order, format_):

# Don't spend time interrogating the cache if we don't need to show element state
if need_state:
app.stream.query_cache(dependencies)
app.stream.query_cache(dependencies, need_state=True)

if order == "alpha":
dependencies = sorted(dependencies)
Expand Down
9 changes: 6 additions & 3 deletions src/buildstream/_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,16 @@ def load_selection(
# sources_of_cached_elements (bool): True to query the source cache for elements with a cached artifact
# only_sources (bool): True to only query the source cache
#
def query_cache(self, elements, *, sources_of_cached_elements=False, only_sources=False):
def query_cache(self, elements, *, sources_of_cached_elements=False, only_sources=False, need_state=False):
# It doesn't make sense to combine these flags
assert not sources_of_cached_elements or not only_sources

with self._context.messenger.simple_task("Query cache", silent_nested=True) as task:
# Enqueue complete build plan as this is required to determine `buildable` status.
plan = list(_pipeline.dependencies(elements, _Scope.ALL))
if need_state:
# Enqueue complete build plan as this is required to determine `buildable` status.
plan = list(_pipeline.dependencies(elements, _Scope.ALL))
else:
plan = elements

if self._context.remote_cache_spec:
# Parallelize cache queries if a remote cache is configured
Expand Down
Loading