From f2bae608b76e7d18b23394fb68be835188c16601 Mon Sep 17 00:00:00 2001 From: WANG Xuerui Date: Thu, 21 Nov 2024 13:52:46 +0800 Subject: [PATCH 1/2] Make generation of oslist.go deterministic and re-generate Signed-off-by: WANG Xuerui --- v2/pkg/util/osgen.go | 7 +++++++ v2/pkg/util/oslist.go | 31 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/v2/pkg/util/osgen.go b/v2/pkg/util/osgen.go index b01bb034..9d51351f 100644 --- a/v2/pkg/util/osgen.go +++ b/v2/pkg/util/osgen.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore // This program generates oslist.go. It can be invoked by running @@ -10,6 +11,7 @@ import ( "log" "os" "os/exec" + "sort" "strings" "text/template" "time" @@ -52,6 +54,11 @@ func main() { i++ } + // Make the output deterministic because iteration order over Go map keys + // is random. + sort.Strings(oslist) + sort.Strings(archlist) + packageTemplate.Execute(f, struct { Timestamp time.Time OS []string diff --git a/v2/pkg/util/oslist.go b/v2/pkg/util/oslist.go index 7c228460..15d7acf2 100644 --- a/v2/pkg/util/oslist.go +++ b/v2/pkg/util/oslist.go @@ -1,36 +1,39 @@ // Code generated by go generate; DO NOT EDIT. // This file was generated by robots at -// 2021-02-09 13:11:28.537236306 -0500 EST m=+0.034330659 +// 2024-11-21 13:51:14.615514969 +0800 CST m=+0.010073007 // using data from 'go tool dist list' package util var validOS = map[string]bool{ + "aix": true, + "android": true, "darwin": true, "dragonfly": true, + "freebsd": true, "illumos": true, + "ios": true, "js": true, + "linux": true, "netbsd": true, - "plan9": true, - "aix": true, - "android": true, - "windows": true, "openbsd": true, + "plan9": true, "solaris": true, - "freebsd": true, - "linux": true, + "wasip1": true, + "windows": true, } var validArch = map[string]bool{ - "wasm": true, + "386": true, + "amd64": true, + "arm": true, + "arm64": true, + "loong64": true, "mips": true, + "mips64": true, "mips64le": true, "mipsle": true, + "ppc64": true, "ppc64le": true, - "amd64": true, - "arm64": true, - "arm": true, - "mips64": true, "riscv64": true, "s390x": true, - "ppc64": true, - "386": true, + "wasm": true, } From ad60092726c6099f9da5a05dd89d7ee0288a383d Mon Sep 17 00:00:00 2001 From: WANG Xuerui Date: Thu, 21 Nov 2024 13:54:07 +0800 Subject: [PATCH 2/2] Add cross-build target linux/loong64 Signed-off-by: WANG Xuerui --- hack/cross.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hack/cross.sh b/hack/cross.sh index cd29a42c..1634ec7e 100755 --- a/hack/cross.sh +++ b/hack/cross.sh @@ -25,6 +25,9 @@ PLATFORMS=( # ARM; 32bit and 64bit linux/arm/5 linux/arm/6 linux/arm/7 linux/arm64 + # LoongArch + linux/loong64 + # MIPS linux/mips64le