19 Commits

Author SHA1 Message Date
Daniel Paul 166bdcee87 fix: test_project_components_overrides_extra_components 2026-04-01 17:22:17 +02:00
Sudeep Mohanty 13830bcaff fix(cmakev2): Skip test_minimal_build_without_main_component for cmakev2
Build System v2 does not support the MINIMAL_BUILD property hence the
test test_minimal_build_without_main_component is not applicable for
cmakev2.
2026-02-16 17:42:37 +01:00
Frantisek Hrbata 795904a41c fix(build): ensure the main component exists when MINIMAL_BUILD is enabled
The minimal build property is simply a shorthand for `set(COMPONENTS
main)`. The issue is that there is currently no check to verify whether
the `main` component actually exists or is known to the build system.
If the `main` component is not present, print an error message along
with suggestions on how to fix this inconsistency.

Closes https://github.com/espressif/esp-idf/issues/18219

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-02-10 03:36:48 +08:00
Sudeep Mohanty 6a4d6eb6ac test(cmakev2): Enabled component validation tests for cmakev2 2025-12-18 13:54:18 +01:00
Frantisek Hrbata 1139551fde fix(test_build_system): disable tests related to outside component dependencies
The commit adb2d5deee ("feat(cmake): Produce warnings when component dependen..")
introduced additional checks for source files and include directories
used by a component that are located outside the component's directory.
If these files and directories belong to another component, a warning is
issued. This feature has not yet been implemented in cmakev2, so related
tests are temporary disabled.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 84e65e5d24 feat(cmakev2): Enable test_components.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty bb3ce41141 feat(cmakev2): ruff formatting changes for test_components.py 2025-10-30 17:17:49 +08:00
Roland Dobai adb2d5deee feat(cmake): Produce warnings when component dependencies are not defined
There are idf.py hints for helping the user to set component
dependencies properly instead of building sources out-of-component or
including headers from outside the component directory. These are
produced with
tools/idf_py_actions/hint_modules/component_requirements.py.

However, idf.py hints are printed only when the build fails. If the user
starts with a buildable solution then the suggestions to add component
dependencies are not printed.

This commit introduces cmake-level warnings for building source files
from outside the component and including header files without setting up
proper component dependencies.
2025-09-24 13:43:23 +02:00
Roland Dobai c3729929a8 change(tools): Fix pre-commit checks for test_components.py 2025-09-24 13:43:23 +02:00
Fu Hanxi 6ff7947fef feat: add component_source property to component targets 2024-09-30 18:14:04 +08:00
Ivan Grokhotkov c521fcb6fd fix(cmake): report correct error on unknown component name
Previously the error message was

CMake Error at /home/user/esp-idf/tools/cmake/build.cmake:296 (__component_get_property):
  __component_get_property Function invoked with incorrect arguments for
  function named: __component_get_property
Call Stack (most recent call first):
  /home/user/esp-idf/tools/cmake/build.cmake:341 (__build_resolve_and_add_req)
  /home/user/esp-idf/tools/cmake/build.cmake:638 (__build_expand_requirements)
  /home/user/esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:6 (project)

Now it will be:

CMake Error at /home/user/esp-idf/tools/cmake/build.cmake:298 (message):
  Failed to resolve component 'whatever' required by component 'main'.
Call Stack (most recent call first):
  /home/user/esp-idf/tools/cmake/build.cmake:345 (__build_resolve_and_add_req)
  /home/user/esp-idf/tools/cmake/build.cmake:642 (__build_expand_requirements)
  /home/user/esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:6 (project)

Also improved the hint to show the component name in quotes.
2024-08-12 17:54:44 +02:00
gojimmypi f6a852e1cf fix(cmake): check for missing component_target
Closes https://github.com/espressif/esp-idf/pull/14036

[Frantisek Hrbata: fixed spelling not related to this change so spellcheck succeeds]
[Frantisek Hrbata: modified the error message to be recognized by the existing hint]
[Frantisek Hrbata: added also check in idf_component_set_property and simple tests]
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-07-11 18:33:41 +02:00
Frantisek Hrbata fbe8bf89ee fix: properly resolve component dependencies
There is currently a bug in the __build_resolve_and_add_req function in
tools/cmake/build.cmake where the check for registered component
requirements is incorrectly applied to the component itself rather than
its dependencies. This issue likely originated from a typo, using
component_target instead of _component_target. To prevent further
confusion, _component_target has been renamed to _req_target.

Fixing this revealed multiple incorrect dependencies for the Linux
target, which have now been resolved by explicitly specifying the
dependencies for the Linux target.

Closes https://github.com/espressif/esp-idf/issues/13447

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-30 22:01:55 +08:00
Marek Fiala 52da5b765f feat(tools): Run skipped build system pytests on Win 2024-02-08 11:23:51 +01:00
Marek Fiala 04ade501aa feat(tools): Disable failing build system tests on Windows runner 2023-11-29 23:10:38 +01:00
Marek Fiala f4e3c9c03a refactor(tools): Rewrite build system unit tests to python
Rewritten parts:
 - git
 - version
 - build
2023-07-18 15:51:04 +02:00
Marek Fiala 5033637899 Tools: Rewrite build system unit tests to python - partitions, components, docs 2023-06-14 12:17:53 +00:00
Marek Fiala fb0dc46183 Tools: Rewrite build system unit tests to python - sdkconfig, bootloader, components 2023-05-23 09:47:39 +00:00
Marek Fiala b4446e1748 Tools: Rewrite build system unit tests to python - cmake libraries and Kconfig 2023-03-28 11:20:42 +02:00