From 330b032e050771b832d3ec4d6eea6428faa5d7c4 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 19 Dec 2024 12:01:16 -0800 Subject: [PATCH 1/4] fix the arduino-cli invocation to remove the deprecated --build-cache-path and to specify where the builder might find cached artifacts. --- etc/makefiles/sketch.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index c4ae6cdc7..8e5378855 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -173,13 +173,14 @@ endif compile: kaleidoscope-hardware-configured check-rosetta -$(QUIET) install -d "${OUTPUT_PATH}" - $(QUIET) $(ARDUINO_CLI) compile --fqbn "${FQBN}" ${ARDUINO_VERBOSE} ${ccache_wrapper_property} ${local_cflags_property} \ + $(QUIET) \ + ARDUINO_BUILD_CACHE_EXTRA_PATHS="${BUILD_PATH}" \ + $(ARDUINO_CLI) compile --fqbn "${FQBN}" ${ARDUINO_VERBOSE} ${ccache_wrapper_property} ${local_cflags_property} \ ${_arduino_local_libraries_prop} ${_ARDUINO_CLI_COMPILE_CUSTOM_FLAGS} ${kaleidoscope_board_config}\ --library "${KALEIDOSCOPE_DIR}" \ --libraries "${KALEIDOSCOPE_DIR}/plugins/" \ --build-path "${BUILD_PATH}" \ --output-dir "${OUTPUT_PATH}" \ - --build-cache-path "${CORE_CACHE_PATH}" \ "${SKETCH_FILE_PATH}" ifeq ($(LIBONLY),) $(QUIET) cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}" From d762fd6046b27a56e8491c3146783db823125fe9 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 19 Dec 2024 14:50:19 -0800 Subject: [PATCH 2/4] Build system: allow parallel build by arduino cli --- etc/makefiles/sketch.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index 8e5378855..1cd53a533 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -180,7 +180,7 @@ compile: kaleidoscope-hardware-configured check-rosetta --library "${KALEIDOSCOPE_DIR}" \ --libraries "${KALEIDOSCOPE_DIR}/plugins/" \ --build-path "${BUILD_PATH}" \ - --output-dir "${OUTPUT_PATH}" \ + --output-dir "${OUTPUT_PATH}" -j 0 \ "${SKETCH_FILE_PATH}" ifeq ($(LIBONLY),) $(QUIET) cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}" From 72a0d206c911320bc46dc0cc9d0458e70ab1f467 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Fri, 17 May 2024 09:28:30 -0500 Subject: [PATCH 3/4] filter options from FQBN when searching for board This allows sketch.yaml to set menu options, e.g., debug options, while not interfering with automatically finding the board. Signed-off-by: Taylor Yu --- etc/makefiles/sketch.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index 1cd53a533..a58062e42 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -204,6 +204,9 @@ endif flashing_instructions = $(call _arduino_prop,build.flashing_instructions) +# Filter out board options from FQBN because board list omits them +fqbn_no_opts := $(shell echo $(FQBN) | sed 's/:[a-z_][0-9a-z_.]*=.*$$//') + flash: ${HEX_FILE_PATH} ifneq ($(flashing_instructions),) $(info $(shell printf $(flashing_instructions))) @@ -215,6 +218,6 @@ endif $(info ) @$(shell read _) $(QUIET) $(ARDUINO_CLI) upload --fqbn $(FQBN) \ - $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) | awk '{ print "--port", $$1; exit }' ) \ + $(shell $(ARDUINO_CLI) board list --format=text | grep $(fqbn_no_opts) | awk '{ print "--port", $$1; exit }' ) \ --input-dir "${OUTPUT_PATH}" \ $(ARDUINO_VERBOSE) From 59ea7c3170831130f0e985ce54775d6c3fb3a6ec Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 31 May 2024 13:47:45 -0700 Subject: [PATCH 4/4] Explicitly pass quiet into the recursive make invocation to make overriding the QUIET configuration more straightforward --- testing/makefiles/testcase.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/makefiles/testcase.mk b/testing/makefiles/testcase.mk index 5f53c00fb..10014d4f0 100644 --- a/testing/makefiles/testcase.mk +++ b/testing/makefiles/testcase.mk @@ -92,7 +92,7 @@ ${BIN_DIR}/${BIN_FILE}: compile-sketch .PHONY: compile-sketch compile-sketch: ${libcommon_a} ${TEST_OBJS} -@install -d "${BIN_DIR}" "${LIB_DIR}" - $(QUIET) env LIBONLY=yes VERBOSE=${VERBOSE} \ + $(QUIET) env LIBONLY=yes VERBOSE=${VERBOSE} QUIET=$(QUIET) \ OUTPUT_PATH="${LIB_DIR}" \ _ARDUINO_CLI_COMPILE_CUSTOM_FLAGS='--build-property upload.maximum_size=""' \ $(MAKE) -f ${top_dir}/etc/makefiles/sketch.mk compile