求助 按快速入门编译例程时报错未找到.../CMakeFiles/git-data/head-ref
Posted: Sat Oct 09, 2021 7:36 am
我是按照官方教程一步步走的,但在执行idf.py set-target esp32时出现报错:
CMake Error at build/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
D:/Programs/esp-idf/examples/get-started/hello_world/build/CMakeFiles/git-data/head-ref
我打开git-data文件夹,确实没有找到head-ref文件,里面只有grabRef.cmake文件和HEAD文件。即使不管报错继续执行idf.py build也无法编译,出现几乎相同的报错。百度完全没有查询到相关信息,也请大家和审核大大帮帮我 我不管是用什么教程都会遇到错误,编译不了例程 上次发的Visual Studio Code插件配置问题也没有人回复
以下是CMD内信息:
D:\Programs\esp-idf\examples\get-started\hello_world>D:\Programs\esp-idf\export.bat
Setting IDF_PATH: D:\Programs\esp-idf
Adding ESP-IDF tools to PATH...
fatal: No names found, cannot describe anything.
WARNING: Git describe was unsuccessful: b''
D:\Programs\esp-tools\tools\xtensa-esp32s2-elf\esp-2021r1-8.4.0\xtensa-esp32s2-elf\bin
D:\Programs\esp-tools\tools\xtensa-esp32s3-elf\esp-2021r1-8.4.0\xtensa-esp32s3-elf\bin
D:\Programs\esp-tools\tools\riscv32-esp-elf\esp-2021r1-8.4.0\riscv32-esp-elf\bin
D:\Programs\esp-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
D:\Programs\esp-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
D:\Programs\esp-tools\tools\openocd-esp32\v0.10.0-esp32-20210902\openocd-esp32\bin
D:\Programs\esp-tools\tools\ninja\1.10.2\
D:\Programs\esp-tools\tools\idf-exe\1.0.1\
D:\Programs\esp-tools\tools\ccache\4.3\ccache-4.3-windows-64
D:\Programs\esp-tools\tools\dfu-util\0.9\dfu-util-0.9-win64
D:\Programs\esp-tools\python_env\idf4.4_py3.6_env\Scripts
D:\Programs\esp-idf\tools
Checking if Python packages are up to date...
Python requirements from D:\Programs\esp-idf\requirements.txt are satisfied.
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
D:\Programs\esp-idf\examples\get-started\hello_world>idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Directory 'd:\programs\esp-idf\examples\get-started\hello_world\build' doesn't seem to be a CMake build directory. Refusing to automatically delete files in this directory. Delete the directory manually to 'clean' it.
D:\Programs\esp-idf\examples\get-started\hello_world>idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory 'd:\programs\esp-idf\examples\get-started\hello_world\build' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory d:\programs\esp-idf\examples\get-started\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=1 d:\programs\esp-idf\examples\get-started\hello_world"...
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.33.0.windows.2")
CMake Error at build/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
D:/Programs/esp-idf/examples/get-started/hello_world/build/CMakeFiles/git-data/head-ref
Call Stack (most recent call first):
D:/Programs/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:80 (include)
D:/Programs/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:90 (get_git_head_revision)
D:/Programs/esp-idf/tools/cmake/build.cmake:67 (git_describe)
D:/Programs/esp-idf/tools/cmake/build.cmake:174 (__build_get_idf_git_revision)
D:/Programs/esp-idf/tools/cmake/idf.cmake:50 (__build_init)
D:/Programs/esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
CMake Warning at D:/Programs/esp-idf/tools/cmake/git_submodules.cmake:52 (message):
Git submodule is out of date. Run 'git submodule update --init
--recursive' to fix.
Call Stack (most recent call first):
D:/Programs/esp-idf/tools/cmake/build.cmake:77 (git_submodule_check)
D:/Programs/esp-idf/tools/cmake/build.cmake:174 (__build_get_idf_git_revision)
D:/Programs/esp-idf/tools/cmake/idf.cmake:50 (__build_init)
D:/Programs/esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
CMake Error at D:/Programs/esp-idf/tools/cmake/git_submodules.cmake:57 (get_filename_component):
get_filename_component unknown component BASE_DIR
Call Stack (most recent call first):
D:/Programs/esp-idf/tools/cmake/build.cmake:77 (git_submodule_check)
D:/Programs/esp-idf/tools/cmake/build.cmake:174 (__build_get_idf_git_revision)
D:/Programs/esp-idf/tools/cmake/idf.cmake:50 (__build_init)
D:/Programs/esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
-- Configuring incomplete, errors occurred!
cmake failed with exit code 1
D:\Programs\esp-idf\examples\get-started\hello_world>git submodule update --init
D:\Programs\esp-idf\examples\get-started\hello_world>
CMake Error at build/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
D:/Programs/esp-idf/examples/get-started/hello_world/build/CMakeFiles/git-data/head-ref
我打开git-data文件夹,确实没有找到head-ref文件,里面只有grabRef.cmake文件和HEAD文件。即使不管报错继续执行idf.py build也无法编译,出现几乎相同的报错。百度完全没有查询到相关信息,也请大家和审核大大帮帮我 我不管是用什么教程都会遇到错误,编译不了例程 上次发的Visual Studio Code插件配置问题也没有人回复
以下是CMD内信息:
D:\Programs\esp-idf\examples\get-started\hello_world>D:\Programs\esp-idf\export.bat
Setting IDF_PATH: D:\Programs\esp-idf
Adding ESP-IDF tools to PATH...
fatal: No names found, cannot describe anything.
WARNING: Git describe was unsuccessful: b''
D:\Programs\esp-tools\tools\xtensa-esp32s2-elf\esp-2021r1-8.4.0\xtensa-esp32s2-elf\bin
D:\Programs\esp-tools\tools\xtensa-esp32s3-elf\esp-2021r1-8.4.0\xtensa-esp32s3-elf\bin
D:\Programs\esp-tools\tools\riscv32-esp-elf\esp-2021r1-8.4.0\riscv32-esp-elf\bin
D:\Programs\esp-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
D:\Programs\esp-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
D:\Programs\esp-tools\tools\openocd-esp32\v0.10.0-esp32-20210902\openocd-esp32\bin
D:\Programs\esp-tools\tools\ninja\1.10.2\
D:\Programs\esp-tools\tools\idf-exe\1.0.1\
D:\Programs\esp-tools\tools\ccache\4.3\ccache-4.3-windows-64
D:\Programs\esp-tools\tools\dfu-util\0.9\dfu-util-0.9-win64
D:\Programs\esp-tools\python_env\idf4.4_py3.6_env\Scripts
D:\Programs\esp-idf\tools
Checking if Python packages are up to date...
Python requirements from D:\Programs\esp-idf\requirements.txt are satisfied.
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
D:\Programs\esp-idf\examples\get-started\hello_world>idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Directory 'd:\programs\esp-idf\examples\get-started\hello_world\build' doesn't seem to be a CMake build directory. Refusing to automatically delete files in this directory. Delete the directory manually to 'clean' it.
D:\Programs\esp-idf\examples\get-started\hello_world>idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory 'd:\programs\esp-idf\examples\get-started\hello_world\build' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory d:\programs\esp-idf\examples\get-started\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=1 d:\programs\esp-idf\examples\get-started\hello_world"...
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.33.0.windows.2")
CMake Error at build/CMakeFiles/git-data/grabRef.cmake:48 (file):
file failed to open for reading (No such file or directory):
D:/Programs/esp-idf/examples/get-started/hello_world/build/CMakeFiles/git-data/head-ref
Call Stack (most recent call first):
D:/Programs/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:80 (include)
D:/Programs/esp-idf/tools/cmake/third_party/GetGitRevisionDescription.cmake:90 (get_git_head_revision)
D:/Programs/esp-idf/tools/cmake/build.cmake:67 (git_describe)
D:/Programs/esp-idf/tools/cmake/build.cmake:174 (__build_get_idf_git_revision)
D:/Programs/esp-idf/tools/cmake/idf.cmake:50 (__build_init)
D:/Programs/esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
CMake Warning at D:/Programs/esp-idf/tools/cmake/git_submodules.cmake:52 (message):
Git submodule is out of date. Run 'git submodule update --init
--recursive' to fix.
Call Stack (most recent call first):
D:/Programs/esp-idf/tools/cmake/build.cmake:77 (git_submodule_check)
D:/Programs/esp-idf/tools/cmake/build.cmake:174 (__build_get_idf_git_revision)
D:/Programs/esp-idf/tools/cmake/idf.cmake:50 (__build_init)
D:/Programs/esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
CMake Error at D:/Programs/esp-idf/tools/cmake/git_submodules.cmake:57 (get_filename_component):
get_filename_component unknown component BASE_DIR
Call Stack (most recent call first):
D:/Programs/esp-idf/tools/cmake/build.cmake:77 (git_submodule_check)
D:/Programs/esp-idf/tools/cmake/build.cmake:174 (__build_get_idf_git_revision)
D:/Programs/esp-idf/tools/cmake/idf.cmake:50 (__build_init)
D:/Programs/esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
-- Configuring incomplete, errors occurred!
cmake failed with exit code 1
D:\Programs\esp-idf\examples\get-started\hello_world>git submodule update --init
D:\Programs\esp-idf\examples\get-started\hello_world>