Initialization of a new project (“a”) in VSCode for ESP32 for Arduino Framework works, but choosing “Espressid IoT Development Framework” stalls. A window opens “Could not initialize project” with a lot of text, essentially saying finally:
Configuring incomplete, errors occurred!
Fatal: no Git repository (or some other parent path until mount point.
GIT_DISCOVERY_ACROSS_FILESYSTEM not set
Searching the net for GIT_DISCOVERY_ACROSS_FILESYSTEM didn’t help me to understand what that means or is for (and where this flag has to be set).
I reinstalled the “Espressif framework” which did’nt change anything.
Looking into CMakeOutput.log did’nt help me either as I found no errors listed.
The mentioned file “.pio/build/featheresp32/CMakeFiles/git-data/grabRef.cmake”
has in lines 47-50:
if(NOT HEAD_HASH)
file(READ “/home/kh/pio-projects/a/.pio/build/featheresp32/CMakeFiles/git-data/head-ref” HEAD_HASH LIMIT 1024)
string(STRIP “${HEAD_HASH}” HEAD_HASH)
endif()
which I unfortunately don’t understand either, but the file
“/home/kh/pio-projects/a/.pio/build/featheresp32/CMakeFiles/git-data/head-ref”
does not exist.
So I’m stuck and thankful for suggestions.
Thanks for your time.
Extract of message in pop up box:
\nSee also “/home/kh/pio-projects/a/.pio/build/featheresp32/CMakeFiles/CMakeOutput.log”.\n\nfatal: Kein Git-Repository (oder irgendein Elternverzeichnis bis zum Einhängepunkt /)\nStoppe bei Dateisystemgrenze (GIT_DISCOVERY_ACROSS_FILESYSTEM nicht gesetzt).\nCMake Error at .pio/build/featheresp32/CMakeFiles/git-data/grabRef.cmake:48 (file):\n file failed to open for reading (No such file or directory):\n\n /home/kh/pio-projects/a/.pio/build/featheresp32/CMakeFiles/git-data/head-ref\nCall Stack (most recent call first):\n
env:
debian 10.8, VSCode 1.54.1, PIO Core 5.1.1a3, Home 3.3.4
– Found Git: /usr/bin/git (found version “2.20.1”)
– The C compiler identification is GNU 8.4.0
– The CXX compiler identification is GNU 8.4.0
– The ASM compiler identification is GNU
– Found assembler: /home/kh/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc
– Check for working C compiler: /home/kh/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc
– Check for working C compiler: /home/kh/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /home/kh/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++
– Check for working CXX compiler: /home/kh/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
17a35,36
– Found PythonInterp: /home/kh/.platformio/penv/bin/python (found version “3.7.3”)
– Found Perl: /usr/bin/perl (found version “5.28.1”)
Do you have any other extensions installed in VSCode besides PlatformIO and C/C++ by microsoft that could interfere, e.g. ESP-IDF or CMake? Try and disable those if yes.
What is the project structure like? (Screenshot of file explorer in VSCode)
There are few google hits on esp-idf file "failed to open for reading" git-data/head-ref.
A few info I could collect
If the project has run git init but there are no commits (therefor no revision) the build will fail will the output below
In VSCode I have installed C/C++ , C/C++ Extension Pack, C++ Intellisense, Platformio IDE and Remote Containers. I uninstalled “Remote Conainers”, which did make a change.
“git init” was not run from the current path “~/pio-projects/a/”, but I made that in a previous attempt within an other attempt to get thinks working. Maybe this was a fault?
I tried the upstream version without success
importing espidf-blink threw the same error again.
As you suggested, I’ll file an issue.
Thank you very much for the kind and quick support.
Success !
I did a ‘pio settings set projects_dir ~/tmp’
and both, creating a new project as well as import a sample project into that new dir was possible without error.
Should / can i move the project by simply
mv -r ~/tmp/projectname /home/kh/pio-projects/
??
Hm then it might really be a fault in the ESP-IDF scripts not being able to handle the path or whatver is in the way of that.
Is there a way you can undo what has been done here, by e.g. removing the .git folder(s)?
You can try to, but I think it won’t build anymore (if you pio run -t clean and pio run) when in this path if it has something to do with the git init fault above.
There was a ~/pio-projects/.git/.
After
rm -rf ~/pio-projects/.git/
the problem was solved and projects could be imported and created in ~/pio-projects/ dir without errors