Github messages for voidlinux
 help / color / mirror / Atom feed
From: g4s8 <g4s8@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] go: update to 1.21.0.
Date: Thu, 10 Aug 2023 20:10:39 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45525@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

There is a new pull request by g4s8 against master on the void-packages repository

https://github.com/g4s8/void-packages go-1.21
https://github.com/void-linux/void-packages/pull/45525

go: update to 1.21.0.
#### Testing the changes
- I tested the changes in this PR: **YES**

- I built this PR locally for my native architecture, (amd64)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - i686
  - aarch64
  - armv7l

This version update has patch files changes, because sources were changed. I tested it with `./xbps-src check go`.

Also `do_isntall` script changed because go binary is built with `-trimpath` option since 1.21 version, see https://github.com/golang/go/issues/61921#issuecomment-1673399370. It's recommended to use symlinks for `/usr/big/go` instead of copying binaries:
> is there a reason your script is using cp to make copies of the binaries in GOROOT/bin, instead of using ln to make /usr/bin/go a symbolic link? It seems like that would be a simpler solution, and would allow the Go toolchain installed on Void Linux to use the same [reproducible binaries](https://go.dev/rebuild) that are distributed through the Go project.



A patch file from https://github.com/void-linux/void-packages/pull/45525.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-go-1.21-45525.patch --]
[-- Type: text/x-diff, Size: 7418 bytes --]

From 4b40de172b850bf4db6f0158c3ddebb74167c8e5 Mon Sep 17 00:00:00 2001
From: Kirill <g4s8.public@gmail.com>
Date: Wed, 9 Aug 2023 18:32:14 +0400
Subject: [PATCH] go: update to 1.21.0.

---
 srcpkgs/go/patches/fix-32bit-tests.patch | 10 ++++-----
 srcpkgs/go/patches/fix-musl-tests.patch  | 16 +++++++-------
 srcpkgs/go/patches/fix-tests.patch       | 27 +++++++++++++++++++++---
 srcpkgs/go/template                      | 19 ++++++-----------
 4 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/srcpkgs/go/patches/fix-32bit-tests.patch b/srcpkgs/go/patches/fix-32bit-tests.patch
index f5d8083b19f03..7ee2df7187ec7 100644
--- a/srcpkgs/go/patches/fix-32bit-tests.patch
+++ b/srcpkgs/go/patches/fix-32bit-tests.patch
@@ -1,13 +1,13 @@
-Fixes go1.19 error on i686 - 
-    runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
+Fixes go1.21 error on i686 -
+  runtime/cgo(.text): unknown symbol __stack_chk_fail_local in pcrel
 
 --- a/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
  	"GCCGO",              // 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
diff --git a/srcpkgs/go/patches/fix-musl-tests.patch b/srcpkgs/go/patches/fix-musl-tests.patch
index f70cb456857b2..5b300f8e5ae2a 100644
--- a/srcpkgs/go/patches/fix-musl-tests.patch
+++ b/srcpkgs/go/patches/fix-musl-tests.patch
@@ -1,9 +1,9 @@
-These tests fail on musl because /proc/../status doesn't contain the "Groups"
-field, because musl lacks the getgroups() syscall.
+These tests fail on musl because /proc/../status doesn't
+contain the "Groups" field, because musl lacks the getgroups() syscall.
 
---- a/go/src/syscall/syscall_linux_test.go
-+++ b/go/src/syscall/syscall_linux_test.go
-@@ -530,10 +530,6 @@ func TestSetuidEtc(t *testing.T) {
+--- 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"},
  
@@ -14,9 +14,9 @@ field, because musl lacks the getgroups() syscall.
  		{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) {
+--- a/go/src/syscall/syscall_linux_test.go
++++ b/go/src/syscall/syscall_linux_test.go
+@@ -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"},
  
diff --git a/srcpkgs/go/patches/fix-tests.patch b/srcpkgs/go/patches/fix-tests.patch
index c934156114138..c4e8397d33d56 100644
--- a/srcpkgs/go/patches/fix-tests.patch
+++ b/srcpkgs/go/patches/fix-tests.patch
@@ -1,13 +1,26 @@
-Inside user namespaces, if GID == OVERFLOWGID (65534), then chown won't work.
-https://github.com/golang/go/issues/42525
+Inside user namespaces, if GID == OVERFLOWGID (65534), then
+chown won't work. https://github.com/golang/go/issues/42525
 
 --- a/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) {
+-	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,
 -	// so that the group ids returned by Getgroups will be allowed
 -	// 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) {
+-	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,
 -	// so that the group ids returned by Getgroups will be allowed
 -	// 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) {
+-	testenv.MustHaveSymlink(t)
+-	t.Parallel()
+-
 -	// Use TempDir() to make sure we're on a local file system,
 -	// so that the group ids returned by Getgroups will be allowed
 -	// on the file. On NFS, the Getgroups groups are
diff --git a/srcpkgs/go/template b/srcpkgs/go/template
index 6a8bed6ad01ac..dea0969cdb051 100644
--- a/srcpkgs/go/template
+++ b/srcpkgs/go/template
@@ -1,6 +1,6 @@
 # Template file for 'go'
 pkgname=go
-version=1.20.7
+version=1.21.0
 revision=1
 create_wrksrc=yes
 build_wrksrc=go
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://go.dev/"
 changelog="https://go.dev/doc/devel/release.html"
 distfiles="https://go.dev/dl/go${version}.src.tar.gz"
-checksum=2c5ee9c9ec1e733b0dbbc2bdfed3f62306e51d8172bf38f4f4e542b27520f597
+checksum=818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a
 nostrip=yes
 noverifyrdeps=yes
 # 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=$PWD
-	export GOROOT_FINAL="/usr/lib/go"
 	export GOARCH=${_goarch}
 
 	cd "src"
@@ -83,21 +82,15 @@ do_install() {
 
 	vmkdir usr/bin
 	vmkdir usr/lib/go
+	vmkdir usr/lib/go/bin
 	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 -r doc misc -t ${DESTDIR}/usr/share/go
 	ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc
 	cp VERSION ${DESTDIR}/usr/lib/go/VERSION
-
-	# This is to make go get code.google.com/p/go-tour/gotour and
-	# 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
+	# GOROOT_FINAL doesn't work anymore, see: https://github.com/golang/go/issues/61921
+	ln -sfr ${DESTDIR}/usr/lib/go/bin/* ${DESTDIR}/usr/bin
 
 	# <dominikh> sigh. well, someone fix the template and add
 	# a symlink, usr/lib/go/misc -> /usr/share/go/misc

             reply	other threads:[~2023-08-10 18:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 18:10 g4s8 [this message]
2023-08-10 18:24 ` g4s8
2023-08-11 11:54 ` mhmdanas
2023-08-12 15:42 ` [PR PATCH] [Updated] " g4s8
2023-08-12 15:47 ` g4s8
2023-08-12 16:33 ` g4s8
2023-08-12 21:15 ` g4s8
2023-08-12 21:27 ` Bnyro
2023-08-13  8:03 ` paper42
2023-08-14 15:39 ` [PR PATCH] [Updated] " g4s8
2023-08-14 15:42 ` g4s8
2023-08-14 16:01 ` mhmdanas
2023-08-14 21:11 ` [PR PATCH] [Updated] " g4s8
2023-08-21  6:18 ` g4s8
2023-08-22  7:28 ` g4s8
2023-08-22  7:29 ` g4s8
2023-08-23  8:13 ` [PR PATCH] [Updated] " g4s8
2023-08-23 21:33 ` [PR PATCH] [Closed]: " the-maldridge
2023-12-02 21:58 ` dkwo
2023-12-02 22:01 ` dkwo
2023-12-07 10:22 ` g4s8
2023-12-07 15:01 ` dkwo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45525@inbox.vuxu.org \
    --to=g4s8@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).