Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abderrahim opened this issue Feb 15, 2024 · 2 comments
Open

Comments

@abderrahim
Copy link
Contributor

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.

@gtristan
Copy link
Contributor

I see.

So you are saying that the plugins experience can change, with the same cache key.

This is an interesting corner case, presumably if B were to instead add a runtime dependency on unrelated D, then the cache key of A would change correct ?

This needs some thought…

@abderrahim
Copy link
Contributor Author

presumably if B were to instead add a runtime dependency on unrelated D, then the cache key of A would change correct ?

Right. In this case, D would be added to the cache key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants