pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/go119



Module Name:    pkgsrc
Committed By:   nikita
Date:           Sun Dec 11 23:11:31 UTC 2022

Modified Files:
        pkgsrc/lang/go119: Makefile distinfo
Added Files:
        pkgsrc/lang/go119/patches: patch-src_sync_atomic_type.go

Log Message:
golang119: apply backported fix.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/go119/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/lang/go119/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/go119/patches/patch-src_sync_atomic_type.go

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/go119/Makefile
diff -u pkgsrc/lang/go119/Makefile:1.2 pkgsrc/lang/go119/Makefile:1.3
--- pkgsrc/lang/go119/Makefile:1.2      Sat Sep 17 10:13:56 2022
+++ pkgsrc/lang/go119/Makefile  Sun Dec 11 23:11:31 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2022/09/17 10:13:56 bsiegert Exp $
+# $NetBSD: Makefile,v 1.3 2022/12/11 23:11:31 nikita Exp $
 
 .include "../../lang/go/version.mk"
 .include "../../lang/go/bootstrap.mk"
@@ -7,6 +7,7 @@ GOVERSSUFFIX=   119
 
 DISTNAME=      go${GO${GOVERSSUFFIX}_VERSION}.src
 PKGNAME=       go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}
+PKGREVISION=   1
 CATEGORIES=    lang
 MASTER_SITES=  https://storage.googleapis.com/golang/
 

Index: pkgsrc/lang/go119/distinfo
diff -u pkgsrc/lang/go119/distinfo:1.5 pkgsrc/lang/go119/distinfo:1.6
--- pkgsrc/lang/go119/distinfo:1.5      Thu Dec  8 10:37:26 2022
+++ pkgsrc/lang/go119/distinfo  Sun Dec 11 23:11:31 2022
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2022/12/08 10:37:26 bsiegert Exp $
+$NetBSD: distinfo,v 1.6 2022/12/11 23:11:31 nikita Exp $
 
 BLAKE2s (go1.19.4.src.tar.gz) = 2b3038fc8c2c31441b5ddf98b50e5bbc7f7016bf9bae703a2c416468d4abfba6
 SHA512 (go1.19.4.src.tar.gz) = 00866e171d73170583e292439beecdaaee1b8fa907b6ab03013390b0cd7eaebfbe8cb9f9222f1af86933b50602e584677bc3aa25993c02d07a11625a62db263b
@@ -7,4 +7,5 @@ SHA1 (patch-misc_ios_clangwrap.sh) = 0a0
 SHA1 (patch-src_cmd_dist_util.go) = 2d9c2f59e27672d56f5f1a0e3f9d5101a05546a7
 SHA1 (patch-src_crypto_x509_root__bsd.go) = 0b5dead901450967109303f873a2696c65ccac35
 SHA1 (patch-src_crypto_x509_root__solaris.go) = d636a1599ede225ac339388fba2b6e253112d461
+SHA1 (patch-src_sync_atomic_type.go) = 09935db35b4671ce1930865a5cd5373eef7ffc7c
 SHA1 (patch-src_syscall_zsysnum__solaris__amd64.go) = ec28a0fa37ba9599ec1651c8e9337a2efc48a26b

Added files:

Index: pkgsrc/lang/go119/patches/patch-src_sync_atomic_type.go
diff -u /dev/null pkgsrc/lang/go119/patches/patch-src_sync_atomic_type.go:1.1
--- /dev/null   Sun Dec 11 23:11:31 2022
+++ pkgsrc/lang/go119/patches/patch-src_sync_atomic_type.go     Sun Dec 11 23:11:31 2022
@@ -0,0 +1,73 @@
+# $NetBSD: patch-src_sync_atomic_type.go,v 1.1 2022/12/11 23:11:31 nikita Exp $
+fix a regression in 1.19.4, to be included in 1.19.5
+
+From df5d4d3daab7e022335c0f3304d7b750bdd731a0 Mon Sep 17 00:00:00 2001
+From: Russ Cox <rsc%golang.org@localhost>
+Date: Tue, 15 Nov 2022 09:54:39 -0500
+Subject: [PATCH] [release-branch.go1.19] sync/atomic: allow linked list of atomic pointers again
+
+For #56603, CL 448275 added a _ [0]T field to atomic.Pointer,
+so that different kinds of atomic.Pointer are not convertible.
+
+Unfortunately, that breaks code like:
+
+       type List struct {
+               Next atomic.Pointer[List]
+       }
+
+which should be valid, just as using Next *List is valid.
+Instead, we get:
+
+       ./atomic_test.go:2533:6: invalid recursive type List
+               ./atomic_test.go:2533:6: List refers to
+               ./atomic_test.go:2534:13: "sync/atomic".Pointer refers to
+               ./atomic_test.go:2533:6: List
+
+Fix by using _[0]*T instead.
+
+For #56638.
+Fixes #57124.
+
+Change-Id: Icc4c83c691d35961d20cb14b824223d6c779ac5e
+Reviewed-on: https://go-review.googlesource.com/c/go/+/450655
+Run-TryBot: Russ Cox <rsc%golang.org@localhost>
+TryBot-Result: Gopher Robot <gobot%golang.org@localhost>
+Reviewed-by: Michael Knyszek <mknyszek%google.com@localhost>
+(cherry picked from commit b14cf3d93ae5c477dd35f13f6ba41044f01a7f7d)
+Reviewed-on: https://go-review.googlesource.com/c/go/+/452438
+Reviewed-by: Cherry Mui <cherryyz%google.com@localhost>
+Run-TryBot: Michael Pratt <mpratt%google.com@localhost>
+Reviewed-by: Michael Pratt <mpratt%google.com@localhost>
+---
+
+diff --git a/src/sync/atomic/atomic_test.go b/src/sync/atomic/atomic_test.go
+index 02d55fb..3ab5e83 100644
+--- src/sync/atomic/atomic_test.go.orig
++++ src/sync/atomic/atomic_test.go
+@@ -2605,3 +2605,9 @@
+               }()
+       }
+ }
++
++// Test that this compiles.
++// When atomic.Pointer used _ [0]T, it did not.
++type List struct {
++      Next Pointer[List]
++}
+diff --git a/src/sync/atomic/type.go b/src/sync/atomic/type.go
+index 2d1e621..93058ca 100644
+--- src/sync/atomic/type.go.orig
++++ src/sync/atomic/type.go
+@@ -37,9 +37,10 @@
+ 
+ // A Pointer is an atomic pointer of type *T. The zero value is a nil *T.
+ type Pointer[T any] struct {
+-      // Mention T in a field to disallow conversion between Pointer types.
++      // Mention *T in a field to disallow conversion between Pointer types.
+       // See go.dev/issue/56603 for more details.
+-      _ [0]T
++      // Use *T, not T, to avoid spurious recursive type definition errors.
++      _ [0]*T
+ 
+       _ noCopy
+       v unsafe.Pointer



Home | Main Index | Thread Index | Old Index