Error from build

New project, using both espidf and arduino frameworks:

Resolving esp32dev dependencies...

Updating metadata for the vscode IDE...

UserSideException: Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf, arduino)

\--------------------------------------------------------------------------------

Verbose mode can be enabled via \`-v, --verbose\` option

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html

PLATFORM: Espressif 32 (6.11.0) > Espressif ESP32 Dev Module

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)

PACKAGES: 

 - framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b 

 - framework-espidf @ 3.40407.240606 (4.4.7) 

 - tool-cmake @ 3.16.4 

 - tool-esp-rom-elfs @ 0.0.1+20241011 

 - tool-esptoolpy @ 1.40501.0 (4.5.1) 

 - tool-idf @ 1.0.1 

 - tool-mconf @ 1.4060000.20190628 (406.0.0) 

 - tool-ninja @ 1.9.0 

 - toolchain-esp32ulp @ 1.23800.240113 (2.38.0) 

 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5

Warning! Arduino framework as an ESP-IDF component doesn't handle the \`variant\` field! The default \`esp32\` variant will be used.

Reading CMake configuration...

\-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.45.1.windows.1") 

\-- The C compiler identification is GNU 8.4.0

\-- Check for working C compiler: W:/PlatformIO/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe

\-- Configuring incomplete, errors occurred!

See also "W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/CMakeOutput.log".

See also "W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/CMakeError.log".



fatal: not a git repository (or any of the parent directories): .git

CMake Error at W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/CMakeTmp/CMakeLists.txt:15 (add_executable):

  Cannot find source file:



    W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/CMakeTmp/testCCompiler.c



  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm

  .hpp .hxx .in .txx




CMake Error at W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/CMakeTmp/CMakeLists.txt:15 (add_executable):

  No SOURCES given to target: cmTC_4347a




CMake Error at W:/PlatformIO/packages/tool-cmake/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:44 (try_compile):

  Failed to generate test project build system.

Call Stack (most recent call first):

  W:/PlatformIO/packages/framework-espidf@3.40407.240606/tools/cmake/project.cmake:381 (\__project)

  CMakeLists.txt:3 (project)





========================== \[FAILED\] Took 7.14 seconds ==========================

platformio.ini:

; PlatformIO Project Configuration File

;

;   Build options: build flags, source filter

;   Upload options: custom upload port, speed and extra flags

;   Library options: dependencies, extra library storages

;   Advanced options: extra scripting

;

; Please visit documentation for the other options and examples

; https://docs.platformio.org/page/projectconf.html



\[env:esp32dev\]

platform = espressif32

board = esp32dev

framework = espidf, arduino

lib_deps = 

    bodmer/TFT_eSPI@^2.5.43

    bodmer/TFT_eWidget@^0.0.6

    paulstoffregen/XPT2046_Touchscreen@0.0.0-alpha+sha.26b691b2c8

I have tried a full clean prior to the build, but still the same

CMakeOutput.log shows: 

The target system is: Generic -  - 

The host system is: Windows - 10.0.19045 - AMD64

The target system is: Generic -  - 

The host system is: Windows - 10.0.19045 - AMD64

Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.

Compiler: W:/PlatformIO/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe 

Build flags: -mlongcalls;-Wno-frame-address;

Id flags: -c 



The output was:

0




Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"



The C compiler identification is GNU, found in "W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/3.16.4/CompilerIdC/CMakeCCompilerId.o"



Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.

Compiler: W:/PlatformIO/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++.exe 

Build flags: -mlongcalls;-Wno-frame-address;

Id flags:  



The output was:

0




Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"



Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.

Compiler: W:/PlatformIO/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe 

Build flags: -mlongcalls;-Wno-frame-address;

Id flags:  



The output was:

0




Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"



The CXX compiler identification is GNU, found in "W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/3.16.4/CompilerIdCXX/a.out"



The C compiler identification is GNU, found in "W:/shaker-flask/NewPIOIncubator/.pio/build/esp32dev/CMakeFiles/3.16.4/CompilerIdC/a.out"



Checking whether the ASM compiler is GNU using "--version" matched "(GNU assembler)|(GCC)|(Free Software Foundation)":

xtensa-esp32-elf-gcc.exe (crosstool-NG esp-2021r2-patch5) 8.4.0

Copyright (C) 2018 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

CmakeError.log shows:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.

Compiler: W:/PlatformIO/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe 

Build flags: -mlongcalls;-Wno-frame-address;

Id flags:  



The output was:

1

cc1.exe: fatal **error:** CMakeCCompilerId.c: No such file or directory

compilation terminated.

Most errors I’ve seen from “cannot find source file” come from

  • not having Win32 NTFS Long Paths enabled if the paths get long (see here)
  • having non-ascii characters in the path (chinese, cryllic, ..)
  • having forbidden shell characters in your path (spaces, maybe also that - character)
  • the filesystem is on a network share (SMB share, OneDrive, Google Drive, ..)

try to eliminate all these possibilities. Create a new project on a local drive with a short path without forbidden characters. For example, C:\pio\espidftest.

Hi Max:

All are excellent points - thank you for the reminders.

The issue here is that the Build process here is the culprit that produced this file “testCCompiler.c” - I did not produce this, it was produced by the secret sauce from the PlatformIO extension itself. If there is a problem with that, then that needs to be addressed by the PlatformIO folks. Could you ask Ivan Kravets or others to look into?

Thanks,

George Wicks

PlatformIO calls into the CMake build system that ESP-IDF uses. It of course tries to test out the compiler. For that it creates that file and compiles it. This works (as shown by the CI tests in platform-espressif32), so on your system it’s an anomoly. Otherwise noone else could have a working build. Have you ruled out all possibilities as i’ve listed above?