Skip to content

ESP-IDF CMake build fails: missing CMakeFiles/git-data/head-ref + fatal: Needed a single revision (macOS) #1700

@RioLi08123

Description

@RioLi08123

Summary

ESP-IDF CMake configure fails in PlatformIO on macOS with missing CMakeFiles/git-data/head-ref and fatal: Needed a single revision.

Error

-- Configuring incomplete, errors occurred!

CMake Error at .pioenvs/poe-speaker/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):

/Users/rioli/.esphome/build/poe-speaker/.pioenvs/poe-speaker/CMakeFiles/git-data/head-ref

Call Stack (most recent call first):
/Users/rioli/.platformio/packages/framework-espidf/tools/cmake/third_party/GetGitRevisionDescription.cmake:83 (include)
/Users/rioli/.platformio/packages/framework-espidf/tools/cmake/third_party/GetGitRevisionDescription.cmake:93 (get_git_head_revision)
/Users/rioli/.platformio/packages/framework-espidf/tools/cmake/build.cmake:99 (git_describe)
/Users/rioli/.platformio/packages/framework-espidf/tools/cmake/build.cmake:282 (__build_get_idf_git_revision)
/Users/rioli/.platformio/packages/framework-espidf/tools/cmake/idf.cmake:55 (__build_init)
/Users/rioli/.platformio/packages/framework-espidf/tools/cmake/project.cmake:29 (include)
CMakeLists.txt:2 (include)

warning: user value 0 on the int symbol LWIP_BRIDGEIF_MAX_PORTS (defined at /Users/rioli/.platformio/packages/framework-espidf/components/lwip/Kconfig:1222) ignored due to being outside the active range ([1, 63]) -- falling back on defaults
fatal: Needed a single revision
fatal: Needed a single revision## Environment

  • OS: macOS 15.6.1 (Darwin 24.6.0, arm64)
  • Python: 3.13.2
  • Git: 2.52.0
  • PlatformIO Core: 6.1.18

pio system info

PlatformIO Core 6.1.18
Python 3.13.2-final.0
System Type darwin_arm64
Platform macOS-15.6.1
File System Encoding utf-8
Locale Encoding UTF-8
PlatformIO Core Directory /Users/rioli/.platformio
PlatformIO Core Executable /Library/Frameworks/Python.framework/Versions/3.13/bin/platformio
Python Executable /Library/Frameworks/Python.framework/Versions/3.13/bin/python3
Global Libraries 0
Development Platforms 0
Tools & Toolchains 0## Notes

  • ~/.platformio/packages/framework-espidf/.git does not exist:
    • ls: /Users/rioli/.platformio/packages/framework-espidf/.git: No such file or directory
  • This suggests the installed framework-espidf package lacks git metadata, but ESP-IDF CMake still attempts to derive a git revision and fails.

Steps to Reproduce

  1. On macOS arm64, install PlatformIO Core 6.1.18.
  2. Build an ESP-IDF based project (in my case triggered via ESPHome building for an ESP32 target).
  3. CMake configure fails with missing head-ref and fatal: Needed a single revision.

Expected Behavior

CMake configure/build succeeds even if the installed ESP-IDF framework package is not a git repository (or otherwise does not provide git metadata).

Actual Behavior

CMake configure fails with missing CMakeFiles/git-data/head-ref and fatal: Needed a single revision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions