← ClaudeAtlas

espos-registry-componentslisted

Why an IDF component's optional dependencies and feature checks silently stop working when the component is installed from the ESP Component Registry instead of a checkout: namespaced target names, and the idf_component_optional_requires defect that follows from them.
signalk-espOS/skills · ★ 0 · Web & Frontend · score 72
Install: claude install-skill signalk-espOS/skills
# Component checks that survive a registry install Verified against ESP-IDF **v6.0.3**, September 2026. ## The failure A component behaves one way from a git checkout and differently when a consumer installs it from the ESP Component Registry, with **no error and no warning**. Code takes its "that component is not in this build" branch, features compile out, and the build goes green. Cause: `BUILD_COMPONENTS` holds CMake **target** names, and the component manager namespaces those on install. A component published as `myns/mycomp` builds as target `myns__mycomp`, never the bare `mycomp`. So: ```cmake idf_build_get_property(comps BUILD_COMPONENTS) if(mycomp IN_LIST comps) # true in-tree, silently FALSE from the registry target_compile_definitions(${COMPONENT_LIB} PRIVATE HAVE_MYCOMP=1) endif() ``` One real instance: a firmware's one-call startup function decided at configure time which optional subsystems existed. Installed from the registry it brought up no WiFi, no data client and no OTA on a build that had linked all three. Nothing failed; the features simply were not compiled in. The proof is blunt: grep the build's `compile_commands.json` for your define and find it absent. ## `idf_component_optional_requires()` has the same defect This one is in IDF itself, not in your component (`tools/cmake/component.cmake`, v6.0.3): ```cmake function(idf_component_optional_requires req_type) idf_build_get_property(build_components BUILD_COMPONENTS) foreac