When minimal build is enabled, it only includes the main component and
its dependencies. This leads to test components specified through
TEST_COMPONENTS being ignored, meaning no tests are executed. The issue
arises because test components are also checked against the COMPONENTS
variable, and if they aren't listed there, they are disregarded. To fix
this, explicitly add TEST_COMPONENTS to COMPONENTS when the minimal
build is enabled.
Closes https://github.com/espressif/esp-idf/issues/15485
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
With MINIMAL_BUILD enabled, menuconfig will only display configuration
options for components included in the build through main component
dependencies. This means that configuration options for excluded
components will not appear in menuconfig. This might be confusing, as
most examples currently do not use a trimmed build, and all components
detected by the build system are available in menuconfig, even if their
configuration has no effect because the components may not be linked or
used. Adding a note in the components menu of menuconfig could help
users realize they need to add a component to the main component
requirements to see its configuration options. Unfortunately, Kconfig
does not support multiline comments, so there are three separate
comments intended to adequately describe the potentially missing
component configurations.
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
Introduce a MINIMAL_BUILD property to streamline the build process by
including only the main component and its direct and indirect
dependencies. This serves as a convenient shortcut for using
set(COMPONENTS main). The MINIMAL_BUILD build property is ignored if the
COMPONENTS variable is defined, as COMPONENTS takes precedence.
To enable a minimal build, add "idf_build_set_property(MINIMAL_BUILD ON)"
to the project's CMake configuration.
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This feature is useful for 3rd-party software to run GDB with predefined
options that described in project_description.json file
allow to pass custom options to "idf.py gdb":
--gdb-commands: command line arguments for gdb. (without changes)
-ex: pass command to gdb.
-x: pass gdbinit file to gdb. Alias for old --gdbinit command
By default, esp-idf-size.ng displays all sections individually. This can
be confusing, especially if CONFIG_SOC_MEM_NON_CONTIGUOUS_SRAM is
enabled, resulting in sections like .dram0.data and .dram1.data being
abbreviated as two .data sections in the size report. To avoid confusion
for idf.py and cmake users, pass the --unify option to the underlying
esp_idf_size.ng by default.
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
While 'component_properties_text'
correctly accumulated properties from all processed components, each
iteration of the loop was overwriting the entire file content.
Move the file(WRITE ...) call outside the loop to ensure all accumulated
component properties are written once, preserving information for all
components.
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.
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>
The -Werror=all activates error for all warnings in -Wall, however, it
does not activate error for other default warnings, such as:
- int-conversion (pointer from integer w/o a cast)
- incompatible-pointer-types
- discarded-qualifiers
Which are IMO even more important that -Wall.
This commit fixes that by activating error for all warnings (i.e. from
-Wall and default ones) and removing those from -Wextra, as the culprit
commit seemed to address.
Fixes: 60f29236f6 "Build system: Raise warning level" (2016-11-16)
In order to avoid long analysis during esp-idf upgrade, provide a way to
restore the previous -Werror=all behavior that consider only warnings
from -Wall (and not default ones).
Also add a hint to use the Kconfig option on compilation error, but warn
that fixing the code is the preferred way.
Merges https://github.com/espressif/esp-idf/pull/11239
Suggested-By: Ivan Grokhotkov <ivan@espressif.com>
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>
This adds a possibility to specify --diff option to idf.py size,
size-components and size-files commands. This can be map file directly,
project directory or build directory.
Usage example:
idf.py size-components --diff ../hello_world2/build/hello_world.map
idf.py size-components --diff ../hello_world2/build
idf.py size-components --diff ../hello_world2
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
For Linux builds if the embedded data length exceeded 16-bit value then
the build used to fail with following error:
build/x509_crt_bundle.S: Assembler messages:
build/x509_crt_bundle.S:4201: Warning: value 0x1056e truncated to 0x56e
GNU ASM for X86 systems treats .word attribute as of size 2 bytes, this commit
uses .long attribute to take the size to 4 bytes.
This commit enables the standad VERSION argument for the project() macro
in ESP-IDF. The VERSION argument is compilant with the requirements of
cmake 3.16. This commit also adds new test cases for verifying the
validity of the version argument.
Merges https://github.com/espressif/esp-idf/pull/12461
Co-authored-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>