diff options
author | Benjamin Schubert <contact@benschubert.me> | 2020-10-01 09:51:18 +0000 |
---|---|---|
committer | Benjamin Schubert <contact@benschubert.me> | 2020-10-01 12:30:38 +0000 |
commit | 8d9bf0249cf5293402304aacb5af98ddd4b23c24 (patch) | |
tree | ad2c2b6781cc61d6e0fd9ec7bda58b2af43650fc /src/buildstream/element.py | |
parent | ea235b9d7764b17ee5d042bc1e204bf9bdb87a8b (diff) | |
download | buildstream-8d9bf0249cf5293402304aacb5af98ddd4b23c24.tar.gz |
element.py: Stop computing cache keys when caching, we should have them
This removes a call to `__update_cache_key_non_strict()` in the job for
non strict builds. This call has an impact on other elements and should
never be done beforehand.
This however means we need to compute cache keys before, and we
therefore need to re-compute the cache keys as an element become
buildable
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r-- | src/buildstream/element.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index 81e55a01b..7b3b704d2 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -1850,8 +1850,9 @@ class Element(Plugin): except VirtualDirectoryError: pass - # ensure we have cache keys - self.__update_cache_key_non_strict() + # We should always have cache keys already set when caching an artifact + assert self.__cache_key is not None + assert self.__artifact._cache_key is not None with self.timed_activity("Caching artifact"): artifact_size = self.__artifact.cache(sandbox_build_dir, collectvdir, sourcesvdir, buildresult, publicdata) @@ -2410,6 +2411,7 @@ class Element(Plugin): assert not rdep.__build_deps_uncached < 0 if rdep.__buildable_callback is not None and rdep._buildable(): + rdep.__update_cache_key_non_strict() rdep.__buildable_callback(rdep) rdep.__buildable_callback = None |