Build Failed: No such file or directory

Hi there,

I am a new to PlatformIO and seem to have fallen at the first hurdle. I installed the PlatformIO for VSCode as instructed here: PlatformIO IDE for VSCode — PlatformIO latest documentation but I cannot seem to get it to build any code.

This is the terminal output when I try and build:

Executing task in folder ArduinoTest: platformio run

Processing uno (platform: atmelavr; board: uno; framework: arduino)
    Verbose mode can be enabled via `-v, --verbose` option
    PLATFORM: Atmel AVR (3.4.0) > Arduino Uno
    HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
    DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
     - framework-arduino-avr 5.1.0 
     - toolchain-atmelavr 1.70300.191015 (7.3.0)
    LDF: Library Dependency Finder ->
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 5 compatible libraries
    Scanning dependencies...
    No dependencies
    Building in release mode
    Compiling .pio/build/uno/src/main.cpp.o
    Archiving .pio/build/uno/libFrameworkArduinoVariant.a
    Compiling .pio/build/uno/FrameworkArduino/CDC.cpp.o
    Compiling .pio/build/uno/FrameworkArduino/HardwareSerial.cpp.o
    Compiling .pio/build/uno/FrameworkArduino/HardwareSerial0.cpp.o
    Compiling .pio/build/uno/FrameworkArduino/HardwareSerial1.cpp.o
    Compiling .pio/build/uno/FrameworkArduino/HardwareSerial2.cpp.o
    *** [.pio/build/uno/libFrameworkArduinoVariant.a] sh: No such file or directory
    *** [.pio/build/uno/src/main.cpp.o] sh: No such file or directory
    *** [.pio/build/uno/FrameworkArduino/CDC.cpp.o] sh: No such file or directory
    *** [.pio/build/uno/FrameworkArduino/HardwareSerial.cpp.o] sh: No such file or directory
    *** [.pio/build/uno/FrameworkArduino/HardwareSerial0.cpp.o] sh: No such file or directory
    *** [.pio/build/uno/FrameworkArduino/HardwareSerial1.cpp.o] sh: No such file or directory
    *** [.pio/build/uno/FrameworkArduino/HardwareSerial2.cpp.o] sh: No such file or directory
    Compiling .pio/build/uno/FrameworkArduino/HardwareSerial3.cpp.o
    *** [.pio/build/uno/FrameworkArduino/HardwareSerial3.cpp.o] sh: No such file or directory
    ======================================================================== [FAILED] Took 0.79 seconds ========================================================================
    The terminal process "platformio 'run'" terminated with exit code: 1.

   Terminal will be reused by tasks, press any key to close it.

This directory is completely empty and my understanding is the it is supposed to be populated automatically on build.

My current diagnosis is with the env (I assume this is python). When I run a PlatformIO terminal and use the command which python3, the output is /usr/local/opt/python@3.9/bin/python3. Should this be a platformIO python environment? Using the command echo $PATH shows that /.platformio/penv/bin, /.platformio/penv, and /.platformio/python3/bin are all on the python path.

I am using PlatformIO 1.3.3, with the most up to date VSCode on macOS Catalina. I have tried reinstalling PlatformIO and VSCode, as well as deleting all sorts of directories and getting them to regenerate on build but to no avail. I am just trying to build a simple blink code for an esp32 (az-delivery-devkit-v4) but haven’t had any luck compiling for any board (even arduino uno as shown above).

This more looks like the shell trying to execute a binary that is not compiled for this machine.

Is this running on a new M1 ARM Mac thingy? With that emulation layer rosetta installed?

In a CLI what does pio system info output?

Hi Max,

No M1, just Intel i7.

pio system info outputs:

--------------------------  --------------------------------------------
PlatformIO Core             5.1.1
Python                      3.9.2-final.0
System Type                 darwin_x86_64
Platform                    macOS-10.15.7
File System Encoding        utf-8
Locale Encoding             UTF-8
PlatformIO Core Directory   /Users/[me]/.platformio
PlatformIO Core Executable  /Users/[me]/.platformio/penv/bin/platformio
Python Executable           /Users/[me]/.platformio/penv/bin/python
Global Libraries            0
Development Platforms       2
Tools & Toolchains          10
--------------------------  --------------------------------------------


Open a CLI again and execute

/Users/[me]/.platformio/packages/toolchain-atmelavr/bin/avr-gcc --version

Where [me] is replaced with your username. What’s the output?

That outputs:

avr-gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

curiously, I ran pio test and pio run from the CLI and it seems to have generated the required files, but the buttons in the tool bar still generate the same errors

Okay so the compiler seems to be executable within a shell… but not when PlatformIO, triggered by VSCode, calls into it.

Is there any special antivirus software installed that could prevent execution or sandbox something?

VSCode was installed ‘as normal’ from the download page or through some other means?

VSCode was installed ‘as normal’, as was platformIO. I don’t have any antivirus software running (to my knowledge) and I think I have used VSCode to run executables before

Please open an issue at Issues · platformio/platformio-vscode-ide · GitHub with a description of the problem, the developers can hopefully help you better there.

1 Like

Okay, will do, thanks very much for your time and help, it is greatly appreciated!