Arm-none-eabi-g++: error: src/main.ino.cpp: No such file or directory

Cannot compile I receive this error

arm-none-eabi-g++: error: src/main.ino.cpp: No such file or directory
arm-none-eabi-g++: fatal error: no input files
compilation terminated.
*** [.pio/build/cube/src/main.ino.cpp.o] Error 1

after platformio run --target clean
and new compilation I have

Assembler messages:
Fatal error: can’t create .pio/build/cube/FrameworkArduinoVariant/variant_RUMBA32.cpp.o: No such file or directory
*** [.pio/build/cube/FrameworkArduinoVariant/variant_RUMBA32.cpp.o] Error 1
Assembler messages:
Fatal error: can’t create .pio/build/cube/SrcWrapper/src/HAL/stm32yyxx_hal.c.o: No such file or directory
*** [.pio/build/cube/SrcWrapper/src/HAL/stm32yyxx_hal.c.o] Error 1
Assembler messages:
Fatal error: can’t create .pio/build/cube/SrcWrapper/src/HAL/stm32yyxx_hal_adc_ex.c.o: No such file or directory
*** [.pio/build/cube/SrcWrapper/src/HAL/stm32yyxx_hal_adc_ex.c.o] Error 1
Assembler messages:
Fatal error: can’t create .pio/build/cube/SrcWrapper/src/HAL/stm32yyxx_hal_adc.c.o: No such file or directory
*** [.pio/build/cube/SrcWrapper/src/HAL/stm32yyxx_hal_adc.c.o] Error 1

Any idea ?

Remove the <home folder>/.platformio/packages and <home folder>/.platformio/.cache folders and rebuild the project.

1 Like

I did that but still having the same issue
I have this issue on my 3 Mac / no matter which platform! (atmelsam or Stm32)

All Mac platforms require Rosetta to be installed to execute the x64 binaries on possible ARM platforms, would you fall into that case?

What is the output of

~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc --version


Also if it cannot create the output file, is the project directory on a sort of special path that may not be writable? Copying it to e.g. the home directory and retrying does not make a difference?

Could any antivirus system interfere?

arm-none-eabi-gcc (xPack GNU Arm Embedded GCC, 64-bit) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

I have no antivirus
the directory has been used for ages without problems (Dropbox)

I also have this error

*** [.pio/build/cube/FrameworkArduinoVariant] /Users/****/Dropbox/elektro/git/*** master/.pio/build/cube/FrameworkArduinoVariant: No such file or directory
FileNotFoundError: [Errno 2] No such file or directory: '/Users/****/Dropbox/elektro/git/SonicBio/mgr4/Code/MGR4 master/.pio/build/cube/.sconsign39.tmp':
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/", line 1401:
    _exec_main(parser, values)
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/", line 1365:
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/", line 1134:
    nodes = _build_targets(fs, options, targets, target_top)
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/", line 1340: = jobs_postfunc)
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/", line 110:
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/", line 1337:
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/", line 133:
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/", line 148:
    with self._open(self._tmp_name, "wb", self._mode) as f:
Exception ignored in: <function dblite.__del__ at 0x1034d4d30>
Traceback (most recent call last):
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/", line 144, in __del__
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/", line 141, in close
  File "/Users/****/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/", line 148, in sync
FileNotFoundError: [Errno 2] No such file or directory: '/Users/****/Dropbox/elektro/git/*** master/.pio/build/cube/.sconsign39.tmp'
========================================================================================================================== [FAILED] Took 4.33 seconds ================

and when I clean
I have

*** [/Users/***/.platformio/packages/framework-arduinoststm32/variants/STM32F4xx/F446V(C-E)T/PeripheralPins.c] /Users-***/Dropbox/elektro/git/***master/.pio/build/cube/.sconsign39.dblite: No such file or directory

Removing the .pio folder of the project and rebuilding makes no difference?

Copying the project outside of the Dropbox folder and compiling it makes no difference?

This is what I do … but it only works for a moment and I have to redo it every 2-3 build
I will try moving it to another folder to see

Moved to another folder outside Dropbox : same problem
Works only if I delete the .pio folder

The .pio folder might have computer-specific caches in them, specifically e.g. .sconsign39.tmp. Maybe the .pio was synchronized from one computer to another computer and used there? You can let dropbox ignore a folder per How to set a Dropbox file or folder to be ignored - Dropbox Help

  1. I moved everything out of Dropbox and deleted the .pio folder
    it works for 2 compilations and then fails again
  2. I need and was able to work for 6 years on any of my projects via Dropbox on 3 different Mac

Alright that’s not supposed to happen, same after doing pio upgrade --dev on the CLI? → issue to Issues · platformio/platformio-core · GitHub with failing project.

same issue with PlatformIO Core, version 6.0.2b1
compiles 2 times then fails

I have similar build issues. My workaround is to revert back to PlatformIO Core 5.2.5 (last release before core 6). Instructions on how to do this are found here:

Hoping a permanent fix is released soon. In the meantime this works for me.

  • Thomas

Please open an issue about that at Issues · platformio/platformio-core · GitHub with the project that is exhibiting this behavior and system info (pio system info), only that way can sensible advancements be made that don’t include “revert back a major version”.

The random build problem has been reported by others. The latest 6.0.x dev release has fixed some installations, but not all. For recent information please see the info posted last week by @TD-er, found here:

If @deladriere reports success with reverting to 5.2.5 then perhaps the info posted in his issue ticket will help solve the problem for good.

I just did

pip install "platformio<6"

and I am now running 5.2.5
It works !!!
thank you so much

Glad the workaround resolved the build failure for you. Hopefully your posted details help lead to a fix so we can use Core 6.

One theory for what might cause this bug is related to PC performance. @TD-er observed that his fast desktop had better build success when compared to his slower notebook. That would seem to suggest that a process during a build is slow to create some files that another process tries to request. Just a wild guess on my part – this may have nothing to do with the build problem.

  • Thomas

build failures for our users when using PlatformIO

Build failures on 6.0.1 which were confirmed fixed and were due to missing build flags don’t match the “I can only build twice perfectly fine and then it breaks with the compiler not being found”, that sounds like a whole different issue to me which enables a new issue to be opened.