Copilot commented on code in PR #157:
URL: 
https://github.com/apache/dubbo-go-pixiu-samples/pull/157#discussion_r3294313271


##########
igt/Makefile:
##########
@@ -30,7 +30,12 @@ pixiuSources = $(wildcard $(PIXIU_DIR)/pixiu/*.go)
 export GO111MODULE ?= on
 export GOPROXY ?= https://goproxy.io,direct
 export GOSUMDB ?= sum.golang.org
-export GOARCH ?= amd64
+NATIVE_ARCH := $(shell uname -m)
+ifeq ($(NATIVE_ARCH), arm64)
+       export GOARCH ?= arm64
+else
+       export GOARCH ?= amd64

Review Comment:
   These lines appear to start with a tab. In Makefiles, a leading tab at the 
top level is interpreted as a recipe line and can trigger errors like `recipe 
commences before first target`. Remove the leading tab/indentation so `export 
GOARCH ?= ...` is a normal directive (consistent with the surrounding `export` 
lines).
   



##########
igt/Makefile:
##########
@@ -30,7 +30,12 @@ pixiuSources = $(wildcard $(PIXIU_DIR)/pixiu/*.go)
 export GO111MODULE ?= on
 export GOPROXY ?= https://goproxy.io,direct
 export GOSUMDB ?= sum.golang.org
-export GOARCH ?= amd64
+NATIVE_ARCH := $(shell uname -m)
+ifeq ($(NATIVE_ARCH), arm64)
+       export GOARCH ?= arm64
+else
+       export GOARCH ?= amd64
+endif

Review Comment:
   `uname -m` commonly returns `aarch64` on Linux (not `arm64`), and `x86_64` 
on Intel/AMD machines (not `amd64`). With the current equality check, an ARM64 
Linux host would likely fall into the `amd64` branch and produce incorrect 
builds. Consider normalizing `NATIVE_ARCH` (e.g., mapping `aarch64` -> `arm64`, 
`x86_64` -> `amd64`) or defaulting `GOARCH` from `go env GOARCH` when 
available, while still allowing overrides via `GOARCH ?=`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to