mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
ede97294aa
When the component manager is disabled via IDF_COMPONENT_MANAGER=0, the cmakev2 build system still entered the full component manager flow (__fetch_components_from_registry), which called __download_managed_component(). That function returned early with result=0 without creating the expected output file, violating the post-condition in __download_component_level_managed_components() that checks result==0 => file exists, causing a fatal error. Instead of patching the low-level function to write an empty stub file, this commit properly skips the entire component manager flow when the manager is disabled: - Move __init_component_manager() to idf.cmake global initialization sequence alongside other __init_*() calls, so IDF_COMPONENT_MANAGER build property is available early. - Set __SDKCONFIG_ORIG to the real sdkconfig path in __init_kconfig() as its default value. Previously it was only set inside __create_sdkconfig_orig_copy() and had a defensive fallback in __create_base_kconfgen_command(). The default ensures __SDKCONFIG_ORIG is always valid regardless of whether the component manager runs. - Guard __create_sdkconfig_orig_copy() with an IDF_COMPONENT_MANAGER check. The sdkconfig backup exists solely to preserve unknown Kconfig options from managed components during intermediate kconfgen rounds. When the manager is disabled, no managed components exist, so the backup is unnecessary. - Guard __fetch_components_from_registry() call in project.cmake behind IDF_COMPONENT_MANAGER == 1. When disabled, only the manifest warning is issued. No download loop runs, no temp files are created, and no "Component manager round N..." messages are printed. - Remove the now-redundant IDF_COMPONENT_MANAGER guard from __download_managed_component(), since it is only reachable when the manager is enabled. Closes https://github.com/espressif/esp-idf/issues/18372 Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>