Add support for building Linux ARM64 binary in Makefile#221
Add support for building Linux ARM64 binary in Makefile#221mostlygeek merged 1 commit intomostlygeek:mainfrom aaron-ang:build-arm
Conversation
WalkthroughThe Makefile's Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
Makefile (1)
44-49: Add$(BUILD_DIR)as an explicit prerequisite to avoid “no such directory” failuresIf a fresh clone runs
make linuxbefore any other target, thebuilddirectory may not exist, causing both
go build -o $(BUILD_DIR)/…commands to fail. You already have a rule that creates the directory (Lines 65-68);
just declare it as a dependency:-linux: ui +linux: ui $(BUILD_DIR)That guarantees the directory exists regardless of build order.
🧹 Nitpick comments (2)
Makefile (2)
44-49: Consider de-duplicating linker flags to reduce maintenance overheadThe two
go buildinvocations are identical except forGOARCHand the output path. Extract the common
-ldflagsstring (and maybeGOOS) into a variable or use a pattern rule, e.g.:LDFLAGS := -ldflags="-X main.commit=$(GIT_HASH) -X main.version=local_$(GIT_HASH) -X main.date=$(BUILD_DATE)" linux: ui $(BUILD_DIR) @echo "Building Linux binaries..." $(foreach arch,amd64 arm64,\ GOOS=linux GOARCH=$(arch) go build $(LDFLAGS) -o $(BUILD_DIR)/$(APP_NAME)-linux-$(arch);)That keeps the flags in one place and makes adding new architectures trivial.
55-60: Optional: producesimple-responderfor Linux ARM 64 to stay feature-par with main binarySince the primary binary now supports arm64, you may want the helper
simple-responder(Lines 55-60) to do the same:GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/simple-responder_linux_amd64 misc/simple-responder/simple-responder.go +GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/simple-responder_linux_arm64 misc/simple-responder/simple-responder.goThis keeps tooling consistent across architectures.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Makefile(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: run-tests
🔇 Additional comments (1)
Makefile (1)
48-48: ARM 64 build step added — looks goodThe additional
GOOS=linux GOARCH=arm64invocation correctly mirrors the existing amd64 step and produces
$(APP_NAME)-linux-arm64. Nice, this closes the gap for Apple/Graviton servers and similar platforms.
|
thanks |
Summary by CodeRabbit