IDF Component Manager
The IDF Component Manager is a tool that ensures the correct versions of all components required for a successful build are present in your ESP-IDF project.
Contributing to the project
See CONTRIBUTING.md
Resources
Develop ESP-IDF projects with the IDF Component Manager
Installing a development version of the Component Manager
You can install the development version of the Component Manager from the main branch of this repository:
On Linux/macOS:
Go to the directory with your ESP-IDF installation and run:
source ./export.sh
python -m pip uninstall -y idf-component-manager
python -m pip install git+https://github.com/espressif/idf-component-manager.git@main
On Windows:
Run ESP-IDF PowerShell Environment
or ESP-IDF Command Prompt (cmd.exe)
from the Start menu and run the following command:
# remove old version of the Component Manager
python -m pip uninstall -y idf-component-manager
# install the development version (from the main branch)
python -m pip install git+https://github.com/espressif/idf-component-manager.git@main
Disabling the Component Manager
The Component Manager can be explicitly disabled by setting IDF_COMPONENT_MANAGER
environment variable to 0
.
Using with a project
You can add idf_component.yml
manifest files with the list of dependencies to any component in your project.
IDF Component Manager will download dependencies automatically during the project build process.
When CMake configures the project (e.g. idf.py reconfigure
) Component Manager does a few things:
- Processes
idf_component.yml
manifests for every component in the project - Creates a
dependencies.lock
file in the root of the project with a full list of dependencies - Downloads all dependencies to the
managed_components
directory
The Component Manager won't try to regenerate dependencies.lock
or download any components if manifests, lock file, and content of managed_component
directory weren't modified since the last successful build.
Defining dependencies in the manifest
All dependencies are defined in the manifest file.
dependencies:
idf: ">=4.1"
component:
version: "~2.0.0"
component2: ">=1.0.0"
username/component:
version: "~1.0.0"
public: true
anotheruser/component: "<3.2.20"
company_user/component:
version: "~1.0.0"
registry_url: "https://componentregistry.company.com"
test_component:
path: test_component
git: ssh://git@gitlab.com/user/components.git
some_local_component:
path: ../../projects/component
optional_component:
version: "~1.0.0"
rules:
- if: "idf_version >=3.3,<5.0"
- if: "target in [esp32, esp32c3]"
namespace/component_with_example:
version: "~1.0.0"
override_path: "../../"
namespace/no_required_component:
version: "*"
require: no
namespace/pre_release_component:
version: "*"
pre_release: true
Component metadata caching
By default, information about available versions of components not cached. If you make many requests to the registry from one machine, you can enable caching by setting IDF_COMPONENT_API_CACHE_EXPIRATION_MINUTES
environment variable to the number of minutes to cache the data.
External links
You can add links to the idf_component.yml
file to the root of the manifest:
url: "https://example.com/homepage"
repository: "https://gitexample.com/test_project"
documentation: "https://example.com/documentation"
issues: "https://git.example.com/test_project/tracker"
discussion: "https://discord.example.com/test_project"
A link should be a correct HTTP(S) URL like https://example.com/path
except the repository
field,
it is expected to be a valid Git remote URL.
Add examples to the component
To add examples to your component, place them in the examples
directory inside your component.
Examples are discovered recursively in subdirectories at this path.
A directory with CMakeLists.txt
that registers a project is considered as an example.
Custom example paths
You can specify custom example paths for uploading them to the component registry.
For that, add examples
field to the root of the manifest:
examples:
- path: ../some/path
- path: ../some/other_path
Environment variables
Variable | Default value (or example for required) | Description |
---|
IDF_COMPONENT_API_TOKEN | | API token to access the component registry |
IDF_COMPONENT_REGISTRY_URL | https://components.espressif.com/ | URL of the default component registry |
IDF_COMPONENT_STORAGE_URL | https://components-file.espressif.com/ | URL of the default file storage server |
IDF_COMPONENT_PROFILE | default | Profile in the config file to use |
IDF_COMPONENT_CACHE_PATH | * Depends on OS | Cache directory for Component Manager |
IDF_COMPONENT_VERSION_PROCESS_TIMEOUT | 300 | Timeout in seconds to wait for component processing |
IDF_COMPONENT_OVERWRITE_MANAGED_COMPONENTS | 0 | Overwrite files in the managed_component directory, even if they have been modified by the user |
IDF_COMPONENT_SUPPRESS_UNKNOWN_FILE_WARNINGS | 0 | Ignore unknown files in managed_components directory |
IDF_COMPONENT_CHECK_NEW_VERSION | 1 | Check for new versions of components |
IDF_COMPONENT_VERIFY_SSL | 1 | Verify SSL certificates when making requests to the registry, set it 0 to disable or provide a CA bundle path |
IDF_COMPONENT_CACHE_HTTP_REQUESTS | 1 | Cache HTTP requests to the registry during runtime, set it 0 to disable |