From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CDe+KgCsOmHJIwAAgWs5BA (envelope-from ) for ; Fri, 10 Sep 2021 02:51:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GNExJgCsOmGLTAAAbx9fmQ (envelope-from ) for ; Fri, 10 Sep 2021 00:51:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 631142A895 for ; Fri, 10 Sep 2021 02:51:12 +0200 (CEST) Received: from localhost ([::1]:58908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOUl5-0003vZ-F3 for larch@yhetil.org; Thu, 09 Sep 2021 20:51:11 -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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631235072; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4GLsFnlnUHfFSX7M84WJBsEChuilpCJU7+Y/4lr+uu0=; b=QSAxhYD7orLqY8izTA/K6qn2p4Hz+eQ2iuxRM+oCPIF/UmbcOaflly8cPcNS4deaDUcDal XhRbwOYIX/hs6Ml+fXUID0s7eruDIdp0oiYw1mAIwafMdcH8fm2YohDe8Vw6ean5bR3qUM vhbO/TasHBakftgTcw0uOGgbnAUJ8CB1uWLmzxq/l427R31zRkhtcp3nP7Yrsa0uMrery/ A8CzKKA/HhV9SXUMDEZpPHXZgH7JUniu+uf3afrqnZyWwiP8+pe+VCWJB728VmxqQJBx3F Qi4S+kzpqlrU+281mzfVqy4Uci57G1dugnRkCnL5rWYIKvb/7bpwQIqG0yuU7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631235072; a=rsa-sha256; cv=none; b=F5xnoPRqACOfySDatidkYkUuPzX16uksQGJ6i5G8bRQiw5ViEcmN4JMeUkfZvvWmjXDgb5 w+OIb5SAW4PvfHCrEmBi77bvqAJEidvqgJnP0KvG57Ht+1uRlzn+wyVTr9fExqvr15j/K/ EYnK0tuCitxQOGN+hxtdTG60BeZU5Ce36EvYh/6yO0ARuyJo55NMCaLQaQGxVMi/yJqZgB K1zTMYA7BDlQvwdY0D5m+1spzpclQGh4OwgtV/jaKlqqgTc6S5itrvxGa5bmR4ile1yVQ9 jMcu0NoLh7jbuy8i8vBZPGmL9+oguDk0qP02vwtyDmLpOJ2lHTlRmBNLD/3xgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b="HO7/moPO"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.69 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b="HO7/moPO"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 631142A895 X-Spam-Score: 3.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: KKGAphnryIRR * 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) { -- 2.33.0