Commit Graph

5 Commits

Author SHA1 Message Date
Marek Fiala
925afdb7ba feat(tools): Visibly grouped custom extension actions in idf.py --help 2026-05-29 10:24:26 +02:00
Roland Dobai
9bea09a081 fix(tools): seed IDF_VERSION before idf.py parses dependencies.lock
Any idf.py invocation could hang indefinitely with no output while
spawning an unbounded chain of "idf.py --version" subprocesses,
eventually exhausting system memory.

During init_cli(), idf.py parses the project's dependencies.lock to
vet trusted component-provided idf_ext.py extensions. If the lock
contains a component whose manifest has an "if: idf_version" clause,
evaluating it calls idf-component-manager's _get_idf_version(). Outside
a CMake build the IDF_VERSION environment variable is not set, so that
function falls back to running "idf.py --version" as a subprocess,
which re-enters init_cli() and recurses without bound.

During a normal CMake build the component manager runs as a subprocess
that already has IDF_VERSION in its environment (see build/config.env),
so the fallback is never reached. The recursion happens only because
idf.py runs component-manager code in-process during its own CLI
startup, outside that context.

Seed IDF_VERSION into os.environ early in init_cli(), before any
dependencies.lock parsing, using the subprocess-free
idf_version_from_cmake() helper. This gives in-process component-manager
code the same IDF_VERSION a CMake build would provide.
2026-05-15 14:06:40 +08:00
Marek Fiala
8a5cd0a285 test: fix setuptools auto-discovery failure on Windows vm 2026-04-27 12:41:53 +02:00
Marek Fiala
96ff174dac feat(tools): idf.py extension - added interface version 2025-09-23 15:26:33 +08:00
Marek Fiala
74f75feb3a test(tools): Added idf extensions build system tests 2025-09-23 15:26:33 +08:00