Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a check on arm64 macos to make sure rosetta is installed. #1391

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading