diff --git a/doc/conf.py b/doc/conf.py index c6b0006f21a20ccbc1397f83ffdc41deb8caa8b9..146f5f861aaf8821575242503c3f4a35c263f920 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -308,7 +308,11 @@ def prepare(home, enable_plots, outdir): get_obj_name(f): f for f in get_plot_methods() } - dir_cache = DirCache('doc_plots', populate=populate) + dir_cache = DirCache( + 'doc_plots', + populate=populate, + fmt_version='1', + ) key = ( sorted(plot_methods.keys()), notebooks, diff --git a/lisa/_kmod.py b/lisa/_kmod.py index 60ecd58e31bbe51cd9aa9206cb8b8fc5af441cbd..c692421f7ece907f4d933bb5f3a83b0bdf0dfe62 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -2433,6 +2433,7 @@ class _KernelBuildEnv(Loggable, SerializeViaConstructor): dir_cache = DirCache( category='kernels_overlays', populate=populate, + fmt_version='1', ) cache_path = dir_cache.get_entry(key) with _overlay_folders([base_path, cache_path], backend=overlay_backend, copy_filter=copy_filter) as path: @@ -3081,6 +3082,7 @@ class DynamicKmod(Loggable): dir_cache = DirCache( category='kernel_modules', populate=populate, + fmt_version='1', ) cache_path = dir_cache.get_entry(key) with open(cache_path / 'mod.ko', 'rb') as f: diff --git a/lisa/target.py b/lisa/target.py index 6a6250f4eca67c3254c49c93a7cbbe559f6ccf81..3855bc2cacb043d84c02e7b75a5b300cd72b5d28 100644 --- a/lisa/target.py +++ b/lisa/target.py @@ -517,6 +517,7 @@ class Target( dir_cache = DirCache( category='target_pull', populate=populate, + fmt_version='1', ) src = Path(src) diff --git a/lisa/utils.py b/lisa/utils.py index 8622e219e797f33147b856c36fd10783514e1843..969fce5f9128a364fdbc32d80279d756060da397 100644 --- a/lisa/utils.py +++ b/lisa/utils.py @@ -4095,6 +4095,12 @@ class DirCache(Loggable): base = _UNVERSIONED_CACHE_HOME if fmt_version else LISA_CACHE_HOME base = Path(base) / category + if fmt_version is None: + warnings.warn( + 'DirCache(..., fmt_version=...) must be set as lisa.version.VERSION_TOKEN is not reliable.', + DeprecationWarning + ) + self._fmt_version = fmt_version self._base = base self._populate = populate or (lambda *args, **kwargs: None)