mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/default_components_for_component_manager_v4.4' into 'release/v4.4'
build & config: Don't include common components on early expansion (v4.4) See merge request espressif/esp-idf!22371
This commit is contained in:
commit
bff43a1b6f
@ -102,8 +102,8 @@ repos:
|
||||
name: Check type annotations in python files
|
||||
entry: tools/ci/check_type_comments.py
|
||||
additional_dependencies:
|
||||
- 'mypy==0.800'
|
||||
- 'mypy-extensions==0.4.3'
|
||||
- 'mypy==1.0.1'
|
||||
- 'mypy-extensions==1.0.0'
|
||||
exclude: >
|
||||
(?x)^(
|
||||
.*_pb2.py
|
||||
|
@ -1017,7 +1017,9 @@ Custom sdkconfig defaults
|
||||
|
||||
For example projects or other projects where you don't want to specify a full sdkconfig configuration, but you do want to override some key values from the ESP-IDF defaults, it is possible to create a file ``sdkconfig.defaults`` in the project directory. This file will be used when creating a new config from scratch, or when any new config value hasn't yet been set in the ``sdkconfig`` file.
|
||||
|
||||
To override the name of this file or to specify multiple files, set the ``SDKCONFIG_DEFAULTS`` environment variable or set ``SDKCONFIG_DEFAULTS`` in top-level CMakeLists.txt. If specifying multiple files, use semicolon as the list separator. File names not specified as full paths are resolved relative to current project.
|
||||
To override the name of this file or to specify multiple files, set the ``SDKCONFIG_DEFAULTS`` environment variable or set ``SDKCONFIG_DEFAULTS`` in top-level ``CMakeLists.txt``. File names that are not specified as full paths are resolved relative to current project's diretory.
|
||||
|
||||
When specifying multiple files, use a semicolon as the list separator. Files listed first will be applied first. If a particular key is defined in multiple files, the definition in the latter file will overide definitions from former files.
|
||||
|
||||
Some of the IDF examples include a ``sdkconfig.ci`` file. This is part of the continuous integration (CI) test framework and is ignored by the normal build process.
|
||||
|
||||
@ -1398,10 +1400,12 @@ These are properties that describe a component. Values of component properties c
|
||||
- KCONFIG - component Kconfig file; set by ``idf_build_component``
|
||||
- KCONFIG_PROJBUILD - component Kconfig.projbuild; set by ``idf_build_component``
|
||||
- LDFRAGMENTS - list of component linker fragment files; set from ``idf_component_register`` LDFRAGMENTS argument
|
||||
- MANAGED_PRIV_REQUIRES - list of private component dependencies added by the IDF component manager from dependencies in ``idf_component.yml`` manifest file
|
||||
- MANAGED_REQUIRES - list of public component dependencies added by the IDF component manager from dependencies in ``idf_component.yml`` manifest file
|
||||
- PRIV_INCLUDE_DIRS - list of component private include directories; set from ``idf_component_register`` PRIV_INCLUDE_DIRS on components of type LIBRARY
|
||||
- PRIV_REQUIRES - list of private component dependentices; set from ``idf_component_register`` PRIV_REQUIRES argument
|
||||
- PRIV_REQUIRES - list of private component dependentices; set from value of ``idf_component_register`` PRIV_REQUIRES argument and dependencies in ``idf_component.yml`` manifest file
|
||||
- REQUIRED_IDF_TARGETS - list of targets the component supports; set from ``idf_component_register`` EMBED_TXTFILES argument
|
||||
- REQUIRES - list of public component dependencies; set from ``idf_component_register`` REQUIRES argument
|
||||
- REQUIRES - list of public component dependencies; set from value of ``idf_component_register`` REQUIRES argument and dependencies in ``idf_component.yml`` manifest file
|
||||
- SRCS - list of component source files; set from SRCS or SRC_DIRS/EXCLUDE_SRCS argument of ``idf_component_register``
|
||||
|
||||
.. _cmake-file-globbing:
|
||||
@ -1600,6 +1604,7 @@ No Longer Necessary
|
||||
|
||||
- In the legacy Make-based build system, it is required to also set ``COMPONENT_SRCDIRS`` if ``COMPONENT_SRCS`` is set. In CMake, the equivalent is not necessary i.e. specifying ``SRC_DIRS`` to ``idf_component_register`` if ``SRCS`` is also specified (in fact, ``SRCS`` is ignored if ``SRC_DIRS`` is specified).
|
||||
|
||||
|
||||
Flashing from make
|
||||
------------------
|
||||
|
||||
|
@ -1017,7 +1017,9 @@ ExternalProject 的依赖与构建清理
|
||||
|
||||
对于示例工程或者其他您不想指定完整 sdkconfig 配置的项目,但是您确实希望覆盖 ESP-IDF 默认值中的某些键值,则可以在项目中创建 ``sdkconfig.defaults`` 文件。重新创建新配置时将会用到此文件,另外在 ``sdkconfig`` 没有设置新配置值时,上述文件也会被用到。
|
||||
|
||||
如若需要覆盖此文件的名称或指定多个文件,请设置 ``SDKCONFIG_DEFAULTS`` 环境变量或在顶层 CMakeLists.txt 文件中设置 ``SDKCONFIG_DEFAULTS``。在指定多个文件时,使用分号作为分隔符。未指定完整路径的文件名将以当前项目的相对路径来解析。
|
||||
如若需要覆盖此文件的名称或指定多个文件,请设置 ``SDKCONFIG_DEFAULTS`` 环境变量或在顶层 CMakeLists.txt 文件中设置 ``SDKCONFIG_DEFAULTS``。非绝对路径的文件名将以当前项目的相对路径来解析。
|
||||
|
||||
在指定多个文件时,使用分号作为分隔符。先列出的文件将会先应用。如果某个键值在多个文件里定义,后面文件的定义会覆盖前面文件的定义。
|
||||
|
||||
一些 IDF 示例中包含了 ``sdkconfig.ci`` 文件。该文件是 CI(持续集成)测试框架的一部分,在正常构建过程中会被忽略。
|
||||
|
||||
@ -1026,7 +1028,9 @@ ExternalProject 的依赖与构建清理
|
||||
|
||||
除了 ``sdkconfig.defaults`` 之外,构建系统还将从 ``sdkconfig.defaults.TARGET_NAME`` 文件加载默认值,其中 ``IDF_TARGET`` 的值为 ``TARGET_NAME``。例如,对于 ``ESP32`` 这个硬件目标,sdkconfig 的默认值会首先从 ``sdkconfig.defaults`` 获取,然后再从 ``sdkconfig.defaults.esp32`` 获取。
|
||||
|
||||
如果使用 ``SDKCONFIG_DEFAULTS`` 覆盖了 sdkconfig 默认文件的名称,则硬件目标的 sdkconfig 默认文件名也会从 ``SDKCONFIG_DEFAULTS`` 值中派生。
|
||||
如果使用 ``SDKCONFIG_DEFAULTS`` 覆盖默认文件的名称,则硬件目标的默认文件名也会从 ``SDKCONFIG_DEFAULTS`` 值中派生。如果 ``SDKCONFIG_DEFAULTS`` 中有多个文件,硬件目标文件会在引入该硬件目标文件的文件之后应用, 而 ``SDKCONFIG_DEFAULTS`` 中所有其它后续文件则会在硬件目标文件之后应用 。
|
||||
|
||||
例如,如果 ``SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig_devkit1"``,并且在同一文件夹中有一个 ``sdkconfig.defaults.esp32`` 文件,那么这些文件将按以下顺序应用:(1) sdkconfig.defaults (2) sdkconfig.defaults.esp32 (3) sdkconfig_devkit1。
|
||||
|
||||
.. _flash_parameters:
|
||||
|
||||
@ -1299,6 +1303,7 @@ idf 构建属性
|
||||
- EXECUTABLE - 项目可执行文件;通过调用 ``idf_build_executable`` 设置。
|
||||
- EXECUTABLE_NAME - 不含扩展名的项目可执行文件的名称;通过调用 ``idf_build_executable`` 设置。
|
||||
- EXECUTABLE_DIR - 输出的可执行文件的路径
|
||||
- IDF_COMPONENT_MANAGER - 默认启用组件管理器,但如果设置这个属性为`0``,则会被 IDF_COMPONENT_MANAGER 环境变量禁用。
|
||||
- IDF_PATH - ESP-IDF 路径;由 IDF_PATH 环境变量设置,或者从 ``idf.cmake`` 的位置推断。
|
||||
- IDF_TARGET - 构建的目标芯片;由 ``idf_build_process`` 的目标参数设置。
|
||||
- IDF_VER - ESP-IDF 版本;由版本文件或 IDF_PATH 仓库的 Git 版本设置。
|
||||
@ -1397,10 +1402,12 @@ idf 组件属性
|
||||
- KCONFIG - 组件 Kconfig 文件;由 ``idf_build_component`` 设置。
|
||||
- KCONFIG_PROJBUILD - 组件 Kconfig.projbuild;由 ``idf_build_component`` 设置。
|
||||
- LDFRAGMENTS - 组件链接器片段文件列表;由 ``idf_component_register`` LDFRAGMENTS 参数设置。
|
||||
- MANAGED_PRIV_REQUIRES - IDF 组件管理器从``idf_component.yml``清单文件中的依赖关系中添加的私有组件依赖关系列表。
|
||||
- MANAGED_REQUIRES - IDF 组件管理器从 ``idf_component.yml`` 清单文件的依赖关系中添加的公共组件依赖关系列表。
|
||||
- PRIV_INCLUDE_DIRS - 组件私有 include 目录列表;在 LIBRARY 类型的组件 ``idf_component_register`` PRIV_INCLUDE_DIRS 参数中设置。
|
||||
- PRIV_REQUIRES - 私有组件依赖关系列表;由 ``idf_component_register`` PRIV_REQUIRES 参数设置。
|
||||
- PRIV_REQUIRES - 私有组件依赖关系列表;根据 ``idf_component_register`` PRIV_REQUIRES 参数的值以及 ``idf_component.yml`` 清单文件中的依赖关系设置。
|
||||
- REQUIRED_IDF_TARGETS - 组件支持的目标列表;由 ``idf_component_register`` EMBED_TXTFILES 参数设置。
|
||||
- REQUIRES - 公共组件依赖关系列表;由 ``idf_component_register`` REQUIRES 参数设置。
|
||||
- REQUIRES - 公共组件依赖关系列表;根据 ``idf_component_register`` REQUIRES 参数的值以及 ``idf_component.yml`` 清单文件中的依赖关系设置。
|
||||
- SRCS - 组件源文件列表;由 ``idf_component_register`` 的 SRCS 或 SRC_DIRS/EXCLUDE_SRCS 参数设置。
|
||||
|
||||
.. _cmake-file-globbing:
|
||||
@ -1599,6 +1606,7 @@ CMake 中不可用的功能
|
||||
|
||||
在 CMake 构建系统中,如果设置了 ``COMPONENT_SRCS``,就不需要再设置 ``COMPONENT_SRCDIRS``。实际上,CMake 构建系统中如果设置了 ``COMPONENT_SRCDIRS``,那么 ``COMPONENT_SRCS`` 就会被忽略。
|
||||
|
||||
|
||||
从 Make 中烧录
|
||||
--------------
|
||||
|
||||
|
@ -17,7 +17,7 @@ cryptography>=2.1.4
|
||||
|
||||
pyparsing>=2.0.3,<2.4.0
|
||||
pyelftools>=0.22
|
||||
idf-component-manager~=1.0
|
||||
idf-component-manager~=1.2
|
||||
|
||||
gdbgui==0.13.2.0; python_version < "3.11"
|
||||
# 0.13.2.1 supports Python 3.6+ only
|
||||
|
@ -222,6 +222,15 @@ function(__build_expand_requirements component_target)
|
||||
|
||||
get_property(reqs TARGET ${component_target} PROPERTY REQUIRES)
|
||||
get_property(priv_reqs TARGET ${component_target} PROPERTY PRIV_REQUIRES)
|
||||
__component_get_property(component_name ${component_target} COMPONENT_NAME)
|
||||
__component_get_property(component_alias ${component_target} COMPONENT_ALIAS)
|
||||
idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
|
||||
list(APPEND reqs ${common_reqs})
|
||||
|
||||
if(reqs)
|
||||
list(REMOVE_DUPLICATES reqs)
|
||||
list(REMOVE_ITEM reqs ${component_alias} ${component_name})
|
||||
endif()
|
||||
|
||||
foreach(req ${reqs})
|
||||
__build_resolve_and_add_req(_component_target ${component_target} ${req} __REQUIRES)
|
||||
@ -438,10 +447,12 @@ macro(idf_build_process target)
|
||||
|
||||
# Call for the component manager to prepare remote dependencies
|
||||
idf_build_get_property(python PYTHON)
|
||||
idf_build_get_property(component_manager_interface_version __COMPONENT_MANAGER_INTERFACE_VERSION)
|
||||
execute_process(COMMAND ${python}
|
||||
"-m"
|
||||
"idf_component_manager.prepare_components"
|
||||
"--project_dir=${project_dir}"
|
||||
"--interface_version=${component_manager_interface_version}"
|
||||
"prepare_dependencies"
|
||||
"--local_components_list_file=${local_components_list_file}"
|
||||
"--managed_components_list_file=${managed_components_list_file}"
|
||||
|
@ -222,10 +222,17 @@ function(__component_get_requirements)
|
||||
idf_build_get_property(idf_component_manager IDF_COMPONENT_MANAGER)
|
||||
if(idf_component_manager EQUAL 1)
|
||||
idf_build_get_property(python PYTHON)
|
||||
idf_build_get_property(component_manager_interface_version __COMPONENT_MANAGER_INTERFACE_VERSION)
|
||||
|
||||
# Call for the component manager once again to inject dependencies
|
||||
# It modifies the requirements file generated by component_get_requirements.cmake script by adding dependencies
|
||||
# defined in component manager manifests to REQUIRES and PRIV_REQUIRES fields.
|
||||
# These requirements are also set as MANAGED_REQUIRES and MANAGED_PRIV_REQUIRES component properties.
|
||||
execute_process(COMMAND ${python}
|
||||
"-m"
|
||||
"idf_component_manager.prepare_components"
|
||||
"--project_dir=${project_dir}"
|
||||
"--interface_version=${component_manager_interface_version}"
|
||||
"inject_requirements"
|
||||
"--idf_path=${idf_path}"
|
||||
"--build_dir=${build_dir}"
|
||||
|
@ -43,6 +43,8 @@ endif()
|
||||
if(NOT "$ENV{IDF_COMPONENT_MANAGER}" EQUAL "0")
|
||||
idf_build_set_property(IDF_COMPONENT_MANAGER 1)
|
||||
endif()
|
||||
# Set component manager interface version
|
||||
idf_build_set_property(__COMPONENT_MANAGER_INTERFACE_VERSION 1)
|
||||
|
||||
#
|
||||
# Get the project version from either a version file or the Git revision. This is passed
|
||||
@ -408,8 +410,10 @@ macro(project project_name)
|
||||
__component_get_target(main_target idf::main)
|
||||
__component_get_property(reqs ${main_target} REQUIRES)
|
||||
__component_get_property(priv_reqs ${main_target} PRIV_REQUIRES)
|
||||
idf_build_get_property(common_reqs __COMPONENT_REQUIRES_COMMON)
|
||||
if(reqs STREQUAL common_reqs AND NOT priv_reqs) #if user has not set any requirements
|
||||
__component_get_property(managed_reqs ${main_target} MANAGED_REQUIRES)
|
||||
__component_get_property(managed_priv_reqs ${main_target} MANAGED_PRIV_REQUIRES)
|
||||
#if user has not set any requirements, except ones added with the component manager
|
||||
if((NOT reqs OR reqs STREQUAL managed_reqs) AND (NOT priv_reqs OR priv_reqs STREQUAL managed_priv_reqs))
|
||||
if(test_components)
|
||||
list(REMOVE_ITEM build_components ${test_components})
|
||||
endif()
|
||||
|
@ -123,8 +123,6 @@ foreach(__component_target ${__component_targets})
|
||||
|
||||
__component_get_requirements()
|
||||
|
||||
list(APPEND __component_requires "${__common_reqs}")
|
||||
|
||||
# Remove duplicates and the component itself from its requirements
|
||||
__component_get_property(__component_alias ${__component_target} COMPONENT_ALIAS)
|
||||
__component_get_property(__component_name ${__component_target} COMPONENT_NAME)
|
||||
|
Loading…
x
Reference in New Issue
Block a user