Skip to content

Add the name of build deps to the strict cache key

James Ennis requested to merge jennis/add_dep_name_to_cache_key into master

Description

As it currently stands:

  1. When we calculate the weak cache key, we add the names of build dependencies to the cache key: https://gitlab.com/BuildStream/buildstream/blob/master/src/buildstream/element.py#L3095
  2. When we calculate the strong cache key, we use the strict cache keys of build deps (and not their names): https://gitlab.com/BuildStream/buildstream/blob/master/src/buildstream/element.py#L3106

This means that changing the name of a dependency would trigger a rebuild with non-strict but not with strict.

Additionally, we store the element_name of build dependencies in the artifact proto: https://gitlab.com/BuildStream/buildstream/blob/master/src/buildstream/_protos/buildstream/v2/artifact.proto#L57

This means that we change the name of a dependency, we not trigger a change in the strict cache key and thus, the proto would get out of sync

This MR addresses this.

Merge request reports