From d6a19d976b699e0b230b2e6c8fdd11a0c832ae83 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 26 Oct 2021 13:18:59 +0200 Subject: kconfig loader: load kconfig from its base directory this ensures that source statements are handled correctly --- lib/loader/kconfig.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/loader') diff --git a/lib/loader/kconfig.py b/lib/loader/kconfig.py index 631892f..42181c9 100644 --- a/lib/loader/kconfig.py +++ b/lib/loader/kconfig.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from .. import kconfiglib +from dfatool.utils import cd from frozendict import frozendict import json import os @@ -20,7 +21,10 @@ class KConfigAttributes: elif os.path.exists(config_path): failed_experiments.append(config_path) - kconf = kconfiglib.Kconfig(kconfig_path) + kconfig_dir = "/".join(kconfig_path.split("/")[:-1]) + + with cd(kconfig_dir): + kconf = kconfiglib.Kconfig(kconfig_path) self.kconf = kconf self.kconfig_hash = self.file_hash(kconfig_path) -- cgit v1.2.3