Why is this file missing? C:/TeamCity/buildAgent/work/c508335a9011a7c1/Build/CMakeFiles/git-data/head-ref
Here is the error I am getting in Teamcity:
CMake Error at Build/CMakeFiles/git-data/grabRef.cmake:36 (file): CMake Error at Build/CMakeFiles/git-data/grabRef.cmake:36 (file):
File failed to open for reading (No such file or directory):
C:/TeamCity/buildAgent/work/c508335a9011a7c1/Build/CMakeFiles/git-data/head-ref
It has something to do with the fact that .git\refs\heads folder is empty. When I normally use git, (not using Teamcity), this .git\refs\heads folder has files in it. and cmake generates its files properly.
Please sign in to leave a comment.
Couldn’t figure it out so I just made my first build step a command line git clone and checkout which works fine.
Go to CLI and open project path
enter git status
if it showed the path to grabRef.cmake , try
git update-ref -d /.pio/build/esp32dev/bootloader/CMakeFiles/git-data/grabRef.cmake
otherwise,
git add /.pio/build/esp32dev/bootloader/CMakeFiles/git-data/grabRef.cmake
and then update it.
This will resolve the issue.