From 1d2ea91f6a7f924b6ff6bb4af34c7dafdb58b504 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 25 May 2023 13:07:17 +0200 Subject: [PATCH] eclass: install pkg/linux_{amd64,arm64} only for 1.19 or older Since Go 1.20 stopped shipping pre-compiled package archives for the standard library in $GOROOT/pkg, it became impossible to install pkg/linux_{amd64,arm64} for every version. To avoid build failure, install the library if the Go slot number is 1.19 or older. Also depend on go-bootstrap 1.17.13 or newer. See also https://go.dev/doc/go1.20. --- .../coreos-overlay/eclass/coreos-go-lang.eclass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-lang.eclass b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-lang.eclass index 9ee7e88b9c..e5f34fe9d2 100644 --- a/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-lang.eclass +++ b/sdk_container/src/third_party/coreos-overlay/eclass/coreos-go-lang.eclass @@ -32,7 +32,7 @@ IUSE="" RDEPEND="app-eselect/eselect-go" DEPEND="${RDEPEND} - >=dev-lang/go-bootstrap-1.5.3" + >=dev-lang/go-bootstrap-1.17.13" # These test data objects have writable/executable stacks. QA_EXECSTACK="usr/lib/go${GOSLOT}/src/debug/elf/testdata/*.obj" @@ -100,7 +100,12 @@ coreos-go-lang_src_install() { insinto "/usr/lib/go${GOSLOT}" doins -r doc lib src insinto "/usr/lib/go${GOSLOT}/pkg" - doins -r "pkg/include" "pkg/$(go_tuple)" + doins -r "pkg/include" + + # Install pkg/linux_{amd64,arm64} only for Go <= 1.19, as Go 1.20+ + # does not ship pre-compiled package archives for the standard library + # in $GOROOT/pkg. See https://go.dev/doc/go1.20. + ver_test "${GOSLOT}" -lt 1.20 && doins -r "pkg/$(go_tuple)" dodoc CONTRIBUTING.md PATENTS README.md }