From fb06101b9f9330485f506707a42435f4d5d71660 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Tue, 24 Sep 2024 18:58:14 +0200 Subject: [PATCH] Fix recursive dependencies for cross referencing Signed-off-by: Gabor Mezei --- tests/scripts/depends.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/scripts/depends.py b/tests/scripts/depends.py index 7d107323b6..1d00a01ab8 100755 --- a/tests/scripts/depends.py +++ b/tests/scripts/depends.py @@ -387,15 +387,23 @@ defines to be altered. """ def turn_off_dependencies(config_settings): """For every option turned off config_settings, also turn off what depends on it. -An option O is turned off if config_settings[O] is False.""" + + An option O is turned off if config_settings[O] is False. + Handle the dependencies recursively. + """ for key, value in sorted(config_settings.items()): if value is not False: continue + + # Save the processed settings to handle cross referencies revdep = set(REVERSE_DEPENDENCIES.get(key, [])) + history = set() while revdep: dep = revdep.pop() + history.add(dep) config_settings[dep] = False - revdep.update(REVERSE_DEPENDENCIES.get(dep, [])) + # Do not add symbols which are already processed + revdep.update(set(REVERSE_DEPENDENCIES.get(dep, [])) - history) class BaseDomain: # pylint: disable=too-few-public-methods, unused-argument """A base class for all domains."""