void-packages/srcpkgs/k3d/patches/go1.20.patch

144 lines
8.2 KiB
Diff

From e864603b2c60d15e6b4822d86abdbb6dcc9c275a Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 9 Feb 2023 20:20:59 +0100
Subject: [PATCH] Support go 1.20
go4.org/unsafe/assume-no-moving-gc has to be updated to a version that
explicitly defines go 1.20 as safe for this program to build with go 1.20
---
docgen/go.mod | 2 +-
docgen/go.sum | 3 ++-
go.mod | 2 +-
go.sum | 3 ++-
.../assume-no-moving-gc/assume-no-moving-gc.go | 14 +++++++++++++-
.../go4.org/unsafe/assume-no-moving-gc/untested.go | 6 +++---
vendor/modules.txt | 2 +-
7 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/docgen/go.mod b/docgen/go.mod
index 3670981c..5a3b53c4 100644
--- a/docgen/go.mod
+++ b/docgen/go.mod
@@ -78,7 +78,7 @@ require (
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.opencensus.io v0.23.0 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
- go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 // indirect
+ go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
diff --git a/docgen/go.sum b/docgen/go.sum
index 485f0d1b..92f949fb 100644
--- a/docgen/go.sum
+++ b/docgen/go.sum
@@ -864,8 +864,9 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 h1:UXLjNohABv4S58tHmeuIZDO6e3mHpW2Dx33gaNt03LE=
go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA=
-go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 h1:Tx9kY6yUkLge/pFG7IEMwDZy6CS2ajFc9TvQdPCW0uA=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
+go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760 h1:gH0IO5GDYAcawu+ThKrvAofVTgJjYaoOZ5rrC4pS2Xw=
+go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
diff --git a/go.mod b/go.mod
index 307dbd17..c70e3ae0 100644
--- a/go.mod
+++ b/go.mod
@@ -88,7 +88,7 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
go.opencensus.io v0.24.0 // indirect
go4.org/intern v0.0.0-20220617035311-6925f38cc365 // indirect
- go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
+ go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.5.0 // indirect
diff --git a/go.sum b/go.sum
index 12dc779f..43a787b6 100644
--- a/go.sum
+++ b/go.sum
@@ -857,8 +857,9 @@ go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7C
go4.org/intern v0.0.0-20220617035311-6925f38cc365 h1:t9hFvR102YlOqU0fQn1wgwhNvSbHGBbbJxX9JKfU3l0=
go4.org/intern v0.0.0-20220617035311-6925f38cc365/go.mod h1:WXRv3p7T6gzt0CcJm43AAKdKVZmcQbwwC7EwquU5BZU=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
-go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 h1:FyBZqvoA/jbNzuAWLQE2kG820zMAkcilx6BMjGbL/E4=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
+go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760 h1:gH0IO5GDYAcawu+ThKrvAofVTgJjYaoOZ5rrC4pS2Xw=
+go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
diff --git a/vendor/go4.org/unsafe/assume-no-moving-gc/assume-no-moving-gc.go b/vendor/go4.org/unsafe/assume-no-moving-gc/assume-no-moving-gc.go
index 14a41e73..fb585807 100644
--- a/vendor/go4.org/unsafe/assume-no-moving-gc/assume-no-moving-gc.go
+++ b/vendor/go4.org/unsafe/assume-no-moving-gc/assume-no-moving-gc.go
@@ -4,7 +4,11 @@
// Package go4.org/unsafe/assume-no-moving-gc exists so you can depend
// on it from unsafe code that wants to declare that it assumes that
-// the Go runtime does not using a moving garbage colllector.
+// the Go runtime does not using a moving garbage colllector. Specifically,
+// it asserts that the caller is playing stupid games with the addresses
+// of heap-allocated values. It says nothing about values that Go's escape
+// analysis keeps on the stack. Ensuring things aren't stack-allocated
+// is the caller's responsibility.
//
// This package is then updated for new Go versions when that
// is still the case and explodes at runtime with a failure
@@ -16,6 +20,14 @@
//
// There is no API.
//
+// It is intentional that this package will break code that's not updated
+// regularly to double check its assumptions about the world and new Go
+// versions. If you play stupid games with unsafe pointers, the stupid prize
+// is this maintenance cost. (The alternative would be memory corruption if
+// some unmaintained, unsafe library were built with a future version of Go
+// that worked very differently than when the unsafe library was built.)
+// Ideally you shouldn't write unsafe code, though.
+//
// The GitHub repo is at https://github.com/go4org/unsafe-assume-no-moving-gc
package assume_no_moving_gc
diff --git a/vendor/go4.org/unsafe/assume-no-moving-gc/untested.go b/vendor/go4.org/unsafe/assume-no-moving-gc/untested.go
index da4d943f..dbb16904 100644
--- a/vendor/go4.org/unsafe/assume-no-moving-gc/untested.go
+++ b/vendor/go4.org/unsafe/assume-no-moving-gc/untested.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build go1.20
-// +build go1.20
+//go:build go1.21
+// +build go1.21
package assume_no_moving_gc
@@ -22,5 +22,5 @@ func init() {
if os.Getenv(env) == v {
return
}
- panic("Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the " + v + " runtime. If you want to risk it, run with environment variable " + env + "=" + v + " set. Notably, if " + v + " adds a moving garbage collector, this program is unsafe to use.")
+ panic("Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the " + v + " runtime. If you want to risk it, run with environment variable " + env + "=\"" + v + "\" set. Notably, if " + v + " adds a moving garbage collector, this program is unsafe to use.")
}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 7bebd41b..b96a120d 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -360,7 +360,7 @@ go.opencensus.io/trace/tracestate
# go4.org/intern v0.0.0-20220617035311-6925f38cc365
## explicit; go 1.13
go4.org/intern
-# go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760
+# go4.org/unsafe/assume-no-moving-gc v0.0.0-20230209150437-ee73d164e760
## explicit; go 1.11
go4.org/unsafe/assume-no-moving-gc
# golang.org/x/crypto v0.5.0
--
2.39.1