go: update to 1.21.0.

This commit is contained in:
Kirill 2023-08-09 18:32:14 +04:00 committed by Michael Aldridge
parent ad5642a71f
commit 9499a43f0a
4 changed files with 51 additions and 37 deletions

View File

@ -1,13 +1,13 @@
Fixes go1.19 error on i686 - Fixes go1.21 error on i686 -
runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
--- a/go/src/cmd/go/script_test.go --- a/go/src/cmd/go/script_test.go
+++ b/go/src/cmd/go/script_test.go +++ b/go/src/cmd/go/script_test.go
@@ -148,6 +148,7 @@ var extraEnvKeys = []string{ @@ -285,6 +285,7 @@ var extraEnvKeys = []string{
"GO_TESTING_GOTOOLS", // for gccgo testing "GO_TESTING_GOTOOLS", // for gccgo testing
"GCCGO", // for gccgo testing "GCCGO", // for gccgo testing
"GCCGOTOOLDIR", // for gccgo testing "GCCGOTOOLDIR", // for gccgo testing
+ "CGO_CFLAGS", // for working around go1.19 "unknown symbol __stack_chk_fail_local" error on x86 + "CGO_CFLAGS", // for working around "unknown symbol __stack_chk_fail_local" error on x86
} }
// setup sets up the test execution temporary directory and environment. // updateSum runs 'go mod tidy', 'go list -mod=mod -m all', or

View File

@ -1,22 +1,22 @@
These tests fail on musl because /proc/../status doesn't contain the "Groups" These tests fail on musl because /proc/../status doesn't
field, because musl lacks the getgroups() syscall. contain the "Groups" field, because musl lacks the getgroups() syscall.
--- a/go/src/cmd/cgo/internal/test/issue1435.go
+++ b/go/src/cmd/cgo/internal/test/issue1435.go
@@ -170,10 +170,6 @@ func test1435(t *testing.T) {
{call: "Setgid(1)", fn: func() error { return syscall.Setgid(1) }, filter: "Gid:", expect: "\t1\t1\t1\t1"},
{call: "Setgid(0)", fn: func() error { return syscall.Setgid(0) }, filter: "Gid:", expect: "\t0\t0\t0\t0"},
- {call: "Setgroups([]int{0,1,2,3})", fn: func() error { return syscall.Setgroups([]int{0, 1, 2, 3}) }, filter: "Groups:", expect: "\t0 1 2 3"},
- {call: "Setgroups(nil)", fn: func() error { return syscall.Setgroups(nil) }, filter: "Groups:", expect: ""},
- {call: "Setgroups([]int{0})", fn: func() error { return syscall.Setgroups([]int{0}) }, filter: "Groups:", expect: "\t0"},
-
{call: "Setregid(101,0)", fn: func() error { return syscall.Setregid(101, 0) }, filter: "Gid:", expect: "\t101\t0\t0\t0"},
{call: "Setregid(0,102)", fn: func() error { return syscall.Setregid(0, 102) }, filter: "Gid:", expect: "\t0\t102\t102\t102"},
{call: "Setregid(0,0)", fn: func() error { return syscall.Setregid(0, 0) }, filter: "Gid:", expect: "\t0\t0\t0\t0"},
--- a/go/src/syscall/syscall_linux_test.go --- a/go/src/syscall/syscall_linux_test.go
+++ b/go/src/syscall/syscall_linux_test.go +++ b/go/src/syscall/syscall_linux_test.go
@@ -530,10 +530,6 @@ func TestSetuidEtc(t *testing.T) { @@ -533,10 +533,6 @@ func TestSetuidEtc(t *testing.T) {
{call: "Setgid(1)", fn: func() error { return syscall.Setgid(1) }, filter: "Gid:", expect: "\t1\t1\t1\t1"},
{call: "Setgid(0)", fn: func() error { return syscall.Setgid(0) }, filter: "Gid:", expect: "\t0\t0\t0\t0"},
- {call: "Setgroups([]int{0,1,2,3})", fn: func() error { return syscall.Setgroups([]int{0, 1, 2, 3}) }, filter: "Groups:", expect: "\t0 1 2 3"},
- {call: "Setgroups(nil)", fn: func() error { return syscall.Setgroups(nil) }, filter: "Groups:", expect: ""},
- {call: "Setgroups([]int{0})", fn: func() error { return syscall.Setgroups([]int{0}) }, filter: "Groups:", expect: "\t0"},
-
{call: "Setregid(101,0)", fn: func() error { return syscall.Setregid(101, 0) }, filter: "Gid:", expect: "\t101\t0\t0\t0"},
{call: "Setregid(0,102)", fn: func() error { return syscall.Setregid(0, 102) }, filter: "Gid:", expect: "\t0\t102\t102\t102"},
{call: "Setregid(0,0)", fn: func() error { return syscall.Setregid(0, 0) }, filter: "Gid:", expect: "\t0\t0\t0\t0"},
--- a/go/misc/cgo/test/issue1435.go
+++ b/go/misc/cgo/test/issue1435.go
@@ -165,10 +165,6 @@ func test1435(t *testing.T) {
{call: "Setgid(1)", fn: func() error { return syscall.Setgid(1) }, filter: "Gid:", expect: "\t1\t1\t1\t1"}, {call: "Setgid(1)", fn: func() error { return syscall.Setgid(1) }, filter: "Gid:", expect: "\t1\t1\t1\t1"},
{call: "Setgid(0)", fn: func() error { return syscall.Setgid(0) }, filter: "Gid:", expect: "\t0\t0\t0\t0"}, {call: "Setgid(0)", fn: func() error { return syscall.Setgid(0) }, filter: "Gid:", expect: "\t0\t0\t0\t0"},

View File

@ -1,13 +1,26 @@
Inside user namespaces, if GID == OVERFLOWGID (65534), then chown won't work. Inside user namespaces, if GID == OVERFLOWGID (65534), then
https://github.com/golang/go/issues/42525 chown won't work. https://github.com/golang/go/issues/42525
--- a/go/src/os/os_unix_test.go --- a/go/src/os/os_unix_test.go
+++ b/go/src/os/os_unix_test.go +++ b/go/src/os/os_unix_test.go
@@ -39,144 +39,6 @@ func checkUidGid(t *testing.T, path string, uid, gid int) { @@ -7,7 +7,6 @@
package os_test
import (
- "internal/testenv"
"io"
. "os"
"path/filepath"
@@ -39,157 +38,6 @@ func checkUidGid(t *testing.T, path string, uid, gid int) {
} }
} }
-func TestChown(t *testing.T) { -func TestChown(t *testing.T) {
- if runtime.GOOS == "wasip1" {
- t.Skip("file ownership not supported on " + runtime.GOOS)
- }
- t.Parallel()
-
- // Use TempDir() to make sure we're on a local file system, - // Use TempDir() to make sure we're on a local file system,
- // so that the group ids returned by Getgroups will be allowed - // so that the group ids returned by Getgroups will be allowed
- // on the file. On NFS, the Getgroups groups are - // on the file. On NFS, the Getgroups groups are
@ -51,6 +64,11 @@ https://github.com/golang/go/issues/42525
-} -}
- -
-func TestFileChown(t *testing.T) { -func TestFileChown(t *testing.T) {
- if runtime.GOOS == "wasip1" {
- t.Skip("file ownership not supported on " + runtime.GOOS)
- }
- t.Parallel()
-
- // Use TempDir() to make sure we're on a local file system, - // Use TempDir() to make sure we're on a local file system,
- // so that the group ids returned by Getgroups will be allowed - // so that the group ids returned by Getgroups will be allowed
- // on the file. On NFS, the Getgroups groups are - // on the file. On NFS, the Getgroups groups are
@ -94,6 +112,9 @@ https://github.com/golang/go/issues/42525
-} -}
- -
-func TestLchown(t *testing.T) { -func TestLchown(t *testing.T) {
- testenv.MustHaveSymlink(t)
- t.Parallel()
-
- // Use TempDir() to make sure we're on a local file system, - // Use TempDir() to make sure we're on a local file system,
- // so that the group ids returned by Getgroups will be allowed - // so that the group ids returned by Getgroups will be allowed
- // on the file. On NFS, the Getgroups groups are - // on the file. On NFS, the Getgroups groups are

View File

@ -1,6 +1,6 @@
# Template file for 'go' # Template file for 'go'
pkgname=go pkgname=go
version=1.20.7 version=1.21.0
revision=1 revision=1
create_wrksrc=yes create_wrksrc=yes
build_wrksrc=go build_wrksrc=go
@ -12,7 +12,7 @@ license="BSD-3-Clause"
homepage="https://go.dev/" homepage="https://go.dev/"
changelog="https://go.dev/doc/devel/release.html" changelog="https://go.dev/doc/devel/release.html"
distfiles="https://go.dev/dl/go${version}.src.tar.gz" distfiles="https://go.dev/dl/go${version}.src.tar.gz"
checksum=2c5ee9c9ec1e733b0dbbc2bdfed3f62306e51d8172bf38f4f4e542b27520f597 checksum=818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a
nostrip=yes nostrip=yes
noverifyrdeps=yes noverifyrdeps=yes
# on CI it tries to use `git submodule`, which is not part of chroot-git # on CI it tries to use `git submodule`, which is not part of chroot-git
@ -55,7 +55,6 @@ do_build() {
export GOROOT_BOOTSTRAP="/usr/lib/go1.17.13" export GOROOT_BOOTSTRAP="/usr/lib/go1.17.13"
export GOROOT=$PWD export GOROOT=$PWD
export GOROOT_FINAL="/usr/lib/go"
export GOARCH=${_goarch} export GOARCH=${_goarch}
cd "src" cd "src"
@ -83,21 +82,15 @@ do_install() {
vmkdir usr/bin vmkdir usr/bin
vmkdir usr/lib/go vmkdir usr/lib/go
vmkdir usr/lib/go/bin
vmkdir usr/share/go vmkdir usr/share/go
cp -d --preserve=all ${bindir}/* ${DESTDIR}/usr/bin || true cp -d --preserve=all ${bindir}/* ${DESTDIR}/usr/lib/go/bin || true
cp -a pkg src lib ${DESTDIR}/usr/lib/go cp -a pkg src lib ${DESTDIR}/usr/lib/go
cp -r doc misc -t ${DESTDIR}/usr/share/go cp -r doc misc -t ${DESTDIR}/usr/share/go
ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc
cp VERSION ${DESTDIR}/usr/lib/go/VERSION cp VERSION ${DESTDIR}/usr/lib/go/VERSION
# GOROOT_FINAL doesn't work anymore, see: https://github.com/golang/go/issues/61921
# This is to make go get code.google.com/p/go-tour/gotour and ln -sfr ${DESTDIR}/usr/lib/go/bin/* ${DESTDIR}/usr/bin
# then running the gotour executable work out of the box.
#
# Also, /usr/bin is the place for system-wide executables,
# not /usr/lib/go/bin. Users should use different paths by
# setting the appropriate environment variables.
#
ln -sf /usr/bin ${DESTDIR}/usr/lib/go/bin
# <dominikh> sigh. well, someone fix the template and add # <dominikh> sigh. well, someone fix the template and add
# a symlink, usr/lib/go/misc -> /usr/share/go/misc # a symlink, usr/lib/go/misc -> /usr/share/go/misc