Commit Graph

7415 Commits

Author SHA1 Message Date
Frantisek Hrbata
792f0975dd feat(cmakev2/kconfig): add GENERATE_SDKCONFIG build property
Add a GENERATE_SDKCONFIG build property that controls whether kconfgen
writes the sdkconfig file (--output config) during the configuration
step. It defaults to 1 (enabled).

When building the bootloader as a subproject, the set of components
(and their Kconfig files) differs from the main project. Running
kconfgen with --output config in this context rewrites the main
project's sdkconfig. Even when the content is identical, the timestamp
update causes ninja to detect sdkconfig as newer than build.ninja
outputs (e.g. cmake_install.cmake), triggering an infinite CMake
re-run loop.

Setting GENERATE_SDKCONFIG to 0 in a subproject prevents this,
matching the behaviour of cmakev1's __OUTPUT_SDKCONFIG property.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Frantisek Hrbata
1c6414f21d feat(cmakev2/idf): add PROJECT_COMPONENTS_SOURCE build property
Add the PROJECT_COMPONENTS_SOURCE build property to control how project
components are categorised during component discovery.  By default it is
set to "project_components" (priority 3 - highest), preserving the
existing behaviour.

Setting it to "idf_components" (priority 0) before calling
idf_project_init() makes the project's built-in components overridable
by user-supplied components through EXTRA_COMPONENT_DIRS (priority 2).

This is needed for sub-projects like the bootloader, whose built-in
components (e.g. main) are provided by ESP-IDF and should be overridable
by user-supplied components placed in bootloader_components/.  The
cmakev1 build system allowed this override because it used a
last-one-wins strategy, but cmakev2 uses strict priority-based component
resolution where project_components always win.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Frantisek Hrbata
d8fcec199e feat(cmakev2/build): add ALL option to idf_build_binary and idf_sign_binary
Add an optional ALL parameter to idf_build_binary and idf_sign_binary
functions. When specified, the created custom target is included in the
default build target. Without ALL, custom targets created by these
functions are excluded from the default build (add_custom_target
behavior), meaning they won't be built unless explicitly requested or
depended upon by another target in ALL.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Frantisek Hrbata
a0b0ee562a feat(cmakev2/utilities): add idf_target_post_build_msg helper
Add a helper function for printing multi-line post-build messages on a
target. The message lines are joined with newlines, written to a file at
configure time, and printed at build time using a single cmake -E cat
command, replacing the need for repeated cmake -E echo invocations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Frantisek Hrbata
de156c9e5a feat(cmakev2/build): add idf_check_bootloader_size helper
Add a public API function to check that the bootloader binary does not
overlap the partition table, mirroring the existing idf_check_binary_size
pattern for application binaries.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Frantisek Hrbata
394b881708 fix(cmakev2/build): fix typo in idf_sign_binary keyfile variable
The KEYFILE argument value was stored in a misspelled variable
"keyfle" instead of "keyfile", causing custom keyfile paths to
be silently ignored.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Frantisek Hrbata
4185a9fed2 feat(cmakev2/compat): allow to set commonly required components
The commonly required components are configured solely for backward
compatibility with cmakev1. Since the bootloader build explicitly sets
commonly required components, we need to support this feature in cmakev2
as well. Ideally, there should be no commonly required components, and
each component should specify its requirements explicitly.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-04-27 22:07:10 +08:00
Roland Dobai
03aff7a53f Merge branch 'test/fix_cmakev2_import_lib_v6.0' into 'release/v6.0'
fix(cmakev2): propagate IDF_TOOLCHAIN selection to sdkconfig generation (v6.0)

See merge request espressif/esp-idf!47747
2026-04-27 16:06:04 +02:00
Roland Dobai
efb0ad6d05 Merge branch 'fix/cmake_quotations_v6.0' into 'release/v6.0'
Build & config: Quote variable references in conditional expressions (v6.0)

See merge request espressif/esp-idf!47738
2026-04-27 16:05:49 +02:00
Roland Dobai
997b9e82ef Merge branch 'fix/add-promptless-allowlist_v6.0' into 'release/v6.0'
fix(kconfig): Add KCONFIG_PROMPTLESS_NO_WARN to config.env.in (v6.0)

See merge request espressif/esp-idf!47916
2026-04-27 16:03:45 +02:00
Mahavir Jain
bd42cb2bde Merge branch 'fix/fix_esp_local_ctrl_potential_double_free_v6.0' into 'release/v6.0'
fix(esp_local_ctrl): fixes a potential double free (v6.0)

See merge request espressif/esp-idf!47488
2026-04-27 19:26:05 +05:30
Euripedes Rocha
c10c02297f Merge branch 'fix/remove_asio_v6.0' into 'release/v6.0'
fix(configs): Remove mentions of ASIO from configs files (v6.0)

See merge request espressif/esp-idf!47644
2026-04-27 15:52:03 +02:00
Fu Hanxi
73a66e0f4a Merge branch 'ci/fix-exclude-dir-check-build-test-rules_v6.0' into 'release/v6.0'
ci: fix check-build-test-rules exclude-dir (v6.0)

See merge request espressif/esp-idf!47087
2026-04-27 15:32:41 +02:00
Fu Hanxi
3132b2edb1 Merge branch 'ci/eco-to-rev_v6.0' into 'release/v6.0'
ci: rename eco tags to revision (v6.0)

See merge request espressif/esp-idf!47085
2026-04-27 15:31:16 +02:00
Jan Beran
645aa9735c fix(kconfig): add KCONFIG_PROMPTLESS_NO_WARN to config.env.in
Some config options, like IDF_TARGET, are present in
sdkconfig.defaults even though they are promptless. The build system
handles them manually and passes them to esp-idf-kconfig via
config.env. However, esp-idf-kconfig reports them like a normal
promptless symbol, which causes confusion.

This commit adds KCONFIG_PROMPTLESS_NO_WARN — a semicolon-separated
list of config option names that, even though promptless, should be
excluded from the report.

Closes https://github.com/espressif/esp-idf/issues/18441
2026-04-24 09:17:51 +02:00
Ivan Grokhotkov
8c19b15608 change(version): Update version to 6.0.1 2026-04-22 22:54:06 +08:00
Roland Dobai
7aef45a869 fix(cmake): quote variable references in conditional expressions
Closes https://github.com/espressif/esp-idf/issues/18445
2026-04-20 17:22:54 +08:00
Sudeep Mohanty
0b6d4ce6be test(cmakev2): verify IDF_TOOLCHAIN is propagated to sdkconfig
Add a buildv2 test that reconfigures the test app with both GCC and
clang toolchains and asserts that the selected IDF_TOOLCHAIN value
is propagated to sdkconfig. The clang case is skipped when a clang
compiler is not available in PATH.
2026-04-17 15:38:25 +02:00
Sudeep Mohanty
d9d9d66227 fix(cmakev2): propagate IDF_TOOLCHAIN selection to sdkconfig generation
In the cmakev2 build framework, the selected toolchain was not
consistently propagated to sdkconfig generation. For clang builds,
this produced a configuration that was incompatible with the clang
toolchain and broke compilation.

Ensure the toolchain selection is observed consistently so sdkconfig
and component configuration reflect the intended toolchain for both
GCC and clang builds.

Made-with: Cursor
2026-04-17 15:35:30 +02:00
David Cermak
c69fb1bfe4 fix(configs): Remove mentions of ASIO from configs files 2026-04-17 16:14:53 +08:00
Ashish Sharma
28775ac4f6 fix(esp_local_ctrl): fixes a potential double free 2026-04-12 18:18:22 +08:00
Fu Hanxi
ad1d17a794 ci: rename eco tags to revision 2026-04-09 10:43:34 +02:00
Fu Hanxi
93d0cd348c ci: fix check-build-test-rules exclude-dir 2026-03-27 09:55:10 +01:00
Jiang Jiang Jian
c9dd3aca0b Merge branch 'fix/cmakev2_component_manager_disabled_v6.0' into 'release/v6.0'
fix(cmakev2): skip component manager flow when IDF_COMPONENT_MANAGER=0 (v6.0)

See merge request espressif/esp-idf!46954
2026-03-25 19:16:35 +08:00
Roland Dobai
7341f0564b feat(cmake): Create a merged hints database in the build directory 2026-03-24 19:23:22 +01:00
Frantisek Hrbata
4e767b9a26 test(cmakev2): add test for build with IDF_COMPONENT_MANAGER=0
Verify that setting IDF_COMPONENT_MANAGER=0 skips the component manager
flow entirely and produces a successful build. The test also asserts that
no "Component manager round" messages appear in the output, confirming
the manager loop is not entered.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-24 08:10:14 +01:00
Frantisek Hrbata
ede97294aa fix(cmakev2): skip component manager flow when IDF_COMPONENT_MANAGER=0
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>
2026-03-24 08:10:14 +01:00
Jiang Jiang Jian
94ace905b9 Merge branch 'feature/update_gdbstub_v6.0' into 'release/v6.0'
gdbstub: backport fixes (v6.0)

See merge request espressif/esp-idf!46200
2026-03-24 10:28:23 +08:00
Marius Vikhammer
e741963f13 Merge branch 'ci/common-components-release-v6.0' into 'release/v6.0'
ci: update build-test-rules to use common_components (v6.0)

See merge request espressif/esp-idf!45547
2026-03-23 09:31:28 +08:00
Frantisek Hrbata
fa14a9df47 Merge branch 'feat/cmakev2-backports-v6.0' into 'release/v6.0'
feat(cmakev2): sync pending v6.0 MRs for cmakev2

See merge request espressif/esp-idf!46778
2026-03-21 07:17:43 +01:00
igor.udot
e2a8bbe639 ci: update build-test-rules to use common_components 2026-03-20 15:53:26 +08:00
igor.udot
6a0c25afec ci(sort_yaml): add mock common components 2026-03-20 15:53:26 +08:00
Frantisek Hrbata
8ed25711ac fix(cmakev2): remove stale test CMakeLists.txt missed by cherry-pick
The cherry-pick in the backport of \!46287 (test/buildv2_pytest_build_v6.0)
dropped the deletion of tools/cmakev2/test/CMakeLists.txt. The original MR
deleted all 15 files from the tools/cmakev2/test/ directory, but the
cherry-pick only captured 14 deletions. This commit removes the missed file.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
ecdaae279f test(cmakev2): Remove old cmakev2/test directory, now replaced by buildv2 pytest suite
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
e945cf4542 test(cmakev2): Add pytest test for multi-binary build support
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
88bf72287d test(cmakev2): Add pytest tests for v1-to-v2 migration and utility APIs
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
cbdafbe8ed test(cmakev2): Assert ELF output in Linux target build test
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
03f8206021 test(cmakev2): Expand pytest tests for v2 Kconfig and sdkconfig behavior
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
93b9873b24 test(cmakev2): Add pytest tests for v2 component model
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
1fe8175099 test(cmakev2): Add pytest tests for build APIs
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
3ebada72a6 test(cmakev2): Add pytest tests for project APIs 2026-03-20 08:16:52 +01:00
Sudeep Mohanty
7b37db5276 test(cmakev2): Add placeholder hooks to buildv2_test_app
Made-with: Cursor
2026-03-20 08:16:52 +01:00
Frantisek Hrbata
53b684c00d fix(cmakev2/project): export build properties as variables for project_include.cmake
In cmake v1, __build_process_project_includes() exports all build
properties as CMake variables before including project_include.cmake
files. cmakev2 was missing this step, causing components like ULP that
reference build properties as CMake variables (e.g. ${SDKCONFIG_HEADER})
to receive empty values.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-20 08:16:52 +01:00
Frantisek Hrbata
cdbc0244e0 fix(cmakev2/kconfig): add public aliases for sdkconfig output properties
The cmakev2 kconfig module sets sdkconfig output paths using internal
property names (__SDKCONFIG_HEADER, __SDKCONFIG_CMAKE, etc.), but
components like ULP read the public names (SDKCONFIG_HEADER,
SDKCONFIG_CMAKE). This results in empty values being passed to the ULP
sub-project, causing its CMake configure step to fail.

Add public aliases matching the cmake v1 property names for backward
compatibility.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-20 08:16:52 +01:00
Sudeep Mohanty
700c86d0c9 fix(cmakev2): Defer idf_component_optional_requires linking to library build time
This commit introduces a new build property, __OPTIONAL_REQUIRES_MODE,
and uses it to either defer or link immediately, optional requirements
to components that request such linkage via the
idf_component_optional_requires() function in build system v2. The
DEFERRED mode is intended for single-binary projects where in the linking
of optional components happens after the library target is created the
dependency graph is available to the build system, thereby allowing it to
behave like the v1 version of the function.
2026-03-20 08:13:27 +01:00
Sudeep Mohanty
88bd665422 test(cmakev2): add POST_ELF build event callback test 2026-03-20 08:13:27 +01:00
Sudeep Mohanty
ded543e561 feat(cmakev2): Add build event callback framework for components
Introduce a callback mechanism that lets components register CMake
functions to be called at specific points in the build lifecycle.

Currently, this framework only supports registering callbacks to be
called after the executable target is created, i.e, the POST_ELF phase
of the build but before the binary target is created.
2026-03-20 08:13:27 +01:00
Sudeep Mohanty
2ebd9c19b7 test(buildv2): enable test_cmake.py for cmakev2
Add buildv2 path and option handling for idf_as_lib, import_lib, and
related tests. Use cmakev2 examples when running with buildv2.
2026-03-20 08:13:27 +01:00
Sudeep Mohanty
735a2b2f21 test(buildv2): skip test_post_elf_dependency for cmakev2
Post-ELF dependency API is not used in cmakev2; component callback method
replaces this. Skip the test when running buildv2.
2026-03-20 08:13:27 +01:00
Sudeep Mohanty
b9de1d70c0 test(buildv2): skip test_spaces bundles not yet ported to buildv2 2026-03-20 08:13:27 +01:00