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 loongarch64 support #9257

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ ifneq "$(strip $(LOCAL))" "true"
override EMBEDDED_FILES_CHECK = fs/assets/check.txt
endif

RACE =
ifneq ($(arch), loong64)
RACE :=
else
RACE := -race
endif

# when build for local development (`LOCAL=true make install` can skip license check)
$(BUILD_DIR)/$(PROJECT): $(EMBEDDED_FILES_CHECK) $(GO_FILES) $(BUILD_DIR)
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,-extldflags \"%\",$(LDFLAGS_$(GOOS))))
Expand Down Expand Up @@ -111,17 +118,17 @@ $(BUILD_DIR):

.PHONY: test
test: $(BUILD_DIR)
@ ./hack/gotest.sh -count=1 -race -short -timeout=90s $(SKAFFOLD_TEST_PACKAGES)
@ ./hack/gotest.sh -count=1 $(RACE) -short -timeout=90s $(SKAFFOLD_TEST_PACKAGES);
@ ./hack/checks.sh
@ ./hack/linters.sh

.PHONY: unit-tests
unit-tests: $(BUILD_DIR)
@ ./hack/gotest.sh -count=1 -race -short -timeout=90s $(SKAFFOLD_TEST_PACKAGES)
@ ./hack/gotest.sh -count=1 $(RACE) -short -timeout=90s $(SKAFFOLD_TEST_PACKAGES)

.PHONY: coverage
coverage: $(BUILD_DIR)
@ ./hack/gotest.sh -count=1 -race -cover -short -timeout=90s -coverprofile=out/coverage.txt -coverpkg="./pkg/...,./cmd/..." $(SKAFFOLD_TEST_PACKAGES)
@ ./hack/gotest.sh -count=1 $(RACE) -cover -short -timeout=90s -coverprofile=out/coverage.txt -coverpkg="./pkg/...,./cmd/..." $(SKAFFOLD_TEST_PACKAGES)
@- curl -s https://codecov.io/bash > $(BUILD_DIR)/upload_coverage && bash $(BUILD_DIR)/upload_coverage

.PHONY: checks
Expand Down
3 changes: 3 additions & 0 deletions hack/install-golint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ is_supported_platform() {
linux/386) found=0 ;;
linux/arm64) found=0 ;;
linux/riscv64) found=0 ;;
linux/loong64) found=0 ;;
esac
return $found
}
Expand Down Expand Up @@ -191,6 +192,7 @@ uname_arch() {
armv6*) arch="armv6" ;;
armv7*) arch="armv7" ;;
riscv64) arch="riscv64" ;;
loong64) arch="loong64" ;;
esac
echo ${arch}
}
Expand Down Expand Up @@ -230,6 +232,7 @@ uname_arch_check() {
s390x) return 0 ;;
amd64p32) return 0 ;;
riscv64) return 0 ;;
loong64) return 0 ;;
esac
log_crit "uname_arch_check '$(uname -m)' got converted to '$arch' which is not a GOARCH value. Please file bug report at https://github.com/client9/shlib"
return 1
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func isKnownOS(os string) error {
// Unexported function copied from "github.com/containerd/containerd/platforms"
func isKnownArch(arch string) error {
switch arch {
case "386", "amd64", "amd64p32", "arm", "armbe", "arm64", "arm64be", "ppc64", "ppc64le", "mips", "mipsle", "mips64", "mips64le", "mips64p32", "mips64p32le", "ppc", "riscv", "riscv64", "s390", "s390x", "sparc", "sparc64", "wasm":
case "386", "amd64", "amd64p32", "arm", "armbe", "arm64", "arm64be", "ppc64", "ppc64le", "mips", "mipsle", "mips64", "mips64le", "mips64p32", "mips64p32le", "loong64", "ppc", "riscv", "riscv64", "s390", "s390x", "sparc", "sparc64", "wasm":
return nil
}
return fmt.Errorf("unknown architecture %q", arch)
Expand Down