Skip to content

[Fixed] Arduino IDE throws error "arduino-builder returned 2" when trying to compile any sketch twice (even without any board/hardware connected) on any ESP32 board #5825

@furquan-lp

Description

@furquan-lp

Hardware:

Board: ESP32 Dev Module
Core Installation version: 2.0.0 and 2.0.1-RC1
IDE name: Arduino IDE 1.8.16
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Debian Linux

Description:

The Arduino IDE throws an error (see below for detail) "arduino-builder returned 2 Error compiling for board [board name]." whenever any sketch is compiled twice for any board selected from the Arduino-ESP32 core.

No board is connected to the machine, this appears to be a software problem.

This happens for any sketch as long as it contains a #include. Selecting a different board fixes this problem momentarily (the IDE will say Build options changed, rebuilding all) but compiling one more time will throw this error.
Examples of errors with random boards that I tried out:

arduino-builder returned 2
Error compiling for board ESP32C3 Dev Module.
arduino-builder returned 2
Error compiling for board ESP32 Wrover Kit (all versions).

Installed 2.0.0 and 2.0.1-RC1, problem occurs on both versions. Problem only occurs on Arduin-ESP32 core boards, Arduino and other boards work fine.

Sketch:

#include <WiFi.h>

void setup() {
}

void loop() {
}

Another Sketch (code must contain a #include):

#include <Wire.h>
void setup() {}
void loop() {}

Debug Messages:

Arduino: 1.8.16 (Linux), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None"











WARNING: Category '' in library ESP RainMaker is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library WiFiProv is not valid. Setting to 'Uncategorized'
panic: runtime error: index out of range [3] with length 3

goroutine 1 [running]:
arduino.cc/builder.(*includeCache).Next(...)
	arduino.cc/builder/container_find_includes.go:209
arduino.cc/builder.findIncludesUntilDone(0xc000038c00, 0xc00039e600, {{0x52ee20, 0xc00040f860}, {0xc00001622d, 0x7}})
	arduino.cc/builder/container_find_includes.go:321 +0x119d
arduino.cc/builder.(*ContainerFindIncludes).Run(0xc0000241c0, 0xc000038c00)
	arduino.cc/builder/container_find_includes.go:149 +0xc25
arduino.cc/builder.runCommands(0x8, {0xc000093c58, 0x22, 0x5555555}, 0x10)
	arduino.cc/builder/builder.go:191 +0xda
arduino.cc/builder.(*Builder).Run(0x7ffea35de365, 0x19)
	arduino.cc/builder/builder.go:124 +0x890
arduino.cc/builder.RunBuilder(...)
	arduino.cc/builder/builder.go:222
main.main()
	arduino.cc/arduino-builder/main.go:338 +0x988
arduino-builder returned 2
Error compiling for board ESP32 Dev Module.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions