GNU bug report logs - #50495
[PATCH 0/4] gnu: Fix some builds with go@1.17.

Previous Next

Package: guix-patches;

Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>

Date: Fri, 10 Sep 2021 00:48:01 UTC

Severity: normal

Tags: patch

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50495 in the body.
You can then email your comments to 50495 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#50495; Package guix-patches. (Fri, 10 Sep 2021 00:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sarah Morgensen <iskarian <at> mgsn.dev>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 10 Sep 2021 00:48:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/4] gnu: Fix some builds with go <at> 1.17.
Date: Thu,  9 Sep 2021 17:47:32 -0700
Hello Guix,

These patches fix building four packages with go <at> 1.17.  They still build
successfully with default go (on x86_64) and have a total of 9 dependents,
so should be fine for master.  (Three of them are just fixing tests, and the
keybase patch doesn't actually change code, just a comment that tripped up
Go.)

--
Sarah Morgensen (4):
  gnu: go-github-com-keybase-go-ps: Patch for go <at> 1.17.
  gnu: go-github-com-sevlyar-go-daemon: Fix tests for go <at> 1.17.
  gnu: go-github-com-urfave-cli: Fix tests with go <at> 1.17.
  gnu: go-github-com-urfave-cli-v2: Fix tests with go <at> 1.17.

 gnu/local.mk                                  |  2 +
 gnu/packages/golang.scm                       | 18 +++++++--
 .../go-github-com-urfave-cli-fix-tests.patch  | 28 ++++++++++++++
 ...o-github-com-urfave-cli-v2-fix-tests.patch | 37 +++++++++++++++++++
 4 files changed, 82 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
 create mode 100644 gnu/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch


base-commit: 370d1cdb61e1b9b5467d2aed4cab89c2a8e2a491
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50495; Package guix-patches. (Fri, 10 Sep 2021 00:51:01 GMT) Full text and rfc822 format available.

Message #8 received at 50495 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50495 <at> debbugs.gnu.org
Subject: [PATCH 1/4] gnu: go-github-com-keybase-go-ps: Patch for go <at> 1.17.
Date: Thu,  9 Sep 2021 17:50:07 -0700
* gnu/packages/golang.scm (go-github-com-keybase-go-ps)[arguments]
<#:phases>{fix-tests}: Remove extraneous build line to appease go <at> 1.17.
---
 gnu/packages/golang.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 2dfd47d396..4577c49cba 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1597,7 +1597,9 @@ (define-public go-github-com-keybase-go-ps
                  (("/bin/sleep" command)
                   (string-append
                    (assoc-ref (or native-inputs inputs) "coreutils")
-                   command))))))))
+                   command)))
+               (substitute* "src/github.com/keybase/go-ps/process_openbsd.go"
+                 (("^// \\+build ignore") "")))))))
       (native-inputs
        `(("coreutils" ,coreutils)
          ("go-github-com-stretchr-testify"
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50495; Package guix-patches. (Fri, 10 Sep 2021 00:51:02 GMT) Full text and rfc822 format available.

Message #11 received at 50495 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50495 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gnu: go-github-com-sevlyar-go-daemon: Fix tests for
 go <at> 1.17.
Date: Thu,  9 Sep 2021 17:50:08 -0700
* gnu/packages/golang.scm (go-github-com-sevlyar-go-daemon)[source]:
Add snippet to fix tests for go <at> 1.17.
---
 gnu/packages/golang.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 4577c49cba..b08796e22a 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1558,6 +1558,12 @@ (define-public go-github-com-sevlyar-go-daemon
          (url "https://github.com/sevlyar/go-daemon")
          (commit (string-append "v" version))))
        (file-name (git-file-name name version))
+       (modules '((guix build utils)))
+       (snippet
+        ;; XXX: Remove when updating
+        '(begin
+           (substitute* "compilation_test.go"
+             ((".*\"darwin/386\".*") ""))))
        (sha256
         (base32 "1y3gnxaifykcjcbzx91lz9bc93b95w3xj4rjxjbii26pm3j7gqyk"))))
     (build-system go-build-system)
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50495; Package guix-patches. (Fri, 10 Sep 2021 00:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 50495 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50495 <at> debbugs.gnu.org
Subject: [PATCH 3/4] gnu: go-github-com-urfave-cli: Fix tests with go <at> 1.17.
Date: Thu,  9 Sep 2021 17:50:09 -0700
* gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/golang.scm (go-github-com-urfave-cli)[origin]: Apply it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/golang.scm                       |  3 +-
 .../go-github-com-urfave-cli-fix-tests.patch  | 28 +++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2a56c4a9e2..bd6e2e79d0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1184,6 +1184,7 @@ dist_patch_DATA =						\
   %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-github-com-urfave-cli-fix-tests.patch \
   %D%/packages/patches/go-skip-gc-test.patch			\
   %D%/packages/patches/gpm-glibc-2.26.patch			\
   %D%/packages/patches/gpodder-disable-updater.patch		\
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b08796e22a..2d0bbdb30d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4976,7 +4976,8 @@ (define-public go-github-com-urfave-cli
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "10mcnvi5qmn00vpyk6si8gjka7p654wr9hac4zc9w5h3ickhvbdc"))))
+         "10mcnvi5qmn00vpyk6si8gjka7p654wr9hac4zc9w5h3ickhvbdc"))
+       (patches (search-patches "go-github-com-urfave-cli-fix-tests.patch"))))
     (build-system go-build-system)
     (arguments
      '(#:import-path "github.com/urfave/cli"))
diff --git a/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch b/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
new file mode 100644
index 0000000000..7408d4ec16
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
@@ -0,0 +1,28 @@
+Backported from upstream PR: https://github.com/urfave/cli/pull/1299
+---
+diff --git a/app_test.go b/app_test.go
+index 33024ff..6b3aaa3 100644
+--- a/app_test.go
++++ b/app_test.go
+@@ -513,18 +513,18 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
+ func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
+ 	a := App{
+ 		Flags: []Flag{
+-			StringFlag{Name: "--foo"},
++			StringFlag{Name: "foo"},
+ 		},
+ 		Writer: bytes.NewBufferString(""),
+ 	}
+ 
+ 	set := flag.NewFlagSet("", flag.ContinueOnError)
+-	_ = set.Parse([]string{"", "---foo"})
++	_ = set.Parse([]string{"", "-bar"})
+ 	c := &Context{flagSet: set}
+ 
+ 	err := a.RunAsSubcommand(c)
+ 
+-	expect(t, err, errors.New("bad flag syntax: ---foo"))
++	expect(t, err.Error(), "flag provided but not defined: -bar")
+ }
+ 
+ func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) {
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50495; Package guix-patches. (Fri, 10 Sep 2021 00:51:03 GMT) Full text and rfc822 format available.

Message #17 received at 50495 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50495 <at> debbugs.gnu.org
Subject: [PATCH 4/4] gnu: go-github-com-urfave-cli-v2: Fix tests with go <at> 1.17.
Date: Thu,  9 Sep 2021 17:50:10 -0700
* gnu/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/golang.scm (go-github-com-urfave-cli-v2)[origin]: Apply it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/golang.scm                       |  5 ++-
 ...o-github-com-urfave-cli-v2-fix-tests.patch | 37 +++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index bd6e2e79d0..c7fde5348f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1185,6 +1185,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gobject-introspection-girepository.patch	\
   %D%/packages/patches/go-fix-script-tests.patch			\
   %D%/packages/patches/go-github-com-urfave-cli-fix-tests.patch \
+  %D%/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch \
   %D%/packages/patches/go-skip-gc-test.patch			\
   %D%/packages/patches/gpm-glibc-2.26.patch			\
   %D%/packages/patches/gpodder-disable-updater.patch		\
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 2d0bbdb30d..4c6b41e406 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5003,7 +5003,10 @@ (define-public go-github-com-urfave-cli-v2
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "08pvn7gyfznni72xrxfh2x6xxa8ykr7l1ka278js8g8qkh71bj8l"))))
+        (base32 "08pvn7gyfznni72xrxfh2x6xxa8ykr7l1ka278js8g8qkh71bj8l"))
+       ;; XXX: Remove patch when updating.
+       (patches
+        (search-patches "go-github-com-urfave-cli-v2-fix-tests.patch"))))
     (arguments
      '(#:import-path "github.com/urfave/cli/v2"))))
 
diff --git a/gnu/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch b/gnu/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch
new file mode 100644
index 0000000000..87ccc2b655
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch
@@ -0,0 +1,37 @@
+From upstream PR: https://github.com/urfave/cli/pull/1299
+
+From: William Wilson <william.wilson <at> canonical.com>
+Date: Tue, 31 Aug 2021 14:19:17 -0500
+Subject: Make test case compatible with Go 1.17
+
+As of Go 1.17, the go flag package will panic if given a syntactically invalid
+flag. This causes TestApp_RunAsSubCommandIncorrectUsage to panic and therefore
+fail. See https://golang.org/doc/go1.17#flag for more information.
+
+---
+diff --git a/app_test.go b/app_test.go
+index 7c38f6048..76e211d68 100644
+--- a/app_test.go
++++ b/app_test.go
+@@ -476,18 +476,18 @@ func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
+ 	a := App{
+ 		Name: "cmd",
+ 		Flags: []Flag{
+-			&StringFlag{Name: "--foo"},
++			&StringFlag{Name: "foo"},
+ 		},
+ 		Writer: bytes.NewBufferString(""),
+ 	}
+ 
+ 	set := flag.NewFlagSet("", flag.ContinueOnError)
+-	_ = set.Parse([]string{"", "---foo"})
++	_ = set.Parse([]string{"", "-bar"})
+ 	c := &Context{flagSet: set}
+ 
+ 	err := a.RunAsSubcommand(c)
+ 
+-	expect(t, err, errors.New("bad flag syntax: ---foo"))
++	expect(t, err.Error(), "flag provided but not defined: -bar")
+ }
+ 
+ func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) {
-- 
2.33.0





Added indication that bug 50495 blocks50348 Request was from Sarah Morgensen <iskarian <at> mgsn.dev> to control <at> debbugs.gnu.org. (Fri, 10 Sep 2021 00:52:02 GMT) Full text and rfc822 format available.

Removed indication that bug 50495 blocks Request was from Sarah Morgensen <iskarian <at> mgsn.dev> to control <at> debbugs.gnu.org. (Fri, 10 Sep 2021 00:56:01 GMT) Full text and rfc822 format available.

Added indication that bug 50495 blocks50493 Request was from Sarah Morgensen <iskarian <at> mgsn.dev> to control <at> debbugs.gnu.org. (Fri, 10 Sep 2021 00:57:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#50495; Package guix-patches. (Fri, 10 Sep 2021 01:43:02 GMT) Full text and rfc822 format available.

Message #26 received at 50495 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 50495 <at> debbugs.gnu.org
Subject: Re: [bug#50495] [PATCH 0/4] gnu: Fix some builds with go <at> 1.17.
Date: Thu, 9 Sep 2021 21:41:51 -0400
On Thu, Sep 09, 2021 at 05:47:32PM -0700, Sarah Morgensen wrote:
> Hello Guix,
> 
> These patches fix building four packages with go <at> 1.17.  They still build
> successfully with default go (on x86_64) and have a total of 9 dependents,
> so should be fine for master.  (Three of them are just fixing tests, and the
> keybase patch doesn't actually change code, just a comment that tripped up
> Go.)

Thanks for these patches!

I tweaked the commit titles to make them a little more consistent and
less idiomatic and pushed as 63cc4dd5793b62802354a31d8e6913f065d3bcec.

I think that using plain and verbose English can help people coming from
other languages.




bug closed, send any further explanations to 50495 <at> debbugs.gnu.org and Sarah Morgensen <iskarian <at> mgsn.dev> Request was from Leo Famulari <leo <at> famulari.name> to control <at> debbugs.gnu.org. (Fri, 10 Sep 2021 01:43:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 08 Oct 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.