unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17.
@ 2021-09-10  0:47 Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 1/4] gnu: go-github-com-keybase-go-ps: Patch for go@1.17 Sarah Morgensen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sarah Morgensen @ 2021-09-10  0:47 UTC (permalink / raw)
  To: 50495

Hello Guix,

These patches fix building four packages with go@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@1.17.
  gnu: go-github-com-sevlyar-go-daemon: Fix tests for go@1.17.
  gnu: go-github-com-urfave-cli: Fix tests with go@1.17.
  gnu: go-github-com-urfave-cli-v2: Fix tests with go@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#50495] [PATCH 1/4] gnu: go-github-com-keybase-go-ps: Patch for go@1.17.
  2021-09-10  0:47 [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17 Sarah Morgensen
@ 2021-09-10  0:50 ` Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 2/4] gnu: go-github-com-sevlyar-go-daemon: Fix tests " Sarah Morgensen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen @ 2021-09-10  0:50 UTC (permalink / raw)
  To: 50495

* gnu/packages/golang.scm (go-github-com-keybase-go-ps)[arguments]
<#:phases>{fix-tests}: Remove extraneous build line to appease go@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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#50495] [PATCH 2/4] gnu: go-github-com-sevlyar-go-daemon: Fix tests for go@1.17.
  2021-09-10  0:47 [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17 Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 1/4] gnu: go-github-com-keybase-go-ps: Patch for go@1.17 Sarah Morgensen
@ 2021-09-10  0:50 ` Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 3/4] gnu: go-github-com-urfave-cli: Fix tests with go@1.17 Sarah Morgensen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen @ 2021-09-10  0:50 UTC (permalink / raw)
  To: 50495

* gnu/packages/golang.scm (go-github-com-sevlyar-go-daemon)[source]:
Add snippet to fix tests for go@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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#50495] [PATCH 3/4] gnu: go-github-com-urfave-cli: Fix tests with go@1.17.
  2021-09-10  0:47 [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17 Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 1/4] gnu: go-github-com-keybase-go-ps: Patch for go@1.17 Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 2/4] gnu: go-github-com-sevlyar-go-daemon: Fix tests " Sarah Morgensen
@ 2021-09-10  0:50 ` Sarah Morgensen
  2021-09-10  0:50 ` [bug#50495] [PATCH 4/4] gnu: go-github-com-urfave-cli-v2: " Sarah Morgensen
  2021-09-10  1:41 ` [bug#50495] [PATCH 0/4] gnu: Fix some builds " Leo Famulari
  4 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen @ 2021-09-10  0:50 UTC (permalink / raw)
  To: 50495

* 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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#50495] [PATCH 4/4] gnu: go-github-com-urfave-cli-v2: Fix tests with go@1.17.
  2021-09-10  0:47 [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17 Sarah Morgensen
                   ` (2 preceding siblings ...)
  2021-09-10  0:50 ` [bug#50495] [PATCH 3/4] gnu: go-github-com-urfave-cli: Fix tests with go@1.17 Sarah Morgensen
@ 2021-09-10  0:50 ` Sarah Morgensen
  2021-09-10  1:41 ` [bug#50495] [PATCH 0/4] gnu: Fix some builds " Leo Famulari
  4 siblings, 0 replies; 6+ messages in thread
From: Sarah Morgensen @ 2021-09-10  0:50 UTC (permalink / raw)
  To: 50495

* 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@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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17.
  2021-09-10  0:47 [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17 Sarah Morgensen
                   ` (3 preceding siblings ...)
  2021-09-10  0:50 ` [bug#50495] [PATCH 4/4] gnu: go-github-com-urfave-cli-v2: " Sarah Morgensen
@ 2021-09-10  1:41 ` Leo Famulari
  4 siblings, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2021-09-10  1:41 UTC (permalink / raw)
  To: Sarah Morgensen; +Cc: 50495

On Thu, Sep 09, 2021 at 05:47:32PM -0700, Sarah Morgensen wrote:
> Hello Guix,
> 
> These patches fix building four packages with go@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.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-10  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10  0:47 [bug#50495] [PATCH 0/4] gnu: Fix some builds with go@1.17 Sarah Morgensen
2021-09-10  0:50 ` [bug#50495] [PATCH 1/4] gnu: go-github-com-keybase-go-ps: Patch for go@1.17 Sarah Morgensen
2021-09-10  0:50 ` [bug#50495] [PATCH 2/4] gnu: go-github-com-sevlyar-go-daemon: Fix tests " Sarah Morgensen
2021-09-10  0:50 ` [bug#50495] [PATCH 3/4] gnu: go-github-com-urfave-cli: Fix tests with go@1.17 Sarah Morgensen
2021-09-10  0:50 ` [bug#50495] [PATCH 4/4] gnu: go-github-com-urfave-cli-v2: " Sarah Morgensen
2021-09-10  1:41 ` [bug#50495] [PATCH 0/4] gnu: Fix some builds " Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).