From patchwork Fri Sep 10 00:50:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarah Morgensen X-Patchwork-Id: 32736 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9E4E527BBE3; Fri, 10 Sep 2021 01:51:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5277D27BBE1 for ; Fri, 10 Sep 2021 01:51:17 +0100 (BST) Received: from localhost ([::1]:58908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOUlA-0003vZ-BQ for patchwork@mira.cbaines.net; Thu, 09 Sep 2021 20:51:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOUkx-0003p7-JI for guix-patches@gnu.org; Thu, 09 Sep 2021 20:51:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOUkx-0006jE-BZ for guix-patches@gnu.org; Thu, 09 Sep 2021 20:51:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mOUkx-0005Lv-9c for guix-patches@gnu.org; Thu, 09 Sep 2021 20:51:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50495] [PATCH 4/4] gnu: go-github-com-urfave-cli-v2: Fix tests with go@1.17. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Sep 2021 00:51:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50495 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50495@debbugs.gnu.org Received: via spool by 50495-submit@debbugs.gnu.org id=B50495.163123502320502 (code B ref 50495); Fri, 10 Sep 2021 00:51:03 +0000 Received: (at 50495) by debbugs.gnu.org; 10 Sep 2021 00:50:23 +0000 Received: from localhost ([127.0.0.1]:36471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOUkI-0005Kb-Hz for submit@debbugs.gnu.org; Thu, 09 Sep 2021 20:50:22 -0400 Received: from out0.migadu.com ([94.23.1.103]:63110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOUkF-0005KE-9r for 50495@debbugs.gnu.org; Thu, 09 Sep 2021 20:50:19 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1631235018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4GLsFnlnUHfFSX7M84WJBsEChuilpCJU7+Y/4lr+uu0=; b=HO7/moPOw9TJL48x2sJ1a1q9tBPyn3vj00ETdpniwEzYiRsZSSLsu+ehgH8TNqDvCjbfDV 40tKxtyN9UmravafOtCIajL/cOinKtmWhmHemWcUTlvkQWHhYTNB0LOs2kSNBA88q0goZ3 GRCvGBp0BaiJbPzzzThiZZdfCqGcNWg= From: Sarah Morgensen Date: Thu, 9 Sep 2021 17:50:10 -0700 Message-Id: <4acdf53ef984f8726f85f0a135441daa4f02d19a.1631234078.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 +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) {