Skip to content

Commit 34a26b8

Browse files
committed
fix(Makefile): improve build process for arm64
1 parent ab97fbb commit 34a26b8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
PROJECT_ROOT := $(shell git rev-parse --show-toplevel)
22
GO_FILES := $(shell git ls-files '*.go' '*.sum')
33
IMAGE_FILES := $(shell find deploy)
4-
ARCH ?= linux/amd64
5-
SYSBOX_SHA ?= f02ffb48eae99d6c884c9aa0378070cc716d028f58e87deec5ae00a41b706fe8
4+
ARCH := "linux/$(shell go env GOARCH)"
5+
SYSBOX_SHA := $(shell ARCH=$(ARCH) ./scripts/sysbox_sha.sh)
66

77
.PHONY: clean
88
clean:
99
rm -rf build
1010

1111
build/envbox: $(GO_FILES)
12-
CGO_ENABLED=0 go build -o build/envbox ./cmd/envbox
12+
CGO_ENABLED=0 GOOS=linux go build -o build/envbox ./cmd/envbox
1313

1414
.PHONY: build/image/envbox
1515
build/image/envbox: build/image/envbox/.ctx

scripts/sysbox_sha.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
declare -A sysbox_shas
4+
sysbox_shas["linux/amd64"]="f02ffb48eae99d6c884c9aa0378070cc716d028f58e87deec5ae00a41b706fe8"
5+
sysbox_shas["linux/arm64"]="d9267eb176190b96dcfa29ba4c4c685a26a4a1aca1d7f15deb31ec33ed63de15"
6+
7+
ARCH="${ARCH:-linux/amd64}"
8+
printf "%s" "${sysbox_shas[$ARCH]}"

0 commit comments

Comments
 (0)