Description
Hello!
arduino-builder is failing to find includes and pull in used libraries with some at least some locales. This script demonstrates the problem for me:
#!/bin/sh
LANG=de_DE.UTF-8
arduino-builder -verbose -fqbn arduino:avr:uno -build-options-file /usr/local/arduino/arduino-builder.options BareMinimum/BareMinimum.ino
I've copied /usr/local/arduino/examples/01.Basics/BareMinimum to my working directory for this purpose and added #include <SPI.h>
to the top of it, a la:
#include <SPI.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Executing my script then yields the following output:
Using board 'uno' from platform in folder: /usr/local/arduino/hardware/arduino/avr
Using core 'arduino' from platform in folder: /usr/local/arduino/hardware/arduino/avr
Detecting libraries used...
"/usr/local/arduino/tools-builder/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10612 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/usr/local/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/local/arduino/hardware/arduino/avr/variants/standard" "/tmp/arduino-sketch-0331F5BB0B95CD649BA7F16BAFF81EE3/sketch/BareMinimum.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/usr/local/arduino/tools-builder/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10612 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/usr/local/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/local/arduino/hardware/arduino/avr/variants/standard" "/tmp/arduino-sketch-0331F5BB0B95CD649BA7F16BAFF81EE3/sketch/BareMinimum.ino.cpp" -o "/tmp/arduino-sketch-0331F5BB0B95CD649BA7F16BAFF81EE3/preproc/ctags_target_for_gcc_minus_e.cpp"
/home/kevans91/sketchbook/BareMinimum/BareMinimum.ino:1:17: schwerwiegender Fehler: SPI.h: No such file or directory
Kompilierung beendet.
exit status 1
Setting my locale to en_US.UTF-8 makes it all happy again. I assumed it was falling back to findIncludeForOldCompilers
, but I've no idea why it would -- I extracted INCLUDE_REGEXP
and the matching bits to its own golang application and it matched just fine in isolation.
I've only tested this on FreeBSD systems, but all of the relevant tests pass here so I assume it's reproducible elsewhere, too.