From 87cb75966a79788f7c6192c0397b92c09114b104 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 14 Oct 2025 10:46:26 -0500 Subject: riscv64 builds should work --- build.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'build.go') diff --git a/build.go b/build.go index 72b1174..13bafde 100644 --- a/build.go +++ b/build.go @@ -29,10 +29,10 @@ func buildPackage(repo *gitpb.Repo) (bool, error) { arch := repo.Control["Architecture"] // c.Architecture.String() if arch == "" { - arch = "amd64" // todo: detect what you are building on + arch = argv.Arch } const layout = "200601021504" - now := time.Now() + now := time.Now().UTC() version := repo.Control["Version"] + "-" + now.Format(layout) repo.Control["Version"] = version log.Info("version is:", version) @@ -101,6 +101,10 @@ func buildPackage(repo *gitpb.Repo) (bool, error) { } else { // set the GO111 build var to true. pass the versions to the compiler manually os.Setenv("GO111MODULE", "off") + if argv.Arch == "riscv64" { + os.Setenv("GOARCH", "riscv64") + // GOOS=windows GOARCH=amd64 GO111MODULE=off go build -v -o wit.exe \ + } cmd := []string{"go", "build"} // set standard ldflag options now := time.Now() @@ -181,10 +185,12 @@ func buildPackage(repo *gitpb.Repo) (bool, error) { log.Warn("cp failed") return false, err } - cmd = []string{"strip", "files/usr/bin/" + fname} - if err := repo.RunVerbose(cmd); err != nil { - log.Warn("strip failed") - return false, err + if argv.Arch == "amd64" { + cmd = []string{"strip", "files/usr/bin/" + fname} + if err := repo.RunVerbose(cmd); err != nil { + log.Warn("strip failed") + return false, err + } } } -- cgit v1.2.3