From 5c45ce8462f5a56ec4ee8c7a3c3c77f181a9dbf1 Mon Sep 17 00:00:00 2001 From: Peter Ebden Date: Tue, 29 Oct 2024 15:57:16 +0000 Subject: [PATCH 1/2] Remove release toolchain --- .github/workflows/puku.yaml | 2 +- .plzconfig.release | 2 -- knownimports/BUILD | 6 ++---- knownimports/known_imports.go | 3 +-- package/BUILD | 6 ------ third_party/go/BUILD | 2 +- 6 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 .plzconfig.release diff --git a/.github/workflows/puku.yaml b/.github/workflows/puku.yaml index d5815d5..b5d434a 100644 --- a/.github/workflows/puku.yaml +++ b/.github/workflows/puku.yaml @@ -22,7 +22,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Build puku - run: ./pleasew build -p -v notice --profile release //package:release_files + run: ./pleasew build -p -v notice //package:release_files - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.plzconfig.release b/.plzconfig.release deleted file mode 100644 index e781878..0000000 --- a/.plzconfig.release +++ /dev/null @@ -1,2 +0,0 @@ -[Plugin "go"] -GoTool = //package:release_toolchain|go \ No newline at end of file diff --git a/knownimports/BUILD b/knownimports/BUILD index b6d343e..ebdcdd3 100644 --- a/knownimports/BUILD +++ b/knownimports/BUILD @@ -1,10 +1,8 @@ -root = f"third_party/go/toolchain/pkg/{CONFIG.OS}_{CONFIG.ARCH}" - genrule( name = "go_root_packages", - srcs = ["//third_party/go:toolchain"], + srcs = ["//third_party/go:std"], outs = ["go_root_packages"], - cmd = f'find {root} -name "*.a" | sed -e s=^{root}/== | sed -e s="\.a\$"== > $OUT', + cmd = 'find $SRCS -name "*.a" | sed -re s=^third_party/go/std/pkg/[^/]+_[^/]+/== | sed -e s="\.a\$"== > $OUT', ) go_library( diff --git a/knownimports/known_imports.go b/knownimports/known_imports.go index 62cc1c7..1c35c6b 100644 --- a/knownimports/known_imports.go +++ b/knownimports/known_imports.go @@ -32,8 +32,7 @@ func IsInGoRoot(i string) bool { if strings.HasPrefix(i, "crypto/") { return true } - _, ok := goRootImports[i] - if ok { + if _, ok := goRootImports[i]; ok { return true } diff --git a/package/BUILD b/package/BUILD index 65b2c51..3513c2f 100644 --- a/package/BUILD +++ b/package/BUILD @@ -8,12 +8,6 @@ filegroup( subinclude(":architectures") -go_toolchain( - name = "release_toolchain", - architectures = architectures, - version = CONFIG.GO_VERSION, -) - def cross_compile(version, arch): return build_rule( name = f"puku_{arch}", diff --git a/third_party/go/BUILD b/third_party/go/BUILD index 4c8518d..389f84d 100644 --- a/third_party/go/BUILD +++ b/third_party/go/BUILD @@ -2,8 +2,8 @@ subinclude("///go//build_defs:go", "//package:architectures") go_toolchain( name = "toolchain", - architectures = architectures, version = CONFIG.GO_VERSION, + install_std = False, ) go_stdlib( From 339089b37d21aaa25df3070a20e965711c6adc0d Mon Sep 17 00:00:00 2001 From: Peter Ebden Date: Tue, 29 Oct 2024 16:01:38 +0000 Subject: [PATCH 2/2] rm build defs file --- package/BUILD | 14 +++++++------- package/architectures.build_defs | 7 ------- third_party/go/BUILD | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 package/architectures.build_defs diff --git a/package/BUILD b/package/BUILD index 3513c2f..594c4e5 100644 --- a/package/BUILD +++ b/package/BUILD @@ -1,12 +1,12 @@ subinclude("//:version") -filegroup( - name = "architectures", - srcs = ["architectures.build_defs"], - visibility = ["PUBLIC"], -) - -subinclude(":architectures") +architectures = [ + "darwin_amd64", + "darwin_arm64", + "freebsd_amd64", + "linux_amd64", + "linux_arm64", +] def cross_compile(version, arch): return build_rule( diff --git a/package/architectures.build_defs b/package/architectures.build_defs deleted file mode 100644 index 1a526ae..0000000 --- a/package/architectures.build_defs +++ /dev/null @@ -1,7 +0,0 @@ -architectures = [ - "darwin_amd64", - "darwin_arm64", - "freebsd_amd64", - "linux_amd64", - "linux_arm64", -] diff --git a/third_party/go/BUILD b/third_party/go/BUILD index 389f84d..59492e8 100644 --- a/third_party/go/BUILD +++ b/third_party/go/BUILD @@ -1,4 +1,4 @@ -subinclude("///go//build_defs:go", "//package:architectures") +subinclude("///go//build_defs:go") go_toolchain( name = "toolchain",