From 45043abd2da0b6fc13b7c616c2af5e9b91aab8ac Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 21 Dec 2016 14:09:55 +0100 Subject: [PATCH] Fix go test In a user namespace, sending credentials for an unmapped user return EINVAL instead of EPERM. So handle that case. http://hydra.nixos.org/build/44839000 (cherry picked from commit 1dd0fb6b5a7c44d1b632466f936ca74268d13298) --- pkgs/development/compilers/go/1.7.nix | 6 +++++- pkgs/development/compilers/go/creds-test.patch | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/go/creds-test.patch diff --git a/pkgs/development/compilers/go/1.7.nix b/pkgs/development/compilers/go/1.7.nix index 16de9b0edbf..c33e45c2983 100644 --- a/pkgs/development/compilers/go/1.7.nix +++ b/pkgs/development/compilers/go/1.7.nix @@ -101,7 +101,11 @@ stdenv.mkDerivation rec { sed -i '1 a\exit 0' misc/cgo/errors/test.bash ''; - patches = [ ./remove-tools-1.7.patch ./cacert-1.7.patch ]; + patches = + [ ./remove-tools-1.7.patch + ./cacert-1.7.patch + ./creds-test.patch + ]; SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; diff --git a/pkgs/development/compilers/go/creds-test.patch b/pkgs/development/compilers/go/creds-test.patch new file mode 100644 index 00000000000..09f78959ff9 --- /dev/null +++ b/pkgs/development/compilers/go/creds-test.patch @@ -0,0 +1,14 @@ +diff -ru -x '*~' ./result/src/syscall/creds_test.go go-go1.7.4-src/src/syscall/creds_test.go +--- ./result/src/syscall/creds_test.go 1970-01-01 01:00:01.000000000 +0100 ++++ go-go1.7.4-src/src/syscall/creds_test.go 2016-12-21 14:06:39.559932164 +0100 +@@ -62,8 +62,8 @@ + if sys, ok := err.(*os.SyscallError); ok { + err = sys.Err + } +- if err != syscall.EPERM { +- t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err) ++ if err != syscall.EPERM && err != syscall.EINVAL { ++ t.Fatalf("WriteMsgUnix failed with %v, want EPERM or EINVAL", err) + } + } +