Skip to content

Commit

Permalink
Fix root_cache invalidation triggered by config changes
Browse files Browse the repository at this point in the history
The root_cache plugin assures that no new configuration file in the
`config_opts['config_paths']` list is newer than the root_cache cache
tarball, otherwise the caches are invalidated.

The bug is caused by use of improper set operation (union() doesn't
modify the calling object).
  • Loading branch information
praiskup committed Feb 14, 2024
1 parent dcc80f8 commit 2969e2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions mock/py/mockbuild/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,7 @@ def update_config_from_file(config_opts, config_file):
raise exception.ConfigError("Config error: {}: {}".format(config_file, str(exc)))

# this actually allows multiple inclusion of one file, but not in a loop
new_paths = set(config_opts["config_paths"])
new_paths.union(included_files)
new_paths = set(config_opts["config_paths"]) | included_files
config_opts["config_paths"] = list(new_paths)


Expand Down
6 changes: 6 additions & 0 deletions releng/release-notes-next/root_cache_invalidation.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The `root_cache` plugin is designed to invalidate the cache tarball anytime the
corresponding Mock configuration changes (any file in the list
`config_opts['config_paths']` changes). This cache invalidation mechanism had
been broken since Mock v3.2 when we rewrote the configuration file loader, and
broke the `config_opts['config_paths']`. The config loader has been fixed now,
and the cache invalidation works again as expected.

0 comments on commit 2969e2d

Please sign in to comment.