feat(tools): generate kconfig.in files for components not included in the build

To generate a complete configuration for all discovered components, we
need to ensure that even kconfig files for the excluded components are
seen by Kconfig. Modify the prepare_kconfig_files.py script to generate
files that list the Kconfig files for excluded components. These files
are sourced in the root Kconfig using the
COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE and
COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE environment variables.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-11-04 07:48:13 +01:00
parent 3e36d75eba
commit 432306bb38
+13 -14
View File
@@ -19,14 +19,14 @@ def _prepare_source_files(env_dict: dict[str, str], list_separator: str) -> None
- COMPONENT_KCONFIGS_SOURCE_FILE,
- COMPONENT_KCONFIGS_PROJBUILD,
- COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE,
- COMPONENT_KCONFIGS_EXCLUDED, (TODO: Currently disabled)
- COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED. (TODO: Currently disabled)
- COMPONENT_KCONFIGS_EXCLUDED,
- COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED,
The outputs are written into files pointed by the value of
- COMPONENT_KCONFIGS_SOURCE_FILE,
- COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE,
- COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE, (TODO: Currently disabled)
- COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE, (TODO: Currently disabled)
- COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE,
- COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE,
After running this function, all source files will contain a list of source statements based on the
content of their corresponding environment variables. For example, if COMPONENT_KCONFIGS="var1;var2;var3" and
@@ -68,16 +68,15 @@ def _prepare_source_files(env_dict: dict[str, str], list_separator: str) -> None
_write_source_file(
env_dict['COMPONENT_KCONFIGS_PROJBUILD'], env_dict['COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE']
)
# TODO: Enable excluded Kconfig processing once integration is complete
# Currently commented out due to FileNotFoundError when paths are empty during CI tests
# _write_source_file(
# env_dict['COMPONENT_KCONFIGS_EXCLUDED'],
# env_dict['COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE']
# )
# _write_source_file(
# env_dict['COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED'],
# env_dict['COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE'],
# )
if env_dict.get('COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE'):
_write_source_file(
env_dict['COMPONENT_KCONFIGS_EXCLUDED'], env_dict['COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE']
)
if env_dict.get('COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE'):
_write_source_file(
env_dict['COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED'],
env_dict['COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE'],
)
except KeyError as e:
print('Error:', e, 'is not defined!')
sys.exit(1)