[PATCH] gnu: containerd: Fix test failure with Go 1.13

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • Jack Hill
Owner
unassigned
Submitted by
Jack Hill
Severity
normal
J
J
Jack Hill wrote on 12 Feb 2020 21:33
(address . guix-patches@gnu.org)(name . Jack Hill)(address . jackhill@jackhill.us)
20200212203343.2327-1-jackhill@jackhill.us
* gnu/packages/docker.scm (containerd)[source]: Add patch.
* gnu/packages/patches/containerd-test-with-go1.13.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add patch.
---
gnu/local.mk | 1 +
gnu/packages/docker.scm | 4 +++-
.../patches/containerd-test-with-go1.13.patch | 21 +++++++++++++++++++
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/containerd-test-with-go1.13.patch

Toggle diff (56 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3f8fa2ed7b..0efb53f416 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -794,6 +794,7 @@ dist_patch_DATA = \
%D%/packages/patches/coda-use-system-libs.patch \
%D%/packages/patches/combinatorial-blas-awpm.patch \
%D%/packages/patches/combinatorial-blas-io-fix.patch \
+ %D%/packages/patches/containerd-test-with-go1.13.patch \
%D%/packages/patches/cpufrequtils-fix-aclocal.patch \
%D%/packages/patches/crawl-upgrade-saves.patch \
%D%/packages/patches/crda-optional-gcrypt.patch \
diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index 1f832a25e5..cc353fd11f 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -183,7 +183,9 @@ Python without keeping their credentials in a Docker configuration file.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0npbzixf3c0jvzm159vygvkydrr8h36c9sq50yv0mdinrys2bvg0"))))
+ (base32 "0npbzixf3c0jvzm159vygvkydrr8h36c9sq50yv0mdinrys2bvg0"))
+ (patches
+ (search-patches "containerd-test-with-go1.13.patch"))))
(build-system go-build-system)
(arguments
`(#:import-path "github.com/containerd/containerd"
diff --git a/gnu/packages/patches/containerd-test-with-go1.13.patch b/gnu/packages/patches/containerd-test-with-go1.13.patch
new file mode 100644
index 0000000000..964adee9e6
--- /dev/null
+++ b/gnu/packages/patches/containerd-test-with-go1.13.patch
@@ -0,0 +1,21 @@
+Compatibility fix for go 1.13, flag.Parse() shouldn't be called during
+package initialization.
+https://golang.org/doc/go1.13#testing
+--- a/client_test.go 2020-02-12 14:50:28.991245371 -0500
++++ b/client_test.go 2020-02-12 15:12:37.383523980 -0500
+@@ -49,7 +49,6 @@
+ flag.StringVar(&address, "address", defaultAddress, "The address to the containerd socket for use in the tests")
+ flag.BoolVar(&noDaemon, "no-daemon", false, "Do not start a dedicated daemon for the tests")
+ flag.BoolVar(&noCriu, "no-criu", false, "Do not run the checkpoint tests")
+- flag.Parse()
+ }
+
+ func testContext() (context.Context, context.CancelFunc) {
+@@ -59,6 +58,7 @@
+ }
+
+ func TestMain(m *testing.M) {
++ flag.Parse()
+ if testing.Short() {
+ os.Exit(m.Run())
+ }
--
2.25.0
D
D
Danny Milosavljevic wrote on 15 Feb 2020 14:32
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 39581-done@debbugs.gnu.org)
20200215143213.566efc76@scratchpost.org
Hi,

thanks for the patch!

Pushed to guix master as commit 42a69d1f16debfc8a923754695700ddfc9a74b12.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl5H8t0ACgkQ5xo1VCww
uqVq6Af+LkStJtfTAhDwph9DFPPmCI6aUsaOkgk7UTw/cHQAB0cTgZsbNzLtt7MO
bV1RII7nNKkT12HFokY4MSb0FpvaOcqonDZh0G9Pb91sh0352OsbrqzeLCpDnKlJ
qpLyD702XXFXFn3lXXHg3BAyVG1lBaZecek3P3K5jej9BGYU9IRkNIDypb1pJmTm
w+z3h6TSFWb1Dt/Gnty2x7VeJi/5AY+j+hJuFskvrkvdJvhdX3gYZAA5fslrtsd8
W2skBbyPZeOGp6SKLKL17XT1FDLTGuc5kUY/l208dfZYijVItsCY8/r/BdKhU16k
3qnU48OyvsOGAAghCaxh8DrgI1t3OA==
=z6No
-----END PGP SIGNATURE-----


Closed
?