From b1eefbad78f4a2a923c345d1b53d2f8c631bd80b Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 6 Feb 2018 16:18:58 +0000 Subject: Include build-depends cache-keys as a list in hash factors Previous behaviour saved cache-keys by component path. If the path of a morph were modified, but not it's contents, the cache-keys of the components reverse-depends would change. Save the cache-keys of the build dependencies as a list instead, ignoring the path. --- ybd/cache.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ybd/cache.py b/ybd/cache.py index b12d0f3..473303c 100644 --- a/ybd/cache.py +++ b/ybd/cache.py @@ -90,9 +90,6 @@ def cache_key(dn): def hash_factors(dn): hash_factors = {'arch': app.config['arch']} - for factor in dn.get('build-depends', []): - hash_factors[factor] = cache_key(factor) - for factor in dn.get('contents', []): hash_factors[factor.keys()[0]] = cache_key(factor.keys()[0]) @@ -146,6 +143,15 @@ def hash_factors(dn): if dn.get('rpm-metadata'): hash_factors['rpm-metadata'] = dn['rpm-metadata'] + if artifact_version in range(0, 12): + for factor in dn.get('build-depends', []): + hash_factors[factor] = cache_key(factor) + else: + build_depends = [cache_key(bd) for bd in + dn.get('build-depends', [])] + if build_depends: + hash_factors['build-depends'] = build_depends + return hash_factors -- cgit v1.2.1 From 33a3553640bd2c502d8f591c79b1b6d913701077 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 13 Feb 2018 18:25:35 +0000 Subject: Add prefix to cache-key --- ybd/cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ybd/cache.py b/ybd/cache.py index 473303c..b4f5e27 100644 --- a/ybd/cache.py +++ b/ybd/cache.py @@ -152,6 +152,9 @@ def hash_factors(dn): if build_depends: hash_factors['build-depends'] = build_depends + if dn.get('prefix'): + hash_factors['prefix'] = dn['prefix'] + return hash_factors -- cgit v1.2.1 From 12035ff8bdaf949a65b21e700cc864b35ec0f4fe Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 13 Feb 2018 18:33:42 +0000 Subject: Bump artifact-version --- ybd/config/ybd.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ybd/config/ybd.conf b/ybd/config/ybd.conf index d9ac612..9b13936 100644 --- a/ybd/config/ybd.conf +++ b/ybd/config/ybd.conf @@ -65,7 +65,9 @@ aliases: # 9: (after 035c988e) fixed get_tree() to use sha if it exists, before ref # 10: (after 2bdd743) Add 'rpm-metadata' in cache-key # 11: (after bd721e8) Fix potentially incorrect checkout of ref instead of sha -artifact-version: 11 +# 12: (after b1eefba and 33a3553) build-depends file renames don't cause +# cache-key changes and cache_key now includes prefix +artifact-version: 12 # path to be used in default chroots for builds base-path: ['/usr/bin', '/bin', '/usr/sbin', '/sbin'] -- cgit v1.2.1