From d14405541ab449dc4a8c1c3098d7a61f7e2e0e44 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 24 Sep 2019 13:04:13 -0700 Subject: [PATCH 1/2] Without the -built-in-libraries option passed in to arduino-builder, it can't find ctags. Which suggests to me that it's doing a lot more than just finding libraries Signed-off-by: Jesse Vincent --- bin/kaleidoscope-builder | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 1fee931d..f46a807e 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -300,6 +300,7 @@ compile () { -build-cache "${CORE_CACHE_PATH}" \ -build-path "${BUILD_PATH}" \ -ide-version "${ARDUINO_IDE_VERSION}" \ + -built-in-libraries "${ARDUINO_PATH}/libraries" \ -prefs "compiler.cpp.extra_flags=-std=c++11 -Woverloaded-virtual -Wno-unused-parameter -Wno-unused-variable -Wno-ignored-qualifiers ${ARDUINO_CFLAGS} ${LOCAL_CFLAGS}" \ $CCACHE_ENABLE \ -warnings all \ From 5396a9243e82bb4e46f9c08248b956be4a75bba6 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 24 Sep 2019 13:06:19 -0700 Subject: [PATCH 2/2] A regression in Arduino 1.8.10 caused -dump-prefs to break when not given a build-dir and a sketch --- etc/kaleidoscope-builder.conf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/etc/kaleidoscope-builder.conf b/etc/kaleidoscope-builder.conf index d0efe803..defa2d5b 100644 --- a/etc/kaleidoscope-builder.conf +++ b/etc/kaleidoscope-builder.conf @@ -42,25 +42,32 @@ fi # Shamelessly stolen from git's Makefile uname_S=$(uname -s 2>/dev/null || echo not) + find_max_prog_size() { +# SKETCH and -build-path in this command are here because of a bug introduced in Arduino 1.8.10 +# https://github.com/arduino/arduino-builder/issues/341 VPIDS=$("${ARDUINO_BUILDER}" \ -hardware "${ARDUINO_PATH}/hardware" \ -hardware "${BOARD_HARDWARE_PATH}" \ ${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \ -tools "${ARDUINO_PATH}/tools-builder" \ -fqbn "${FQBN}" \ - -dump-prefs | grep "upload\.maximum_size=") + -build-path ${ARDUINO_PATH} \ + -dump-prefs "${SKETCH_DIR}/${SKETCH}.ino" | grep "upload\.maximum_size=") MAX_PROG_SIZE=${MAX_PROG_SIZE:-$(echo "${VPIDS}" | grep upload.maximum_size | head -n 1 | cut -d= -f2)} } find_device_vid_pid() { +# SKETCH and -build-path in this command are here because of a bug introduced in Arduino 1.8.10 +# https://github.com/arduino/arduino-builder/issues/341 VPIDS=$("${ARDUINO_BUILDER}" \ -hardware "${ARDUINO_PATH}/hardware" \ -hardware "${BOARD_HARDWARE_PATH}" \ ${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \ -tools "${ARDUINO_PATH}/tools-builder" \ -fqbn "${FQBN}" \ - -dump-prefs | grep "\.[vp]id=") + -build-path ${ARDUINO_PATH} \ + -dump-prefs "${SKETCH_DIR}/${SKETCH}.ino" || grep "\.[vp]id=") VID=${VID:-$(echo "${VPIDS}" | grep build.vid= | cut -dx -f2)} SKETCH_PID=${SKETCH_PID:-$(echo "${VPIDS}" | grep build.pid= | cut -dx -f2)} BOOTLOADER_PID=${BOOTLOADER_PID:-$(echo "${VPIDS}" | grep bootloader.pid= | cut -dx -f2)}