apache / apache/buildstream

Cache key doesn't change despite some changes in the dependency graph

Open
#1,893 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Let's consider this example. Element A.bst build-depends on two unrelated elements B.bst and C.bst.

Now if I add a runtime-depends on C.bst to B.bst, the cache keys don't change. B's cache key doesn't take into account runtime dependencies, and A's cache key only takes into account the list of build dependencies, which hasn't changed (it's still B and C, plus whatever runtime dependencies they had).

The issue here is that A does have access to the dependency graph, not only the list of dependencies. So `self.dependencies(recurse=False)` would return B and C, and calling `dependencies()` on B will reveal the new dependency.

Most plugins don't go looking into the dependency graph, but for those that do this leads to the same cache key (and the element not getting rebuilt) even though the result would be different.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the cache-key calculation for an element and the dependency APIs described in the issue, comparing direct dependencies with the recursive graph. Reproduce the A/B/C example, then verify that adding B's runtime dependency on C changes A's cache key and causes affected elements to rebuild.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.