From 40c046c91cb7acc6ae571bdeddba07013caee055 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Sun, 10 Aug 2025 19:59:26 +0200 Subject: [PATCH] fix(test_build_system): pop SDKCONFIG_DEFAULTS from the environment The test for guessing the target from the SDKCONFIG_DEFAULTS environment variable is not cleaning up after itself, leaving the SDKCONFIG_DEFAULTS environment variable set. The subsequent test performs target guessing from SDKCONFIG_DEFAULTS passed to cmake with the -D option. The SDKCONFIG_DEFAULTS environment variable should take precedence over the SDKCONFIG_DEFAULTS cmake variable. This is correctly handled in cmakev2 , but in cmakev1, the SDKCONFIG_DEFAULTS cmake variable is used even if the SDKCONFIG_DEFAULTS environment variable is set. This appears to be a bug or at least an inconsistency in cmakev1. Signed-off-by: Frantisek Hrbata --- tools/test_build_system/test_non_default_target.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test_build_system/test_non_default_target.py b/tools/test_build_system/test_non_default_target.py index 3215b720dbd..ce9dc33f0e0 100644 --- a/tools/test_build_system/test_non_default_target.py +++ b/tools/test_build_system/test_non_default_target.py @@ -191,6 +191,7 @@ def test_target_guessing(idf_py: IdfPyFunc, test_app_copy: Path, default_idf_env idf_py('reconfigure') assert file_contains('sdkconfig', 'CONFIG_IDF_TARGET="{}"'.format(ESP32S2_TARGET)) assert file_contains('build/CMakeCache.txt', 'IDF_TARGET:STRING={}'.format(ESP32S2_TARGET)) + default_idf_env.pop('SDKCONFIG_DEFAULTS') logging.info('Can guess target from SDKCONFIG_DEFAULTS using -D') (test_app_copy / 'sdkconfig3').write_text('CONFIG_IDF_TARGET="{}"'.format(ESP32S2_TARGET))