Date: Friday, February 10, 2023 @ 19:50:19
  Author: jelle
Revision: 1399645

upgpkg: loki 2.7.3-2

Added:
  loki/trunk/no-moving-gc-bump.patch
Modified:
  loki/trunk/PKGBUILD

-------------------------+
 PKGBUILD                |   11 ++--
 no-moving-gc-bump.patch |  126 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 133 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-02-10 19:49:28 UTC (rev 1399644)
+++ PKGBUILD    2023-02-10 19:50:19 UTC (rev 1399645)
@@ -3,7 +3,7 @@
 
 pkgname=('loki' 'loki-canary' 'promtail' 'logcli')
 pkgver=2.7.3
-pkgrel=1
+pkgrel=2
 pkgdesc='like Prometheus, but for logs'
 url='https://github.com/grafana/loki'
 arch=('x86_64')
@@ -13,7 +13,7 @@
 options=('!lto')
 
source=($pkgname-$pkgver.tar.gz::https://github.com/grafana/loki/archive/v$pkgver.tar.gz
         promtail.sysusers promtail.service promtail.tmpfiles
-        loki.sysusers loki.service loki.tmpfiles)
+        loki.sysusers loki.service loki.tmpfiles no-moving-gc-bump.patch)
 
sha512sums=('ba5e5f0d93e292feff5dba30852d6e7e866f1747509900b2600d551301c77c8a52e15613eb842f078284fe59c90d017124895a504dc517bd6bd9fac6561decfb'
             
'2b6c44b18ea3c9f955a7450222180d0b20b5fc551d0b7e5d0d8949e40adc847c4166829146260f87a75732cc5473eab0347dd56fc2125517698bac0652738c74'
             
'18011b135c7817f2542f7a93b607ee46e5d61625921c7dc6e46e1b29e31c67147653b215d8677fde21cdce3b577c479cebd2d85f47e4b8cbe4c30f8be5f910cd'
@@ -20,11 +20,14 @@
             
'598042c40673a7914c5a1eeccfb78f832379a61f4360212c5d86f667343cf2fc78e98d9025f9717ea64f3e16e0a28f08cd7709706d811656722019f6167dd788'
             
'f00b3cb64b71d3ca5a422a2bdff1f81a3e2707c4f73bcb27e24338eabff039b96125c847aaae43c9b22ccc47f89585118c1d0e0b29c4eb7b6f9260c68f8a8324'
             
'03904b67617e4064a1eb39b6edfaec5d55bc85f142e867d115d3d0e12494a052fddf13bb6f5c541aaca29a18582df2332bb0cc6b8f29928cf6a0d5d2710ead74'
-            
'de40d1e6752edbf8c21317ce1ee10f98dfc869e569c07092c613f7144e261e9438683a145a2e0e37e2a9fc758c5c2f02e1d0ac1c60347e98b147e4a550ec6040')
+            
'de40d1e6752edbf8c21317ce1ee10f98dfc869e569c07092c613f7144e261e9438683a145a2e0e37e2a9fc758c5c2f02e1d0ac1c60347e98b147e4a550ec6040'
+            
'c2aca229fa7c50aa17dbd98db5d217834a6c66c6cd5d7fcd2e3d50d0236b372b611bd95f1e0a13c6d705860e45e0e3e6bff6c8b9ac5fc6014762144f3da611dc')
 
 prepare() {
   cd "$pkgname-$pkgver"
 
+  patch -F3 -Np1 -i ${srcdir}/no-moving-gc-bump.patch
+
   go mod download
 }
 
@@ -54,7 +57,7 @@
 check() {
   cd loki-$pkgver
 
-  ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.20 go test ./...
+  go test ./...
 }
 
 package_loki() {

Added: no-moving-gc-bump.patch
===================================================================
--- no-moving-gc-bump.patch                             (rev 0)
+++ no-moving-gc-bump.patch     2023-02-10 19:50:19 UTC (rev 1399645)
@@ -0,0 +1,126 @@
+From 5389c59a613327b7789938f543bfb00906c62f0b Mon Sep 17 00:00:00 2001
+From: Michal Vasilek <[email protected]>
+Date: Fri, 10 Feb 2023 11:21:33 +0100
+Subject: [PATCH] chore: update assume-no-moving-gc to fix go 1.20
+
+assume-no-moving-gc makes the program exit if the current go version was
+not explicitly specified in it as safe. This version adds go 1.20 to
+the list of safe versions which fixes running loki when built with go
+1.20.
+---
+ go.mod                                             |  2 +-
+ go.sum                                             |  4 ++--
+ operator/go.mod                                    |  2 +-
+ .../assume-no-moving-gc/assume-no-moving-gc.go     | 14 +++++++++++++-
+ .../go4.org/unsafe/assume-no-moving-gc/untested.go |  6 +++---
+ vendor/modules.txt                                 |  2 +-
+ 6 files changed, 21 insertions(+), 9 deletions(-)
+
+diff --git a/go.mod b/go.mod
+index 01284a1579..ab61dc8a09 100644
+--- a/go.mod
++++ b/go.mod
+@@ -282,7 +282,7 @@ require (
+       go.uber.org/multierr v1.8.0 // indirect
+       go.uber.org/zap v1.21.0 // indirect
+       go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // 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/mod v0.7.0 // indirect
+       golang.org/x/term v0.4.0 // indirect
+       golang.org/x/tools v0.4.0 // indirect
+diff --git a/go.sum b/go.sum
+index c5d17bca86..6827031a62 100644
+--- a/go.sum
++++ b/go.sum
+@@ -1500,8 +1500,8 @@ go.uber.org/zap v1.21.0/go.mod 
h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
+ 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/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-20180904163835-0709b304e793/go.mod 
h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod 
h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod 
h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+diff --git a/operator/go.mod b/operator/go.mod
+index 329d64bcea..5e5d4e0699 100644
+--- a/operator/go.mod
++++ b/operator/go.mod
+@@ -146,7 +146,7 @@ require (
+       go.uber.org/multierr v1.7.0 // indirect
+       go.uber.org/zap v1.21.0 // indirect
+       go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // 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.0.0-20220315160706-3147a52a75dd // indirect
+       golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
+       golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
+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 14a41e73ed..fb585807a3 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 da4d943f6b..dbb169045a 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 55c617f93e..a40b75c42e 100644
+--- a/vendor/modules.txt
++++ b/vendor/modules.txt
+@@ -1346,7 +1346,7 @@ go.uber.org/zap/zapgrpc
+ # go4.org/intern v0.0.0-20211027215823-ae77deb06f29
+ ## 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

Reply via email to