[PATCH 00/13] Add go-1.16 and build with gccgo

DoneSubmitted by Sarah Morgensen.
Details
3 participants
  • Efraim Flashner
  • Sarah Morgensen
  • Maxim Cournoyer
Owner
unassigned
Severity
normal
S
S
Sarah Morgensen wrote on 25 Jun 2021 08:52
(address . guix-patches@gnu.org)
cover.1624602942.git.iskarian@mgsn.dev
Hello Guix,

This patch adds go 1.16, but does *not* make it the default for other packages
which use go (as suggested in [2]). There have been a lot of changes between
1.14 and 1.16, and while I have fixed many issues, I am sure continued testing
will uncover many more.

This patch is based on [0], which adds gccgo-10.

With this patch, go automatically bootstraps from gccgo[0][1] on platforms not
supported by go 1.4, but you can do so on any platform with:

guix build go --with-input=go@1.4-bootstrap-20171003=gccgo@10

Additionally, to build packages with 1.16:

guix build <package> --with-input=go@1.14=go@1.16

I would appreciate testing and feedback on the new bootstrap process,
especially from powerpc64le users, as I have only been able to test on x86-64.
(Note that it took about two hours for gccgo to build and 30 minutes for gccgo
to build go.)

Changes from 1.14:

* Bootstrap with gccgo on platforms which do not support go 1.4 (see above)
* Use GO_LDSO to set the interpreter rather than patching files
* Fix typo in cgoldflags patch ("-rpath=" > "-Wl,-rpath=")
* Fix and re-enable some cgo/gccgo tests
* Remove references to perl (used for tests) to reduce closure size by 10%
* Set GOCACHE so go doesn't complain that it can't access it $HOME
* Break out tests into "check" phase so builders have more control

I have successfully built and tested most go packages on x86-64, including
restic, syncthing, chezmoi, and exercism.

However... docker does not pass tests. It should probably be updated to 20.10,
but it is a very complicated package and I do not have the skill to do so. I
attempted to backport some of the fixes, but that was also beyond my abilities.

Perhaps someone else will rise to the challenge? :)

Sarah

[0] https://issues.guix.gnu.org/49019 [PATCH 0/1] gnu: Add gccgo-10.
[1] https://issues.guix.gnu.org/28226 Build go with gccgo
[2] https://issues.guix.gnu.org/45161 [PATCH] Added Go 1.16.2

Sarah Morgensen (13):
gnu: go-github-com-puerkitobio-goquery: Update to 1.7.0.
gnu: go-go-uber-org-atomic: Update to 1.8.0.
gnu: go-github-com-sergi-go-diff: Update to 1.2.0.
gnu: go-github-com-pelletier-go-toml: Update to 1.9.3.
gnu: go-github-com-masterminds-goutils: Update to 1.1.1.
gnu: go-github-com-magiconair-properties: Update to 1.8.5.
gnu: go-github-com-dlclark-regexp2: Update to 1.4.0.
gnu: earlyoom: Patch tests for go-1.16.
gnu: go-github-com-bmatcuk-doublestar: Remove test incompatible with
go-1.16.
gnu: restic: Patch tests for go-1.16.
gnu: go-gopkg-in-check-v1: Update to latest.
gnu: go-etcd-io-bbolt: Update to 1.3.6.
gnu: Add go-1.16.

gnu/local.mk | 4 +
gnu/packages/backup.scm | 5 +-
gnu/packages/golang.scm | 243 +++++++++++++++---
gnu/packages/linux.scm | 4 +-
.../earlyoom-1.6.2-disable-go-module.patch | 17 ++
.../patches/go-fix-script-tests.patch | 18 ++
...m-bmatcuk-doublestar-1.3-remove-test.patch | 15 ++
.../restic-0.9.6-fix-tests-for-go1.15.patch | 51 ++++
8 files changed, 314 insertions(+), 43 deletions(-)
create mode 100644 gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch
create mode 100644 gnu/packages/patches/go-fix-script-tests.patch
create mode 100644 gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
create mode 100644 gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch


base-commit: c7804cd97b28ef012acc20c1d861904e9592382b
prerequisite-patch-id: edb56de17ac3cce58402c83a9671b00381dfee76
--
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:20
[PATCH 01/13] gnu: go-github-com-puerkitobio-goquery: Update to 1.7.0.
(address . 49221@debbugs.gnu.org)
8f3694da5501c292517f77d16ff327fecdf8636a.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-github-com-puerkitobio-goquery): Update to 1.7.0.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1d17f02cdd..c08c3cd821 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5518,7 +5518,7 @@ the parse trees produced by the html package.")
 (define-public go-github-com-puerkitobio-goquery
   (package
     (name "go-github-com-puerkitobio-goquery")
-    (version "1.5.1")
+    (version "1.7.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -5527,7 +5527,7 @@ the parse trees produced by the html package.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "08nf88cg663slzqr51k2jxlm1krnh86nrzwbk6v41ccq5jkfm7fx"))))
+                "0gh1d99l5xc9hvwa4j40pfq3y9vfyq52mnrz6bf1kw2r2zr2gbcc"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/PuerkitoBio/goquery"))
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:20
[PATCH 02/13] gnu: go-go-uber-org-atomic: Update to 1.8.0.
(address . 49221@debbugs.gnu.org)
dbd94f910957abb6562a1ca84f3af77db6795d18.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-go-uber-org-atomic): Update to 1.8.0.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index c08c3cd821..e9c8969263 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6894,7 +6894,7 @@ programs that use traditional command lines.")
 (define-public go-go-uber-org-atomic
   (package
     (name "go-go-uber-org-atomic")
-    (version "1.7.0")
+    (version "1.8.0")
     (source
      (origin
        (method git-fetch)
@@ -6903,7 +6903,7 @@ programs that use traditional command lines.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0yxvb5sixh76cl9j8dpa97gznj0p8pmg2cdw0ypfwhd3ipx9wph1"))))
+        (base32 "0grswsk7nkf7zmmychf6aj6032shyag1kgs6zf7qwxyn55dym1v8"))))
     (build-system go-build-system)
     (arguments
      '(#:import-path "go.uber.org/atomic"))
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:20
[PATCH 04/13] gnu: go-github-com-pelletier-go-toml: Update to 1.9.3.
(address . 49221@debbugs.gnu.org)
71692884fbcab382d73b65f1f83633ec8d5b9af1.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-github-com-pelletier-go-toml): Update to 1.9.3.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index f4f31b2943..9c9543e059 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2050,7 +2050,7 @@ application's http.Handlers.")
 (define-public go-github-com-pelletier-go-toml
   (package
     (name "go-github-com-pelletier-go-toml")
-    (version "1.8.0")
+    (version "1.9.3")
     (source
      (origin
        (method git-fetch)
@@ -2060,7 +2060,7 @@ application's http.Handlers.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0fxmjm85c9h43lvqz71wr93fcc63bhj82nwby80222xx8ja63g7y"))))
+         "0cqwnvlgs1wgdgjxlwv8j52f7d6syniadr51sjh2fya99m5wzvsn"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/pelletier/go-toml"))
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:20
[PATCH 03/13] gnu: go-github-com-sergi-go-diff: Update to 1.2.0.
(address . 49221@debbugs.gnu.org)
d58472c4f8a61c9fd544da3e82a44ee5b8edeb97.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-github-com-sergi-go-diff): Update to 1.2.0.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index e9c8969263..f4f31b2943 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5402,7 +5402,7 @@ can be used almost directly in Go source code.")
 (define-public go-github-com-sergi-go-diff
   (package
     (name "go-github-com-sergi-go-diff")
-    (version "1.1.0")
+    (version "1.2.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -5411,7 +5411,7 @@ can be used almost directly in Go source code.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0ir8ali2vx0j7pipmlfd6k8c973akyy2nmbjrf008fm800zcp7z2"))))
+                "0cbj8nshllq102iiav0k1s01b8gwbkzj674g71n938qqna32y2pa"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/sergi/go-diff/diffmatchpatch"
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:20
[PATCH 05/13] gnu: go-github-com-masterminds-goutils: Update to 1.1.1.
(address . 49221@debbugs.gnu.org)
9209526b2cc2dff8491e4958087df6f72d557810.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-github-com-masterminds-goutils): Update to 1.1.1.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 9c9543e059..97caa6ac35 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5169,7 +5169,7 @@ suffix comparison, rather than the string-based or tree-based approaches.")
 (define-public go-github-com-masterminds-goutils
   (package
     (name "go-github-com-masterminds-goutils")
-    (version "1.1.0")
+    (version "1.1.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -5178,7 +5178,7 @@ suffix comparison, rather than the string-based or tree-based approaches.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "180px47gj936qyk5bkv5mbbgiil9abdjq6kwkf7sq70vyi9mcfiq"))))
+                "09m4mbcdlv9ng3xcrmjlxi0niavby52y9nl2jhjnbx1xxpjw0jrh"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/Masterminds/goutils"))
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 07/13] gnu: go-github-com-dlclark-regexp2: Update to 1.4.0.
(address . 49221@debbugs.gnu.org)
15c7d50ca4e08e7a89a0b8798d58159e8f141379.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-github-com-dlclark-regexp2): Update to 1.4.0.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 0760090651..9d5fc36710 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5327,7 +5327,7 @@ matching and globbing with support for \"doublestar\" patterns.")
 (define-public go-github-com-dlclark-regexp2
   (package
     (name "go-github-com-dlclark-regexp2")
-    (version "1.2.0")
+    (version "1.4.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -5336,7 +5336,7 @@ matching and globbing with support for \"doublestar\" patterns.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "011l1prsywvhhi0yc7qmpsca1cwavmawyyld5kjzi0ff9ghvj4ng"))))
+                "1irfv89b7lfkn7k3zgx610ssil6k61qs1wjj31kvqpxb3pdx4kry"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/dlclark/regexp2"))
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:20
[PATCH 06/13] gnu: go-github-com-magiconair-properties: Update to 1.8.5.
(address . 49221@debbugs.gnu.org)
b959786738e739089d40c388868e5e49dbd2ca00.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-github-com-magiconair-properties): Update to 1.8.5.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 97caa6ac35..0760090651 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2028,7 +2028,7 @@ application's http.Handlers.")
 (define-public go-github-com-magiconair-properties
   (package
     (name "go-github-com-magiconair-properties")
-    (version "1.8.4")
+    (version "1.8.5")
     (source
      (origin
        (method git-fetch)
@@ -2038,7 +2038,7 @@ application's http.Handlers.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0q7d55z0v8y55dyy8nhgdnswf5zkgj3i87irbk294nvzhx01bnxd"))))
+         "0v4agnkhc30fblbmhs0gq2bikhdnnmqmpp4phrnza68m04j5hxbn"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/magiconair/properties"))
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 08/13] gnu: earlyoom: Patch tests for go-1.16.
(address . 49221@debbugs.gnu.org)
d87a3ee5609501d82a1cd386301bb4a10011d3c1.1624602942.git.iskarian@mgsn.dev
* gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/linux.scm (earlyoom): Use it.
---
gnu/local.mk | 1 +
gnu/packages/linux.scm | 4 +++-
.../earlyoom-1.6.2-disable-go-module.patch | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch

Toggle diff (59 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 509970f044..9caae52306 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -968,6 +968,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/dstat-skip-devices-without-io.patch	\
   %D%/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch	\
   %D%/packages/patches/dvd+rw-tools-add-include.patch 		\
+  %D%/packages/patches/earlyoom-1.6.2-disable-go-module.patch	\
   %D%/packages/patches/ecl-16-format-directive-limit.patch	\
   %D%/packages/patches/ecl-16-ignore-stderr-write-error.patch	\
   %D%/packages/patches/ecl-16-libffi.patch			\
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 65f9057077..1f0b4cdb8e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3393,7 +3394,8 @@ from the module-init-tools project.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
+                "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))
+              (patches (search-patches "earlyoom-1.6.2-disable-go-module.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch b/gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch
new file mode 100644
index 0000000000..f7ef1222ed
--- /dev/null
+++ b/gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch
@@ -0,0 +1,17 @@
+Explicitly disable Go module support for testing with Go >= 1.15
+
+diff --git a/Makefile b/Makefile
+index e072c1b..f301f00 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,8 +83,8 @@ format: earlyoom
+ 
+ test: earlyoom
+ 	cppcheck -q . || echo "skipping optional cppcheck"
+-	go test -v
++	GO111MODULE=off go test -v
+ 
+ .PHONY: bench
+ bench:
+-	go test -run=NONE -bench=.
++	GO111MODULE=off go test -run=NONE -bench=.
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 09/13] gnu: go-github-com-bmatcuk-doublestar: Remove test incompatible with go-1.16.
(address . 49221@debbugs.gnu.org)
00966aa0d291e3eeed89103fc456981171b403cf.1624602942.git.iskarian@mgsn.dev
* gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/golang.scm (go-github-com-bmatcuk-doublestar): Use it.
---
gnu/local.mk | 1 +
gnu/packages/golang.scm | 5 ++++-
...b-com-bmatcuk-doublestar-1.3-remove-test.patch | 15 +++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch

Toggle diff (51 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 9caae52306..a176772ece 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1172,6 +1172,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gobject-introspection-cc.patch		\
   %D%/packages/patches/gobject-introspection-girepository.patch	\
   %D%/packages/patches/go-skip-gc-test.patch			\
+  %D%/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch	\
   %D%/packages/patches/gpm-glibc-2.26.patch			\
   %D%/packages/patches/gpodder-disable-updater.patch		\
   %D%/packages/patches/gpsbabel-fix-i686-test.patch		\
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 9d5fc36710..3170e11925 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5314,7 +5314,10 @@ template functions.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))))
+                "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))
+              (patches
+               (search-patches
+                "go-github-com-bmatcuk-doublestar-1.3-remove-test.patch"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/bmatcuk/doublestar"))
diff --git a/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
new file mode 100644
index 0000000000..2c64575914
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
@@ -0,0 +1,15 @@
+Remove test which fails with Go >= 1.15 due to API changes.
+This patch should no longer be necessary with doublestar v4+
+
+diff --git a/doublestar_test.go b/doublestar_test.go
+index b21d20ad4b..f510c3d06b 100644
+--- a/doublestar_test.go
++++ b/doublestar_test.go
+@@ -80,7 +80,6 @@ var matchTests = []MatchTest{
+ 	{"[", "a", false, ErrBadPattern, true},
+ 	{"[^", "a", false, ErrBadPattern, true},
+ 	{"[^bc", "a", false, ErrBadPattern, true},
+-	{"a[", "a", false, nil, false},
+ 	{"a[", "ab", false, ErrBadPattern, true},
+ 	{"*x", "xxx", true, nil, true},
+ 	{"[abc]", "b", true, nil, true},
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 10/13] gnu: restic: Patch tests for go-1.16.
(address . 49221@debbugs.gnu.org)
8faa83d9d24cbd87afd8a93613dbf872aaf45573.1624602942.git.iskarian@mgsn.dev
* gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/backup.scm (restic): Use it.
---
gnu/local.mk | 1 +
gnu/packages/backup.scm | 5 +-
.../restic-0.9.6-fix-tests-for-go1.15.patch | 51 +++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch

Toggle diff (94 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index a176772ece..24f2d9d013 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1674,6 +1674,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/rtags-separate-rct.patch			\
   %D%/packages/patches/racket-sh-via-rktio.patch		\
   %D%/packages/patches/remake-impure-dirs.patch			\
+  %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch	\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
   %D%/packages/patches/rnp-add-version.cmake.patch		\
   %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch		\
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index d425243848..67dc4b2cc9 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -876,7 +877,9 @@ is like a time machine for your data. ")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))))
+                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))
+              (patches
+               (search-patches "restic-0.9.6-fix-tests-for-go1.15.patch"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/restic/restic"
diff --git a/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
new file mode 100644
index 0000000000..cc510c1cfe
--- /dev/null
+++ b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
@@ -0,0 +1,51 @@
+This cherry-picked patch fixes tests for Go >= 1.15. Restic v0.10 (which
+includes this patch) requires go module support from the Go build system.
+Original patch follows.
+
+---
+From 97950ab81a18de06b95384da6d8646fef87c9d97 Mon Sep 17 00:00:00 2001
+From: Alexander Neumann <alexander@bumpern.de>
+Date: Sat, 12 Sep 2020 17:36:44 +0200
+Subject: [PATCH] options: Fix test for Go >= 1.15
+
+---
+ internal/options/options_test.go | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/internal/options/options_test.go b/internal/options/options_test.go
+index de94fc90a1..8d268992a3 100644
+--- a/internal/options/options_test.go
++++ b/internal/options/options_test.go
+@@ -3,6 +3,7 @@ package options
+ import (
+ 	"fmt"
+ 	"reflect"
++	"regexp"
+ 	"testing"
+ 	"time"
+ )
+@@ -199,7 +200,7 @@ var invalidSetTests = []struct {
+ 			"timeout": "2134",
+ 		},
+ 		"ns",
+-		`time: missing unit in duration 2134`,
++		`time: missing unit in duration "?2134"?`,
+ 	},
+ }
+ 
+@@ -212,8 +213,13 @@ func TestOptionsApplyInvalid(t *testing.T) {
+ 				t.Fatalf("expected error %v not found", test.err)
+ 			}
+ 
+-			if err.Error() != test.err {
+-				t.Fatalf("expected error %q, got %q", test.err, err.Error())
++			matched, err := regexp.MatchString(test.err, err.Error())
++			if err != nil {
++				t.Fatal(err)
++			}
++
++			if !matched {
++				t.Fatalf("expected error to match %q, got %q", test.err, err.Error())
+ 			}
+ 		})
+ 	}
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 11/13] gnu: go-gopkg-in-check-v1: Update to latest.
(address . 49221@debbugs.gnu.org)
2d43187f01a608e4f25b066e40a55229124cc125.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-gopkg-in-check-v1): Update to latest, fix
license.
---
gnu/packages/golang.scm | 46 ++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 24 deletions(-)

Toggle diff (59 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 3170e11925..369bfc271c 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2339,30 +2339,28 @@ which satisfies the cron expression.")
                      license:asl2.0)))))
 
 (define-public go-gopkg-in-check-v1
-  (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
-        (revision "1"))
-    (package
-      (name "go-gopkg-in-check-v1")
-      (version (git-version "1.0.0" revision commit))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/go-check/check")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32
-           "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
-      (build-system go-build-system)
-      (arguments
-       '(#:import-path "gopkg.in/check.v1"))
-      (propagated-inputs
-       `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
-      (home-page "https://gopkg.in/check.v1")
-      (synopsis "Test framework for the Go language")
-      (description "This package provides a test library for the Go language.")
-      (license license:asl2.0))))
+  (package
+    (name "go-gopkg-in-check-v1")
+    (version "1.0.0-20201130134442-10cb98267c6c")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/go-check/check")
+             (commit (go-version->git-ref version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1jwxndf8rsyx0fgrp47d99rp55yzssmryb92jfj3yf7zd8rjjljn"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "gopkg.in/check.v1"))
+    (propagated-inputs
+     `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
+    (home-page "https://gopkg.in/check.v1")
+    (synopsis "Test framework for the Go language")
+    (description "This package provides a test library for the Go language.")
+    (license license:bsd-2)))
 
 (define-public go-gopkg-in-ini-v1
   (package
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 12/13] gnu: go-etcd-io-bbolt: Update to 1.3.6.
(address . 49221@debbugs.gnu.org)
66e4f623f2dde28705224716ddc4c2986c8ff7cb.1624602942.git.iskarian@mgsn.dev
* gnu/packages/golang.scm (go-etcd-io-bbolt): Update to 1.3.6.
---
gnu/packages/golang.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (29 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 369bfc271c..ae32e9f546 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6302,7 +6302,7 @@ deleting secrets from the system keyring.")
 (define-public go-etcd-io-bbolt
   (package
     (name "go-etcd-io-bbolt")
-    (version "1.3.5")
+    (version "1.3.6")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -6311,10 +6311,12 @@ deleting secrets from the system keyring.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1h64gipvcg7060byv5wjlf524kqwj12p3v08kfh4ygv46vpm8p2r"))))
+                "0pj5245d417za41j6p09fmkbv05797vykr1bi9a6rnwddh1dbs8d"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "go.etcd.io/bbolt"))
+    (propagated-inputs
+     `(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
     (home-page "https://pkg.go.dev/go.etcd.io/bbolt/")
     (synopsis "Low-level key/value store in Go")
     (description "This package implements a low-level key/value store in Go.")
-- 
2.31.1
S
S
Sarah Morgensen wrote on 25 Jun 2021 09:21
[PATCH 13/13] gnu: Add go-1.16.
(address . 49221@debbugs.gnu.org)
50a63395dda110ff8cc14d9e8f3516668f0c2e28.1624602942.git.iskarian@mgsn.dev
Add go@1.16 as a non-default go. Changes from 1.14: Use now-supported GO_LDSO
configuration option for setting the interpreter. Bootstrap with gccgo on
platforms which do not support go-1.4. Fix and re-enable cmd/go script tests.
Fix typo in cgoldflags patch. Break out tests into "check" phase. Remove
references to perl to reduce closure size by ~10%. Set GOCACHE so go doesn't
attempt to access $HOME.

* gnu/packages/patches/go-fix-script-tests.patch: New file.
* local.mk (dist_patch_DATA): Register it.
* gnu/packages/golang.scm (go-1.16): New variable. Use the patch.
---
gnu/local.mk | 1 +
gnu/packages/golang.scm | 158 ++++++++++++++++++
.../patches/go-fix-script-tests.patch | 18 ++
3 files changed, 177 insertions(+)
create mode 100644 gnu/packages/patches/go-fix-script-tests.patch

Toggle diff (221 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 24f2d9d013..59df29a72e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1171,6 +1171,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
   %D%/packages/patches/gobject-introspection-cc.patch		\
   %D%/packages/patches/gobject-introspection-girepository.patch	\
+  %D%/packages/patches/go-fix-script-tests.patch			\
   %D%/packages/patches/go-skip-gc-test.patch			\
   %D%/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch	\
   %D%/packages/patches/gpm-glibc-2.26.patch			\
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index ae32e9f546..c169d573b4 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -45,6 +45,7 @@
 (define-module (gnu packages golang)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix utils)
+  #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix packages)
@@ -54,6 +55,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
+  #:use-module ((gnu packages bootstrap) #:select (glibc-dynamic-linker))
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages lua)
@@ -441,6 +443,162 @@ in the style of communicating sequential processes (@dfn{CSP}).")
        ,@(package-native-inputs go-1.4)))
     (supported-systems %supported-systems)))
 
+(define-public go-1.16
+  (package
+    (inherit go-1.14)
+    (name "go")
+    (version "1.16.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/golang/go")
+             (commit (string-append "go" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "19a93p217h5xi2sgh34qzv24pkd4df0sw4fc5z6k47lspjp3vx2l"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments go-1.14)
+       ((#:tests? _) #t)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'remove-unused-sourcecode-generators
+             (lambda _
+               ;; Prevent perl from inclusion in closure through unused files
+               (for-each delete-file (find-files "src" "\\.pl$"))))
+           (replace 'prebuild
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
+                      (net-base (assoc-ref inputs "net-base"))
+                      (tzdata-path
+                       (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
+
+                 ;; Having the patch in the 'patches' field of <origin> breaks
+                 ;; the 'TestServeContent' test due to the fact that
+                 ;; timestamps are reset.  Thus, apply it from here.
+                 (invoke "patch" "-p2" "--force" "-i"
+                         (assoc-ref inputs "go-skip-gc-test.patch"))
+                 (invoke "patch" "-p2" "--force" "-i"
+                         (assoc-ref inputs "go-fix-script-tests.patch"))
+
+                 (for-each make-file-writable (find-files "."))
+
+                 (substitute* "os/os_test.go"
+                   (("/usr/bin") (getcwd))
+                   (("/bin/sh") (which "sh")))
+
+                 (substitute* "cmd/go/testdata/script/cgo_path_space.txt"
+                   (("/bin/sh") (which "sh")))
+
+                 ;; Add libgcc to runpath
+                 (substitute* "cmd/link/internal/ld/lib.go"
+                   (("!rpath.set") "true"))
+                 (substitute* "cmd/go/internal/work/gccgo.go"
+                   (("cgoldflags := \\[\\]string\\{\\}")
+                    (string-append "cgoldflags := []string{"
+                                   "\"-Wl,-rpath=" gcclib "\""
+                                   "}"))
+                   (("\"-lgcc_s\", ")
+                    (string-append
+                     "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", ")))
+                 (substitute* "cmd/go/internal/work/gc.go"
+                   (("ldflags = setextld\\(ldflags, compiler\\)")
+                    (string-append
+                     "ldflags = setextld(ldflags, compiler)\n"
+                     "ldflags = append(ldflags, \"-r\")\n"
+                     "ldflags = append(ldflags, \"" gcclib "\")\n")))
+
+                 ;; Disable failing tests: these tests attempt to access
+                 ;; commands or network resources which are neither available
+                 ;; nor necessary for the build to succeed.
+                 (for-each
+                  (match-lambda
+                    ((file regex)
+                     (substitute* file
+                       ((regex all before test_name)
+                        (string-append before "Disabled" test_name)))))
+                  '(("net/net_test.go" "(.+)(TestShutdownUnix.+)")
+                    ("net/dial_test.go" "(.+)(TestDialTimeout.+)")
+                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPort.+)")
+                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPortWithCancel.+)")
+                    ;; 127.0.0.1 doesn't exist
+                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTR.+)")
+                    ;; 127.0.0.1 doesn't exist
+                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTRWithCancel.+)")
+                    ;; /etc/services doesn't exist
+                    ("net/parse_test.go" "(.+)(TestReadLine.+)")
+                    ("os/os_test.go" "(.+)(TestHostname.+)")
+                    ;; The user's directory doesn't exist
+                    ("os/os_test.go" "(.+)(TestUserHomeDir.+)")
+                    ("time/format_test.go" "(.+)(TestParseInSydney.+)")
+                    ("time/format_test.go" "(.+)(TestParseInLocation.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestEcho.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestCommandRelativeName.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestCatStdin.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestCatGoodAndBadFile.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestExitStatus.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestPipes.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestStdinClose.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestIgnorePipeErrorOnSuccess.+)")
+                    ("syscall/syscall_unix_test.go" "(.+)(TestPassFD\\(.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestExtraFiles/areturn.+)")
+                    ("cmd/go/go_test.go" "(.+)(TestCoverageWithCgo.+)")
+                    ("cmd/go/go_test.go" "(.+)(TestTwoPkgConfigs.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestOutputStderrCapture.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestExtraFiles.+)")
+                    ("os/exec/exec_test.go" "(.+)(TestExtraFilesRace.+)")
+                    ("net/lookup_test.go" "(.+)(TestLookupPort.+)")
+                    ("syscall/exec_linux_test.go"
+                     "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)")))
+
+                 ;; These tests fail on aarch64-linux
+                 (substitute* "cmd/dist/test.go"
+                   (("t.registerHostTest\\(\"testsanitizers/msan.*") ""))
+
+                 ;; fix shebang for testar script
+                 ;; note the target script is generated at build time.
+                 (substitute* "../misc/cgo/testcarchive/carchive_test.go"
+                   (("#!/usr/bin/env") (string-append "#!" (which "env"))))
+
+                 (substitute* "net/lookup_unix.go"
+                   (("/etc/protocols") (string-append net-base "/etc/protocols")))
+                 (substitute* "net/port_unix.go"
+                   (("/etc/services") (string-append net-base "/etc/services")))
+                 (substitute* "time/zoneinfo_unix.go"
+                   (("/usr/share/zoneinfo/") tzdata-path)))))
+           (replace 'build
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               ;; FIXME: Some of the .a files are not bit-reproducible.
+               ;; (Is this still true?)
+               (let* ((output (assoc-ref outputs "out"))
+                      (loader (string-append (assoc-ref inputs "libc")
+                                             ,(glibc-dynamic-linker))))
+                 (setenv "CC" (which "gcc"))
+                 (setenv "GO_LDSO" loader)
+                 (setenv "GOOS" "linux")
+                 (setenv "GOROOT" (dirname (getcwd)))
+                 (setenv "GOROOT_FINAL" output)
+                 (setenv "GOCACHE" "/tmp/go-cache")
+                 (invoke "sh" "make.bash" "--no-banner"))))
+           (replace 'check
+             (lambda* (#:key target (tests? (not target)) (parallel-tests? #t)
+                       #:allow-other-keys)
+               (let* ((njobs (if parallel-tests? (parallel-job-count) 1)))
+                 (when tests?
+                   (setenv "GOMAXPROCS" (number->string njobs))
+                   (invoke "sh" "run.bash" "--no-rebuild")))))
+           (add-before 'install 'unpatch-perl-shebangs
+             (lambda _
+               ;; Rewrite references to perl input in test scripts
+               (substitute* "net/http/cgi/testdata/test.cgi"
+                 (("^#!.*") "#!/usr/bin/env perl\n"))))))))
+    (native-inputs
+     `(("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch"))
+       ,@(if (not (member (%current-system) (package-supported-systems go-1.4)))
+             (alist-replace "go" `(,gccgo-10) (package-native-inputs go-1.14))
+             (package-native-inputs go-1.14))))))
+
 (define-public go go-1.14)
 
 (define-public go-github-com-alsm-ioprogress
diff --git a/gnu/packages/patches/go-fix-script-tests.patch b/gnu/packages/patches/go-fix-script-tests.patch
new file mode 100644
index 0000000000..b29e83fef0
--- /dev/null
+++ b/gnu/packages/patches/go-fix-script-tests.patch
@@ -0,0 +1,18 @@
+Make library/header paths visible to cmd/go script tests, which is necessary for
+cgo/gccgo tests to work correctly
+
+diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
+index dfaa40548e..9d0f0e9bcd 100644
+--- a/src/cmd/go/script_test.go
++++ b/src/cmd/go/script_test.go
+@@ -100,6 +100,10 @@ const (
+ var extraEnvKeys = []string{
+ 	"SYSTEMROOT",         // must be preserved on Windows to find DLLs; golang.org/issue/25210
+ 	"WINDIR",             // must be preserved on Windows to be able to run PowerShell command; golang.org/issue/30711
++	"CPATH",
++	"C_INCLUDE_PATH",
++	"CPLUS_INCLUDE_PATH",
++	"LIBRARY_PATH",
+ 	"LD_LIBRARY_PATH",    // must be preserved on Unix systems to find shared libraries
+ 	"CC",                 // don't lose user settings when invoking cgo
+ 	"GO_TESTING_GOTOOLS", // for gccgo testing
-- 
2.31.1
E
E
Efraim Flashner wrote on 28 Jun 2021 21:22
Re: [bug#49221] [PATCH 00/13] Add go-1.16 and build with gccgo
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49221@debbugs.gnu.org)
YNohZ0bbgwSnVFnA@3900XT
On Thu, Jun 24, 2021 at 11:52:55PM -0700, Sarah Morgensen via Guix-patches via wrote:
Toggle quote (9 lines)
> Hello Guix,
>
> This patch adds go 1.16, but does *not* make it the default for other packages
> which use go (as suggested in [2]). There have been a lot of changes between
> 1.14 and 1.16, and while I have fixed many issues, I am sure continued testing
> will uncover many more.
>
> This patch is based on [0], which adds gccgo-10.

I've applied the patch, so it should now be available in the main repo :)

Toggle quote (14 lines)
> With this patch, go automatically bootstraps from gccgo[0][1] on platforms not
> supported by go 1.4, but you can do so on any platform with:
>
> guix build go --with-input=go@1.4-bootstrap-20171003=gccgo@10
>
> Additionally, to build packages with 1.16:
>
> guix build <package> --with-input=go@1.14=go@1.16
>
> I would appreciate testing and feedback on the new bootstrap process,
> especially from powerpc64le users, as I have only been able to test on x86-64.
> (Note that it took about two hours for gccgo to build and 30 minutes for gccgo
> to build go.)

I was able to build go@1.16 as-is and with the conditional switched, so
it used gccgo to bootstrap go@1.16. Additionally on my x86_64 machine
using emulation I was able to build go@1.16 for powerpc64le. On the
powerpc64le box I have access to I was able to build gccgo and I'm still
building out to go@1.16.

Toggle quote (19 lines)
> Changes from 1.14:
>
> * Bootstrap with gccgo on platforms which do not support go 1.4 (see above)
> * Use GO_LDSO to set the interpreter rather than patching files
> * Fix typo in cgoldflags patch ("-rpath=" > "-Wl,-rpath=")
> * Fix and re-enable some cgo/gccgo tests
> * Remove references to perl (used for tests) to reduce closure size by 10%
> * Set GOCACHE so go doesn't complain that it can't access it $HOME
> * Break out tests into "check" phase so builders have more control
>
> I have successfully built and tested most go packages on x86-64, including
> restic, syncthing, chezmoi, and exercism.
>
> However... docker does not pass tests. It should probably be updated to 20.10,
> but it is a very complicated package and I do not have the skill to do so. I
> attempted to backport some of the fixes, but that was also beyond my abilities.
>
> Perhaps someone else will rise to the challenge? :)

My only concern about the patches is that I've been burned before about
pushing updates to go packages, where some seem to have insufficient
testing and then they'll build and fail. So in the meantime I've pushed
the go@1.16 patch.

Toggle quote (46 lines)
> Sarah
>
> [0] <https://issues.guix.gnu.org/49019> [PATCH 0/1] gnu: Add gccgo-10.
> [1] <https://issues.guix.gnu.org/28226> Build go with gccgo
> [2] <https://issues.guix.gnu.org/45161> [PATCH] Added Go 1.16.2
>
> Sarah Morgensen (13):
> gnu: go-github-com-puerkitobio-goquery: Update to 1.7.0.
> gnu: go-go-uber-org-atomic: Update to 1.8.0.
> gnu: go-github-com-sergi-go-diff: Update to 1.2.0.
> gnu: go-github-com-pelletier-go-toml: Update to 1.9.3.
> gnu: go-github-com-masterminds-goutils: Update to 1.1.1.
> gnu: go-github-com-magiconair-properties: Update to 1.8.5.
> gnu: go-github-com-dlclark-regexp2: Update to 1.4.0.
> gnu: earlyoom: Patch tests for go-1.16.
> gnu: go-github-com-bmatcuk-doublestar: Remove test incompatible with
> go-1.16.
> gnu: restic: Patch tests for go-1.16.
> gnu: go-gopkg-in-check-v1: Update to latest.
> gnu: go-etcd-io-bbolt: Update to 1.3.6.
> gnu: Add go-1.16.
>
> gnu/local.mk | 4 +
> gnu/packages/backup.scm | 5 +-
> gnu/packages/golang.scm | 243 +++++++++++++++---
> gnu/packages/linux.scm | 4 +-
> .../earlyoom-1.6.2-disable-go-module.patch | 17 ++
> .../patches/go-fix-script-tests.patch | 18 ++
> ...m-bmatcuk-doublestar-1.3-remove-test.patch | 15 ++
> .../restic-0.9.6-fix-tests-for-go1.15.patch | 51 ++++
> 8 files changed, 314 insertions(+), 43 deletions(-)
> create mode 100644 gnu/packages/patches/earlyoom-1.6.2-disable-go-module.patch
> create mode 100644 gnu/packages/patches/go-fix-script-tests.patch
> create mode 100644 gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
> create mode 100644 gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
>
>
> base-commit: c7804cd97b28ef012acc20c1d861904e9592382b
> prerequisite-patch-id: edb56de17ac3cce58402c83a9671b00381dfee76
> --
> 2.31.1
>
>
>
>

--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmDaIWcACgkQQarn3Mo9
g1FkrhAAhDM5brVtI5lkvc9Kx3hG0k7AU2O33NMInolluamKeq+3VpZVNJRBlXLK
eRoIU9BObhiQCN2aEBlm0LT9gfJxH6tAcbHXIP7mK7BNcGZoN2hMQPMgosC5FsKJ
71qVXrQSJS8TbMWZqO5M0Np69iAAoWJweKkzpQ3VDnJzHGLs7HkOxz/5fdy7InG1
RXQlR31rHK4z/sogM8eUAeIpkBGL5kLAlKUWRQbJAdIIj9yQfBqcemzzT2QJrwUY
VjTdJen1xI8r/5ZllHRibrB74jNHZZRtdd71roUclJE5fxtwLWDOKsTtzsfUaZtD
0wvQ91up5SqntDqBIeE5VzDkeDYgXo5LimzdVmWzGAIUqlQTb+TDINTV+9Royc4v
eqnVMmRB6mtq/waxLhVbp075Zv4IpixKZDfSqBzda7OzPW70kw2aVpB4wzU2ipNK
QGKzjuzd2bqkMKgENdECKbSnCDcuzgyfnXxqFJkaVcdiozQExEhnzqSQV8lWP5JS
V2saZNWtVhNFCuyItmbKuh/erDpGKa2UN4MlG8DyCLf1Su9KG6qE6imC5OdxwDKs
9bldn41Wp2X4je37JM9N6IrQF92UP98VgxtzfUrBG7dURfdphXfk2W5Bu+2u5SN/
6bwVPmml3tIHuI+DAi9HW18JXVd85XLia4LARz5BwWPdnyKfMjY=
=P6bq
-----END PGP SIGNATURE-----


S
S
Sarah Morgensen wrote on 1 Jul 2021 05:24
Re: bug#49221: [PATCH 00/13] Add go-1.16 and build with gccgo
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 49221@debbugs.gnu.org)
86im1u7m33.fsf_-_@mgsn.dev
Hello,

Thanks for the push!

Efraim Flashner <efraim@flashner.co.il> writes:

Toggle quote (13 lines)
> On Thu, Jun 24, 2021 at 11:52:55PM -0700, Sarah Morgensen via Guix-patches via wrote:
>
>> I would appreciate testing and feedback on the new bootstrap process,
>> especially from powerpc64le users, as I have only been able to test on x86-64.
>> (Note that it took about two hours for gccgo to build and 30 minutes for gccgo
>> to build go.)
>
> I was able to build go@1.16 as-is and with the conditional switched, so
> it used gccgo to bootstrap go@1.16. Additionally on my x86_64 machine
> using emulation I was able to build go@1.16 for powerpc64le. On the
> powerpc64le box I have access to I was able to build gccgo and I'm still
> building out to go@1.16.

Excellent! Thanks for testing. Fingers crossed :)

Toggle quote (5 lines)
> My only concern about the patches is that I've been burned before about
> pushing updates to go packages, where some seem to have insufficient
> testing and then they'll build and fail. So in the meantime I've pushed
> the go@1.16 patch.

Fair enough. We'll have to wait & see if any issues surface. On that
note, I've found the tests in etcd-io-bbolt and go-gopkg-in-check-v1 to
be performance-based, and they would sometimes fail on my VM. Updating
them did help, but did not completely eliminate the issue.

--
Sarah
S
S
Sarah Morgensen wrote on 25 Jul 2021 04:17
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 49221@debbugs.gnu.org)
86h7gjp26f.fsf_-_@mgsn.dev
Hi Efraim,

Just following up on this.

Efraim Flashner <efraim@flashner.co.il> writes:

Toggle quote (12 lines)
> On Thu, Jun 24, 2021 at 11:52:55PM -0700, Sarah Morgensen via Guix-patches via wrote:
>> Hello Guix,
>>
>> This patch adds go 1.16, but does *not* make it the default for other packages
>> which use go (as suggested in [2]). There have been a lot of changes between
>> 1.14 and 1.16, and while I have fixed many issues, I am sure continued testing
>> will uncover many more.
>>
>> This patch is based on [0], which adds gccgo-10.
>
> I've applied the patch, so it should now be available in the main repo :)

Should the following related issues be closed now?

[0] https://issues.guix.gnu.org/28226 Build go with gccgo
[1] https://issues.guix.gnu.org/46380 gnu: gccgo: Add version 10.

[...]

Toggle quote (5 lines)
> My only concern about the patches is that I've been burned before about
> pushing updates to go packages, where some seem to have insufficient
> testing and then they'll build and fail. So in the meantime I've pushed
> the go@1.16 patch.

Is there something specific to be done to sufficiently test them? I'm
not sure what else to do other than manually testing dependents.

Thanks,
Sarah
E
E
Efraim Flashner wrote on 5 Aug 2021 16:03
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49221@debbugs.gnu.org)
YQvvwtvQMBGNsH2b@3900XT
On Sat, Jul 24, 2021 at 07:17:28PM -0700, Sarah Morgensen wrote:
Toggle quote (4 lines)
> Hi Efraim,
>
> Just following up on this.

Sorry for taking so long to get back to you.

Toggle quote (21 lines)
> Efraim Flashner <efraim@flashner.co.il> writes:
>
> > On Thu, Jun 24, 2021 at 11:52:55PM -0700, Sarah Morgensen via Guix-patches via wrote:
> >> Hello Guix,
> >>
> >> This patch adds go 1.16, but does *not* make it the default for other packages
> >> which use go (as suggested in [2]). There have been a lot of changes between
> >> 1.14 and 1.16, and while I have fixed many issues, I am sure continued testing
> >> will uncover many more.
> >>
> >> This patch is based on [0], which adds gccgo-10.
> >
> > I've applied the patch, so it should now be available in the main repo :)
>
> Should the following related issues be closed now?
>
> [0] <https://issues.guix.gnu.org/28226> Build go with gccgo
> [1] <https://issues.guix.gnu.org/46380> gnu: gccgo: Add version 10.
> [2] <https://issues.guix.gnu.org/47434> Added Go 1.16.2
> [3] <https://issues.guix.gnu.org/45161> Update go?

Looks like they should be safe to close.

Toggle quote (8 lines)
> > My only concern about the patches is that I've been burned before about
> > pushing updates to go packages, where some seem to have insufficient
> > testing and then they'll build and fail. So in the meantime I've pushed
> > the go@1.16 patch.
>
> Is there something specific to be done to sufficiently test them? I'm
> not sure what else to do other than manually testing dependents.

I thought more about it and I went ahead and applied most of them. I
wasn't able to apply the go-github-com-bmatcuk-doublestar one or the
restic patch. Can you resend those?

Toggle quote (3 lines)
> Thanks,
> Sarah

Thank you for doing all the work.

--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmEL78EACgkQQarn3Mo9
g1GPxBAAndGSp/TUCikTvX+fxOUUcy/kVkVSXXg44rFJPoZKWB0tIiBQUUtCzWaP
qt4R3YiyNDZ5gmSTveSqq/s6hdzk6+fEFF985zxxpz9W6SLkgh72BKYWt3FQvpah
iW3iaRnmfSHSe1m/BfI87rAxWafGcB6ZEo00iP4im7NInjmDloWH4EbGazBsS4JO
viUj98afh78flfnqn9iTHzJja9iXYrBtaZ3/RNCl7vtMl8C4epFNWQXjEbi+n6wi
FjlwNfbAAdFnVEg3xCUOgefXIQLoITFGeIh9oIJItdyTKfxOXc23OcPDMjRzGKR+
TjDZqX0etuJVl5c3P+/uecMAPyRUJ6Wz3FzKK9e7HP6OU9VZVP6sVIQ3zHnI/QfU
ceQw90anbc5I8FDr5yO5bUqhaOukaNaVmeDFh/6S2ohLv+AWuNbadJo6fxoYVjRT
0chOo60CnVYwxkHfm46Qz7GaxkoU/FrAscyt6MFDsM24viwlCIDWtz4mkTkrvlFl
FdUJW2redYo0EOTdqFV/HdC3Km7frEFs0c3suAbCWpSVv27vBF7hD1YSQOIdZBuD
umO8TjkUit8dfyd7F7TiiwTeFb1JIYzyMaGcOgGSQt/4niY2em8wUAeM/bcA5JoC
OLNp0/tZFbdLVBTf0T5CTVkCK/Mx5f/YBbMfPihRrw1/ocFZvI4=
=DmQG
-----END PGP SIGNATURE-----


M
M
Maxim Cournoyer wrote on 5 Aug 2021 19:17
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49221@debbugs.gnu.org)
87wnoz7qvs.fsf_-_@gmail.com
Hello,

Sarah Morgensen <iskarian@mgsn.dev> writes:

Toggle quote (61 lines)
> * gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch:
> New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/golang.scm (go-github-com-bmatcuk-doublestar): Use it.
> ---
> gnu/local.mk | 1 +
> gnu/packages/golang.scm | 5 ++++-
> ...b-com-bmatcuk-doublestar-1.3-remove-test.patch | 15 +++++++++++++++
> 3 files changed, 20 insertions(+), 1 deletion(-)
> create mode 100644 gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 9caae52306..a176772ece 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1172,6 +1172,7 @@ dist_patch_DATA = \
> %D%/packages/patches/gobject-introspection-cc.patch \
> %D%/packages/patches/gobject-introspection-girepository.patch \
> %D%/packages/patches/go-skip-gc-test.patch \
> + %D%/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch \
> %D%/packages/patches/gpm-glibc-2.26.patch \
> %D%/packages/patches/gpodder-disable-updater.patch \
> %D%/packages/patches/gpsbabel-fix-i686-test.patch \
> diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
> index 9d5fc36710..3170e11925 100644
> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm
> @@ -5314,7 +5314,10 @@ template functions.")
> (file-name (git-file-name name version))
> (sha256
> (base32
> - "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))))
> + "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))
> + (patches
> + (search-patches
> + "go-github-com-bmatcuk-doublestar-1.3-remove-test.patch"))))
> (build-system go-build-system)
> (arguments
> `(#:import-path "github.com/bmatcuk/doublestar"))
> diff --git a/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
> new file mode 100644
> index 0000000000..2c64575914
> --- /dev/null
> +++ b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
> @@ -0,0 +1,15 @@
> +Remove test which fails with Go >= 1.15 due to API changes.
> +This patch should no longer be necessary with doublestar v4+
> +
> +diff --git a/doublestar_test.go b/doublestar_test.go
> +index b21d20ad4b..f510c3d06b 100644
> +--- a/doublestar_test.go
> ++++ b/doublestar_test.go
> +@@ -80,7 +80,6 @@ var matchTests = []MatchTest{
> + {"[", "a", false, ErrBadPattern, true},
> + {"[^", "a", false, ErrBadPattern, true},
> + {"[^bc", "a", false, ErrBadPattern, true},
> +- {"a[", "a", false, nil, false},
> + {"a[", "ab", false, ErrBadPattern, true},
> + {"*x", "xxx", true, nil, true},
> + {"[abc]", "b", true, nil, true},

This should be reported upstream, if the test is still not working with
the latest release (v4.0.2).

Thanks,

Maxim
M
M
Maxim Cournoyer wrote on 5 Aug 2021 19:20
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49221@debbugs.gnu.org)
87sfzn7qqj.fsf_-_@gmail.com
Hello,

Sarah Morgensen <iskarian@mgsn.dev> writes:

[...]

Toggle quote (47 lines)
> +From 97950ab81a18de06b95384da6d8646fef87c9d97 Mon Sep 17 00:00:00 2001
> +From: Alexander Neumann <alexander@bumpern.de>
> +Date: Sat, 12 Sep 2020 17:36:44 +0200
> +Subject: [PATCH] options: Fix test for Go >= 1.15
> +
> +---
> + internal/options/options_test.go | 12 +++++++++---
> + 1 file changed, 9 insertions(+), 3 deletions(-)
> +
> +diff --git a/internal/options/options_test.go b/internal/options/options_test.go
> +index de94fc90a1..8d268992a3 100644
> +--- a/internal/options/options_test.go
> ++++ b/internal/options/options_test.go
> +@@ -3,6 +3,7 @@ package options
> + import (
> + "fmt"
> + "reflect"
> ++ "regexp"
> + "testing"
> + "time"
> + )
> +@@ -199,7 +200,7 @@ var invalidSetTests = []struct {
> + "timeout": "2134",
> + },
> + "ns",
> +- `time: missing unit in duration 2134`,
> ++ `time: missing unit in duration "?2134"?`,
> + },
> + }
> +
> +@@ -212,8 +213,13 @@ func TestOptionsApplyInvalid(t *testing.T) {
> + t.Fatalf("expected error %v not found", test.err)
> + }
> +
> +- if err.Error() != test.err {
> +- t.Fatalf("expected error %q, got %q", test.err, err.Error())
> ++ matched, err := regexp.MatchString(test.err, err.Error())
> ++ if err != nil {
> ++ t.Fatal(err)
> ++ }
> ++
> ++ if !matched {
> ++ t.Fatalf("expected error to match %q, got %q", test.err, err.Error())
> + }
> + })
> + }

I'm guessing this may also be not be necessary if we were to
successfully update restic to v0.12.1. Do you think that would be
difficult to try?

Thanks,

Maxim
S
S
Sarah Morgensen wrote on 5 Aug 2021 22:20
[PATCH v2 1/2] gnu: go-github-com-bmatcuk-doublestar: Remove test incompatible with go-1.16.
(address . 49221@debbugs.gnu.org)(name . Efraim Flashner)(address . efraim@flashner.co.il)
7857e451389aa8081dac1bb783c5c7d29f2e9189.1628192044.git.iskarian@mgsn.dev
* gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/golang.scm (go-github-com-bmatcuk-doublestar): Use it.
---
gnu/local.mk | 1 +
gnu/packages/golang.scm | 5 ++++-
...b-com-bmatcuk-doublestar-1.3-remove-test.patch | 15 +++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch

Toggle diff (53 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 61ac39618a..5b2e64a8b8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1183,6 +1183,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gobject-introspection-girepository.patch	\
   %D%/packages/patches/go-fix-script-tests.patch			\
   %D%/packages/patches/go-skip-gc-test.patch			\
+  %D%/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch	\
   %D%/packages/patches/gpm-glibc-2.26.patch			\
   %D%/packages/patches/gpodder-disable-updater.patch		\
   %D%/packages/patches/gpsbabel-fix-i686-test.patch		\
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 89020648f0..cf72aa6e20 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6480,7 +6480,10 @@ template functions.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))))
+                "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))
+              (patches
+               (search-patches
+                "go-github-com-bmatcuk-doublestar-1.3-remove-test.patch"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/bmatcuk/doublestar"))
diff --git a/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
new file mode 100644
index 0000000000..2c64575914
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
@@ -0,0 +1,15 @@
+Remove test which fails with Go >= 1.15 due to API changes.
+This patch should no longer be necessary with doublestar v4+
+
+diff --git a/doublestar_test.go b/doublestar_test.go
+index b21d20ad4b..f510c3d06b 100644
+--- a/doublestar_test.go
++++ b/doublestar_test.go
+@@ -80,7 +80,6 @@ var matchTests = []MatchTest{
+ 	{"[", "a", false, ErrBadPattern, true},
+ 	{"[^", "a", false, ErrBadPattern, true},
+ 	{"[^bc", "a", false, ErrBadPattern, true},
+-	{"a[", "a", false, nil, false},
+ 	{"a[", "ab", false, ErrBadPattern, true},
+ 	{"*x", "xxx", true, nil, true},
+ 	{"[abc]", "b", true, nil, true},

base-commit: fd3f1e809234c3e675d2eb8bc17774b0d4a94b0c
-- 
2.31.1
S
S
Sarah Morgensen wrote on 5 Aug 2021 22:20
[PATCH v2 2/2] gnu: restic: Patch tests for go-1.16.
(address . 49221@debbugs.gnu.org)(name . Efraim Flashner)(address . efraim@flashner.co.il)
869af0902740eceb02bf4d7125d81658c5ff9692.1628192044.git.iskarian@mgsn.dev
* gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/backup.scm (restic): Use it.
---
gnu/local.mk | 1 +
gnu/packages/backup.scm | 5 +-
.../restic-0.9.6-fix-tests-for-go1.15.patch | 51 +++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch

Toggle diff (94 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 5b2e64a8b8..03a93caed6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1694,6 +1694,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/rtags-separate-rct.patch			\
   %D%/packages/patches/racket-minimal-sh-via-rktio.patch	\
   %D%/packages/patches/remake-impure-dirs.patch			\
+  %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch	\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
   %D%/packages/patches/rnp-add-version.cmake.patch		\
   %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch		\
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 9ec4e281d8..d8d8728a14 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Timothy Sample <samplet@ngyro.com>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -928,7 +929,9 @@ is like a time machine for your data. ")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))))
+                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))
+              (patches
+               (search-patches "restic-0.9.6-fix-tests-for-go1.15.patch"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/restic/restic"
diff --git a/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
new file mode 100644
index 0000000000..cc510c1cfe
--- /dev/null
+++ b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
@@ -0,0 +1,51 @@
+This cherry-picked patch fixes tests for Go >= 1.15. Restic v0.10 (which
+includes this patch) requires go module support from the Go build system.
+Original patch follows.
+
+---
+From 97950ab81a18de06b95384da6d8646fef87c9d97 Mon Sep 17 00:00:00 2001
+From: Alexander Neumann <alexander@bumpern.de>
+Date: Sat, 12 Sep 2020 17:36:44 +0200
+Subject: [PATCH] options: Fix test for Go >= 1.15
+
+---
+ internal/options/options_test.go | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/internal/options/options_test.go b/internal/options/options_test.go
+index de94fc90a1..8d268992a3 100644
+--- a/internal/options/options_test.go
++++ b/internal/options/options_test.go
+@@ -3,6 +3,7 @@ package options
+ import (
+ 	"fmt"
+ 	"reflect"
++	"regexp"
+ 	"testing"
+ 	"time"
+ )
+@@ -199,7 +200,7 @@ var invalidSetTests = []struct {
+ 			"timeout": "2134",
+ 		},
+ 		"ns",
+-		`time: missing unit in duration 2134`,
++		`time: missing unit in duration "?2134"?`,
+ 	},
+ }
+ 
+@@ -212,8 +213,13 @@ func TestOptionsApplyInvalid(t *testing.T) {
+ 				t.Fatalf("expected error %v not found", test.err)
+ 			}
+ 
+-			if err.Error() != test.err {
+-				t.Fatalf("expected error %q, got %q", test.err, err.Error())
++			matched, err := regexp.MatchString(test.err, err.Error())
++			if err != nil {
++				t.Fatal(err)
++			}
++
++			if !matched {
++				t.Fatalf("expected error to match %q, got %q", test.err, err.Error())
+ 			}
+ 		})
+ 	}
-- 
2.31.1
S
S
Sarah Morgensen wrote on 5 Aug 2021 22:23
Re: bug#49221: [PATCH 00/13] Add go-1.16 and build with gccgo
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 49221@debbugs.gnu.org)
868s1f3ak6.fsf_-_@mgsn.dev
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (68 lines)
> Hello,
>
> Sarah Morgensen <iskarian@mgsn.dev> writes:
>
>> * gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch:
>> New file.
>> * gnu/local.mk (dist_patch_DATA): Register it.
>> * gnu/packages/golang.scm (go-github-com-bmatcuk-doublestar): Use it.
>> ---
>> gnu/local.mk | 1 +
>> gnu/packages/golang.scm | 5 ++++-
>> ...b-com-bmatcuk-doublestar-1.3-remove-test.patch | 15 +++++++++++++++
>> 3 files changed, 20 insertions(+), 1 deletion(-)
>> create mode 100644 gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
>>
>> diff --git a/gnu/local.mk b/gnu/local.mk
>> index 9caae52306..a176772ece 100644
>> --- a/gnu/local.mk
>> +++ b/gnu/local.mk
>> @@ -1172,6 +1172,7 @@ dist_patch_DATA = \
>> %D%/packages/patches/gobject-introspection-cc.patch \
>> %D%/packages/patches/gobject-introspection-girepository.patch \
>> %D%/packages/patches/go-skip-gc-test.patch \
>> + %D%/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch \
>> %D%/packages/patches/gpm-glibc-2.26.patch \
>> %D%/packages/patches/gpodder-disable-updater.patch \
>> %D%/packages/patches/gpsbabel-fix-i686-test.patch \
>> diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
>> index 9d5fc36710..3170e11925 100644
>> --- a/gnu/packages/golang.scm
>> +++ b/gnu/packages/golang.scm
>> @@ -5314,7 +5314,10 @@ template functions.")
>> (file-name (git-file-name name version))
>> (sha256
>> (base32
>> - "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))))
>> + "0bk5bixl6rqa8znxghyp6zndbccx9kdyrymjahgyp6qsrp7rk144"))
>> + (patches
>> + (search-patches
>> + "go-github-com-bmatcuk-doublestar-1.3-remove-test.patch"))))
>> (build-system go-build-system)
>> (arguments
>> `(#:import-path "github.com/bmatcuk/doublestar"))
>> diff --git a/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
>> new file mode 100644
>> index 0000000000..2c64575914
>> --- /dev/null
>> +++ b/gnu/packages/patches/go-github-com-bmatcuk-doublestar-1.3-remove-test.patch
>> @@ -0,0 +1,15 @@
>> +Remove test which fails with Go >= 1.15 due to API changes.
>> +This patch should no longer be necessary with doublestar v4+
>> +
>> +diff --git a/doublestar_test.go b/doublestar_test.go
>> +index b21d20ad4b..f510c3d06b 100644
>> +--- a/doublestar_test.go
>> ++++ b/doublestar_test.go
>> +@@ -80,7 +80,6 @@ var matchTests = []MatchTest{
>> + {"[", "a", false, ErrBadPattern, true},
>> + {"[^", "a", false, ErrBadPattern, true},
>> + {"[^bc", "a", false, ErrBadPattern, true},
>> +- {"a[", "a", false, nil, false},
>> + {"a[", "ab", false, ErrBadPattern, true},
>> + {"*x", "xxx", true, nil, true},
>> + {"[abc]", "b", true, nil, true},
>
> This should be reported upstream, if the test is still not working with
> the latest release (v4.0.2).

It is fixed in v2 or v3, but those are backwards-incompatible
upgrades, so I backported this patch.

Toggle quote (5 lines)
>
> Thanks,
>
> Maxim

--
Sarah
S
S
Sarah Morgensen wrote on 5 Aug 2021 22:24
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 49221@debbugs.gnu.org)
865ywj3aic.fsf_-_@mgsn.dev
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (57 lines)
> Hello,
>
> Sarah Morgensen <iskarian@mgsn.dev> writes:
>
> [...]
>
>> +From 97950ab81a18de06b95384da6d8646fef87c9d97 Mon Sep 17 00:00:00 2001
>> +From: Alexander Neumann <alexander@bumpern.de>
>> +Date: Sat, 12 Sep 2020 17:36:44 +0200
>> +Subject: [PATCH] options: Fix test for Go >= 1.15
>> +
>> +---
>> + internal/options/options_test.go | 12 +++++++++---
>> + 1 file changed, 9 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/internal/options/options_test.go b/internal/options/options_test.go
>> +index de94fc90a1..8d268992a3 100644
>> +--- a/internal/options/options_test.go
>> ++++ b/internal/options/options_test.go
>> +@@ -3,6 +3,7 @@ package options
>> + import (
>> + "fmt"
>> + "reflect"
>> ++ "regexp"
>> + "testing"
>> + "time"
>> + )
>> +@@ -199,7 +200,7 @@ var invalidSetTests = []struct {
>> + "timeout": "2134",
>> + },
>> + "ns",
>> +- `time: missing unit in duration 2134`,
>> ++ `time: missing unit in duration "?2134"?`,
>> + },
>> + }
>> +
>> +@@ -212,8 +213,13 @@ func TestOptionsApplyInvalid(t *testing.T) {
>> + t.Fatalf("expected error %v not found", test.err)
>> + }
>> +
>> +- if err.Error() != test.err {
>> +- t.Fatalf("expected error %q, got %q", test.err, err.Error())
>> ++ matched, err := regexp.MatchString(test.err, err.Error())
>> ++ if err != nil {
>> ++ t.Fatal(err)
>> ++ }
>> ++
>> ++ if !matched {
>> ++ t.Fatalf("expected error to match %q, got %q", test.err, err.Error())
>> + }
>> + })
>> + }
>
> I'm guessing this may also be not be necessary if we were to
> successfully update restic to v0.12.1. Do you think that would be
> difficult to try?

You are correct. This should eventually be done, but between v0.9.6 and
v0.10, restic unvendored all its dependencies, so it would require
packaging any missing dependencies.

Toggle quote (5 lines)
>
> Thanks,
>
> Maxim

--
Sarah
M
M
Maxim Cournoyer wrote on 6 Aug 2021 04:59
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49221-done@debbugs.gnu.org)
874kc3mg5z.fsf@gmail.com
Hello Sarah,

Sarah Morgensen <iskarian@mgsn.dev> writes:

[...]

Toggle quote (8 lines)
>> I'm guessing this may also be not be necessary if we were to
>> successfully update restic to v0.12.1. Do you think that would be
>> difficult to try?
>
> You are correct. This should eventually be done, but between v0.9.6 and
> v0.10, restic unvendored all its dependencies, so it would require
> packaging any missing dependencies.

I see! Thanks for the explanation. I've now merged both remaining
patches from this tracker as commits 733ca63bcd and 1273548f4f, with the
first one modified to do the patching as a phase (the patch file name
was too long -- caught by guix lint).

Thank you!

Closing.

Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 49221@debbugs.gnu.org