Add support for golang 1.17.5

Compile golang 1.17.5 to support k8s 1.23.1
golang 1.17.5 will be the default for any code
that does not specify a particular version.

Tested by building and installing ISO with k8s
1.23.1  Verified k8s 1.23.1 is running and that
pods can be launched.

Story: 2009830
Task: 44424

Change-Id: I07a492c0fed0d3268bc11dc7bf9460639b2fc001
Signed-off-by: Gleb Aronsky <gleb.aronsky@windriver.com>
This commit is contained in:
Gleb Aronsky 2022-01-19 17:00:56 -05:00
parent 39f299c200
commit c51ef03cd1
22 changed files with 3122 additions and 1 deletions

View File

@ -4,3 +4,4 @@ tools/golang-dep
tools/rpm
languages/python-2.7.5
languages/golang-1.16.12
languages/golang-1.17.5

View File

@ -2,4 +2,4 @@ dep-v0.5.0.tar.gz#dep-v0.5.0#https://github.com/golang/dep/archive/v0.5.0.tar.gz
dwarves-1.22.tar.bz2#dwarves-1.22#https://fedorapeople.org/~acme/dwarves/dwarves-1.22.tar.bz2#https##
rpm-4.14.0.tar.bz2#rpm-4.14.0#https://ftp.osuosl.org/pub/rpm/releases/rpm-4.14.x/rpm-4.14.0.tar.bz2#http##
go1.16.12.src.tar.gz#go-16.12#https://storage.googleapis.com/golang/go1.16.12.src.tar.gz##https##
go1.17.5.src.tar.gz#go-1.17.5#https://storage.googleapis.com/golang/go1.17.5.src.tar.gz##https##

View File

@ -1,3 +1,4 @@
languages/bash
languages/golang-1.16.12
languages/golang-1.17.5
tools/golang-dep

View File

@ -0,0 +1,7 @@
The spec file used here was from the golang 1.17.5 src rpm.
https://kojipkgs.fedoraproject.org//packages/golang/1.17.5/1.fc36/src/golang-1.17.5-1.fc36.src.rpm
The orig file is included to help show modifications made to that
spec file, to help understand which changes were needed and to
assist with future upversioning.

View File

@ -0,0 +1,8 @@
VERSION=1.17.5
TAR_NAME=go
TAR="$TAR_NAME$VERSION.src.tar.gz"
CONTRIB="$TAR_NAME-contrib-v$CON_VERSION.tar.gz"
COPY_LIST="${CGCS_BASE}/downloads/$TAR $FILES_BASE/*"
TIS_PATCH_VER=PKG_GITREVCOUNT

View File

@ -0,0 +1,88 @@
From f3d446b60a082308ec5aaa2fdc36e31f566081bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
Date: Thu, 22 Mar 2018 11:49:09 +0100
Subject: [PATCH 1/3] Don't use the bundled tzdata at runtime, except for the
internal test suite
---
src/time/internal_test.go | 7 +++++--
src/time/zoneinfo_test.go | 3 ++-
src/time/zoneinfo_unix.go | 2 --
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
index 35ce69b228..1cea04ed7e 100644
--- a/src/time/internal_test.go
+++ b/src/time/internal_test.go
@@ -4,13 +4,15 @@
package time
+import "runtime"
+
func init() {
// force US/Pacific for time zone tests
ForceUSPacificForTesting()
}
func initTestingZone() {
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
if err != nil {
panic("cannot load America/Los_Angeles for testing: " + err.Error())
}
@@ -21,8 +23,9 @@ func initTestingZone() {
var OrigZoneSources = zoneSources
func forceZipFileForTesting(zipOnly bool) {
- zoneSources = make([]string, len(OrigZoneSources))
+ zoneSources = make([]string, len(OrigZoneSources)+1)
copy(zoneSources, OrigZoneSources)
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if zipOnly {
zoneSources = zoneSources[len(zoneSources)-1:]
}
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
index 277b68f798..be2aa6c687 100644
--- a/src/time/zoneinfo_test.go
+++ b/src/time/zoneinfo_test.go
@@ -9,6 +9,7 @@ import (
"fmt"
"os"
"reflect"
+ "runtime"
"testing"
"time"
)
@@ -139,7 +140,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
t.Fatal(err)
}
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if err != nil {
t.Fatal(err)
}
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index d2465eef65..b8c934c9a9 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -12,7 +12,6 @@
package time
import (
- "runtime"
"syscall"
)
@@ -22,7 +21,6 @@ var zoneSources = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
func initLocal() {
--
2.26.2

View File

@ -0,0 +1,41 @@
From 67a4711d09c6595c17f32470c15bf471c287777d Mon Sep 17 00:00:00 2001
From: Michael Munday <munday@ca.ibm.com>
Date: Tue, 17 Jan 2017 11:33:38 -0500
Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x
Exposing this field on s390x improves compatibility with the other
linux architectures, all of which already expose it.
Fixes #18628 and updates #18632.
Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5
---
src/syscall/ztypes_linux_s390x.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
index 91f5ceff20..59a8b1fccd 100644
--- a/src/syscall/ztypes_linux_s390x.go
+++ b/src/syscall/ztypes_linux_s390x.go
@@ -449,12 +449,12 @@ type RtAttr struct {
}
type IfInfomsg struct {
- Family uint8
- _ uint8
- Type uint16
- Index int32
- Flags uint32
- Change uint32
+ Family uint8
+ X__ifi_pad uint8
+ Type uint16
+ Index int32
+ Flags uint32
+ Change uint32
}
type IfAddrmsg struct {
--
2.26.2

View File

@ -0,0 +1,48 @@
From fa250374b727439159bc9f203b854bb5df00186f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
Date: Mon, 27 May 2019 15:12:53 +0200
Subject: [PATCH 3/3] cmd/go: disable Google's proxy and sumdb
---
src/cmd/go/internal/cfg/cfg.go | 4 ++--
src/cmd/go/testdata/script/mod_sumdb_golang.txt | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index 57a3c1ff6f..e56c60e591 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -266,8 +266,8 @@ var (
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", buildcfg.GOPPC64))
GOWASM = envOr("GOWASM", fmt.Sprint(buildcfg.GOWASM))
- GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
- GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
+ GOPROXY = envOr("GOPROXY", "direct")
+ GOSUMDB = envOr("GOSUMDB", "off")
GOPRIVATE = Getenv("GOPRIVATE")
GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
diff --git a/src/cmd/go/testdata/script/mod_sumdb_golang.txt b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
index becd88b52e..b2a1250372 100644
--- a/src/cmd/go/testdata/script/mod_sumdb_golang.txt
+++ b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
@@ -2,12 +2,12 @@
env GOPROXY=
env GOSUMDB=
go env GOPROXY
-stdout '^https://proxy.golang.org,direct$'
+stdout '^direct$'
go env GOSUMDB
-stdout '^sum.golang.org$'
+stdout '^off$'
env GOPROXY=https://proxy.golang.org
go env GOSUMDB
-stdout '^sum.golang.org$'
+stdout '^off$'
# Download direct from github.
--
2.31.1

View File

@ -0,0 +1,7 @@
// +build rpm_crashtraceback
package runtime
func init() {
setTraceback("crash")
}

View File

@ -0,0 +1 @@
add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py

View File

@ -0,0 +1,3 @@
# there are ELF files in src which are testdata and shouldn't be modified
-b /usr/lib/golang/src
-b /usr/lib64/golang/src

View File

@ -0,0 +1,8 @@
# Where to set GOPATH for builds. Like:
# export GOPATH=$(pwd)/_build:%{gopath}
%gopath %{_datadir}/gocode
# for use like:
# ExclusiveArch: %{go_arches}
%go_arches %{ix86} x86_64 %{arm} aarch64 ppc64le

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
From 19ef607a04c167afce503ffd16d3d7faca12b9f4 Mon Sep 17 00:00:00 2001
From: Li Zhou <li.zhou@windriver.com>
Date: Thu, 16 Sep 2021 05:42:13 +0000
Subject: [PATCH] golang: add extra files to the package to keep aligned with
stx
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
debian/extra/golang.conf | 3 +++
debian/extra/golang.gdb | 1 +
debian/rules | 8 ++++++++
3 files changed, 12 insertions(+)
create mode 100644 debian/extra/golang.conf
create mode 100644 debian/extra/golang.gdb
diff --git a/debian/extra/golang.conf b/debian/extra/golang.conf
new file mode 100644
index 0000000..471e8e6
--- /dev/null
+++ b/debian/extra/golang.conf
@@ -0,0 +1,3 @@
+# there are ELF files in src which are testdata and shouldn't be modified
+-b /usr/lib/golang/src
+-b /usr/lib64/golang/src
diff --git a/debian/extra/golang.gdb b/debian/extra/golang.gdb
new file mode 100644
index 0000000..ecddca6
--- /dev/null
+++ b/debian/extra/golang.gdb
@@ -0,0 +1 @@
+add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py
diff --git a/debian/rules b/debian/rules
index 7f859dc..fd2ba61 100755
--- a/debian/rules
+++ b/debian/rules
@@ -96,6 +96,14 @@ execute_after_dh_install-indep:
chmod a+x debian/golang-$(GOVER)-src/usr/share/go-$(GOVER)/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh
chmod a+x debian/golang-$(GOVER)-src/usr/share/go-$(GOVER)/src/cmd/vendor/golang.org/x/sys/windows/mkerrors.bash
+_sysconfdir=/etc/
+override_dh_auto_install:
+ dh_auto_install
+ # gdbinit
+ dh_install debian/extra/golang.gdb $(buildroot)/$(_sysconfdir)/gdbinit.d/
+ # prelink blacklist
+ dh_install debian/extra/golang.conf $(buildroot)/$(_sysconfdir)/prelink.conf.d/
+
override_dh_strip:
dh_strip -Xtestdata
--
2.30.2

View File

@ -0,0 +1 @@
0001-golang-add-extra-files-to-the-package-to-keep-aligne.patch

View File

@ -0,0 +1,6 @@
debver: 1.17.5-1~bpo11+1
debname: golang-1.17
archive: https://snapshot.debian.org/archive/debian/20220113T205630Z/pool/main/g/golang-1.17/
revision:
dist: $STX_DIST
PKG_GITREVCOUNT:

View File

@ -0,0 +1,27 @@
From c37f383f8e816cbbe4d34daceb09fc8684cba5c8 Mon Sep 17 00:00:00 2001
From: Li Zhou <li.zhou@windriver.com>
Date: Wed, 15 Sep 2021 14:57:59 +0800
Subject: [PATCH] Add fedora.go to src/runtime dir
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
src/runtime/fedora.go | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 src/runtime/fedora.go
diff --git a/src/runtime/fedora.go b/src/runtime/fedora.go
new file mode 100644
index 00000000..81b28ba3
--- /dev/null
+++ b/src/runtime/fedora.go
@@ -0,0 +1,7 @@
+// +build rpm_crashtraceback
+
+package runtime
+
+func init() {
+ setTraceback("crash")
+}
--
2.30.2

View File

@ -0,0 +1,88 @@
From f3d446b60a082308ec5aaa2fdc36e31f566081bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
Date: Thu, 22 Mar 2018 11:49:09 +0100
Subject: [PATCH 1/3] Don't use the bundled tzdata at runtime, except for the
internal test suite
---
src/time/internal_test.go | 7 +++++--
src/time/zoneinfo_test.go | 3 ++-
src/time/zoneinfo_unix.go | 2 --
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
index 35ce69b228..1cea04ed7e 100644
--- a/src/time/internal_test.go
+++ b/src/time/internal_test.go
@@ -4,13 +4,15 @@
package time
+import "runtime"
+
func init() {
// force US/Pacific for time zone tests
ForceUSPacificForTesting()
}
func initTestingZone() {
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
if err != nil {
panic("cannot load America/Los_Angeles for testing: " + err.Error())
}
@@ -21,8 +23,9 @@ func initTestingZone() {
var OrigZoneSources = zoneSources
func forceZipFileForTesting(zipOnly bool) {
- zoneSources = make([]string, len(OrigZoneSources))
+ zoneSources = make([]string, len(OrigZoneSources)+1)
copy(zoneSources, OrigZoneSources)
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if zipOnly {
zoneSources = zoneSources[len(zoneSources)-1:]
}
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
index 277b68f798..be2aa6c687 100644
--- a/src/time/zoneinfo_test.go
+++ b/src/time/zoneinfo_test.go
@@ -9,6 +9,7 @@ import (
"fmt"
"os"
"reflect"
+ "runtime"
"testing"
"time"
)
@@ -139,7 +140,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
t.Fatal(err)
}
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if err != nil {
t.Fatal(err)
}
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index d2465eef65..b8c934c9a9 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -12,7 +12,6 @@
package time
import (
- "runtime"
"syscall"
)
@@ -22,7 +21,6 @@ var zoneSources = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
func initLocal() {
--
2.26.2

View File

@ -0,0 +1,41 @@
From 67a4711d09c6595c17f32470c15bf471c287777d Mon Sep 17 00:00:00 2001
From: Michael Munday <munday@ca.ibm.com>
Date: Tue, 17 Jan 2017 11:33:38 -0500
Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x
Exposing this field on s390x improves compatibility with the other
linux architectures, all of which already expose it.
Fixes #18628 and updates #18632.
Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5
---
src/syscall/ztypes_linux_s390x.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
index 91f5ceff20..59a8b1fccd 100644
--- a/src/syscall/ztypes_linux_s390x.go
+++ b/src/syscall/ztypes_linux_s390x.go
@@ -449,12 +449,12 @@ type RtAttr struct {
}
type IfInfomsg struct {
- Family uint8
- _ uint8
- Type uint16
- Index int32
- Flags uint32
- Change uint32
+ Family uint8
+ X__ifi_pad uint8
+ Type uint16
+ Index int32
+ Flags uint32
+ Change uint32
}
type IfAddrmsg struct {
--
2.26.2

View File

@ -0,0 +1,50 @@
From: =?utf-8?q?Jakub_=C4=8Cajka?= <jcajka@redhat.com>
Date: Mon, 27 May 2019 15:12:53 +0200
Subject: [PATCH 3/4] cmd/go: disable Google's proxy and sumdb
---
src/cmd/go/internal/cfg/cfg.go | 10 +++++-----
src/cmd/go/testdata/script/mod_sumdb_golang.txt | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index 57a3c1f..b0839be 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -266,11 +266,11 @@ var (
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", buildcfg.GOPPC64))
GOWASM = envOr("GOWASM", fmt.Sprint(buildcfg.GOWASM))
- GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
- GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
- GOPRIVATE = Getenv("GOPRIVATE")
- GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
- GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
+ GOPROXY = envOr("GOPROXY", "direct")
+ GOSUMDB = envOr("GOSUMDB", "off")
+ GOPRIVATE = Getenv("GOPRIVATE")
+ GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
+ GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
GOINSECURE = Getenv("GOINSECURE")
GOVCS = Getenv("GOVCS")
)
diff --git a/src/cmd/go/testdata/script/mod_sumdb_golang.txt b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
index becd88b..b2a1250 100644
--- a/src/cmd/go/testdata/script/mod_sumdb_golang.txt
+++ b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
@@ -2,12 +2,12 @@
env GOPROXY=
env GOSUMDB=
go env GOPROXY
-stdout '^https://proxy.golang.org,direct$'
+stdout '^direct$'
go env GOSUMDB
-stdout '^sum.golang.org$'
+stdout '^off$'
env GOPROXY=https://proxy.golang.org
go env GOSUMDB
-stdout '^sum.golang.org$'
+stdout '^off$'
# Download direct from github.

View File

@ -0,0 +1,4 @@
0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch
0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch
0001-Add-fedora.go-to-src-dir.patch
0003-cmd-go-disable-Google-s-proxy-and-sumdb.patch