Skip to content

Commit

Permalink
Add a check on arm64 macos to make sure rosetta is installed.
Browse files Browse the repository at this point in the history
Fixes #1390
  • Loading branch information
obra committed Feb 19, 2024
1 parent 646f548 commit 19b9203
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions etc/makefiles/arduino-cli.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml:
arduino-update-cores:
$(QUIET) $(ARDUINO_CLI) core update-index



install-arduino-core-kaleidoscope: arduino-update-cores
$(QUIET) $(ARDUINO_CLI) core install "keyboardio:avr-tools-only"
$(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only"
Expand All @@ -147,6 +145,20 @@ install-arduino-core-deps:
$(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only"


# On arm64 macs, we need rosetta to function
.PHONY: check-rosetta
check-rosetta:
$(QUIET) if [ "$$(uname)" = "Darwin" ]; then \
if [ "$$(uname -m)" = "arm64" ]; then \
if ! pgrep oahd >/dev/null 2>&1; then \
echo "Rosetta 2 is required but not installed. Please install Rosetta 2 and try again."; \
exit 1; \
fi; \
fi; \
fi



# If we're not calling setup, we should freak out if the hardware
# definitions don't exist

Expand Down
2 changes: 1 addition & 1 deletion etc/makefiles/sketch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ifneq ("$(wildcard ${SKETCH_DIR}/.kaleidoscope_board)","")
endif


compile: kaleidoscope-hardware-configured
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} \
${_arduino_local_libraries_prop} ${_ARDUINO_CLI_COMPILE_CUSTOM_FLAGS} ${kaleidoscope_board_config}\
Expand Down

0 comments on commit 19b9203

Please sign in to comment.