Skip to content

ESP-IDF v6.0 下 esp-sr 仍依赖已移除的 json 组件,导致组件解析失败 #193

@ZhouDreams

Description

@ZhouDreams

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Context

ESP-IDF v6.0 环境下构建项目时,esp-sr 组件会因为其组件依赖列表中仍包含 json

set(requires
    json
    spiffs
    )

而导致组件解析失败。

CMake Error at /Users/jovisdreams/.espressif/v6.0/esp-idf/tools/cmake/build.cmake:378 (message):
  Failed to resolve component 'json' required by component
  'espressif__esp-sr': unknown name.
Call Stack (most recent call first):
  /Users/jovisdreams/.espressif/v6.0/esp-idf/tools/cmake/build.cmake:421 (__build_resolve_and_add_req)
  /Users/jovisdreams/.espressif/v6.0/esp-idf/tools/cmake/build.cmake:422 (__build_expand_requirements)
  /Users/jovisdreams/.espressif/v6.0/esp-idf/tools/cmake/build.cmake:751 (__build_expand_requirements)
  /Users/jovisdreams/.espressif/v6.0/esp-idf/tools/cmake/project.cmake:742 (idf_build_process)
  CMakeLists.txt:8 (project)


-- Configuring incomplete, errors occurred!

本人手动将 json 改为 cjson 后可编译通过。

set(requires
    cjson
    spiffs
    )

结合 ESP-IDF v6.0 的迁移说明,问题原因大概率是:在 ESP-IDF v6.0 中,内置 json 组件已经被移除,官方迁移方式是改用托管组件 espressif/cjson(参照这里)。

esp-sr 仍然在 CMake 依赖中直接引用旧的 json 组件名,即使项目已经在 idf_component.yml 中引入了 espressif/cjson,它也不会自动满足 json这一依赖。

希望后续版本可以修复这一兼容性问题。

Project release version

2.2.0

System architecture

ARM 64-bit (Apple M1/M2, Raspberry Pi 4/5)

Operating system

MacOS

Operating system version

MacOS 26

Shell

ZSH

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Inconsistencies or issues which will cause a problem for users or implementers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions