summary refs log tree commit diff
path: root/pkgs/development/compilers/go
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-11-20 14:32:58 +0100
committerVladimír Čunát <vcunat@gmail.com>2015-11-20 14:32:58 +0100
commit333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb (patch)
tree0f4757ddd2bb3d73b438eea85828d8e01c049583 /pkgs/development/compilers/go
parentbdbbfa0d4247e203ffe3171621b614374da05f70 (diff)
parentb809f886c0bdbd4665fc65a4c308d38a30c368d8 (diff)
downloadnixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.gz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.bz2
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.lz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.xz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.zst
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.zip
Merge staging into closure-size
The most complex problems were from dealing with switches reverted in
the meantime (gcc5, gmp6, ncurses6).
It's likely that darwin is (still) broken nontrivially.
Diffstat (limited to 'pkgs/development/compilers/go')
-rw-r--r--pkgs/development/compilers/go/1.4.nix10
-rw-r--r--pkgs/development/compilers/go/1.5.nix21
-rw-r--r--pkgs/development/compilers/go/strip.patch12
3 files changed, 39 insertions, 4 deletions
diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix
index ad995042864b..5a3b60e3ee6f 100644
--- a/pkgs/development/compilers/go/1.4.nix
+++ b/pkgs/development/compilers/go/1.4.nix
@@ -63,15 +63,23 @@ stdenv.mkDerivation rec {
   '' + lib.optionalString stdenv.isDarwin ''
     sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
     sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
+    sed -i '/TestCgoLookupIP/areturn' src/net/cgo_unix_test.go
+    sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go
+    sed -i '/TestDialDualStackLocalhost/areturn' src/net/dial_test.go
     sed -i '/TestRead0/areturn' src/os/os_test.go
     sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
-    sed -i '/TestDialDualStackLocalhost/areturn' src/net/dial_test.go
+
+    # fails when running inside tmux
+    sed -i '/TestNohup/areturn' src/os/signal/signal_test.go
+
 
     # remove IP resolving tests, on darwin they can find fe80::1%lo while expecting ::1
     sed -i '/TestResolveIPAddr/areturn' src/net/ipraw_test.go
     sed -i '/TestResolveTCPAddr/areturn' src/net/tcp_test.go
     sed -i '/TestResolveUDPAddr/areturn' src/net/udp_test.go
 
+    sed -i '/TestCgoExternalThreadSIGPROF/areturn' src/runtime/crash_cgo_test.go
+
     touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
   '';
 
diff --git a/pkgs/development/compilers/go/1.5.nix b/pkgs/development/compilers/go/1.5.nix
index 3858d2566f44..ce5c2579b89f 100644
--- a/pkgs/development/compilers/go/1.5.nix
+++ b/pkgs/development/compilers/go/1.5.nix
@@ -1,7 +1,7 @@
 { stdenv, lib, fetchurl, tzdata, iana_etc, go_1_4, runCommand
 , perl, which, pkgconfig, patch
 , pcre
-, Security }:
+, Security, Foundation }:
 
 let
   goBootstrap = runCommand "go-bootstrap" {} ''
@@ -25,7 +25,9 @@ stdenv.mkDerivation rec {
   # perl is used for testing go vet
   nativeBuildInputs = [ perl which pkgconfig patch ];
   buildInputs = [ pcre ];
-  propagatedBuildInputs = lib.optional stdenv.isDarwin Security;
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [
+    Security Foundation
+  ];
 
   # I'm not sure what go wants from its 'src', but the go installation manual
   # describes an installation keeping the src.
@@ -67,18 +69,31 @@ stdenv.mkDerivation rec {
   '' + lib.optionalString stdenv.isLinux ''
     sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
   '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/race.bash --replace \
+      "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
+    sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
     sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
     sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
+    sed -i '/TestCgoLookupIP/areturn' src/net/cgo_unix_test.go
+    sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go
     sed -i '/TestRead0/areturn' src/os/os_test.go
     sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
 
+    sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go
+    sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go
+
+    sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
+
     touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
   '';
 
   patches = [
     ./cacert-1.5.patch
     ./remove-tools-1.5.patch
-  ];
+  ]
+  # -ldflags=-s is required to compile on Darwin, see
+  # https://github.com/golang/go/issues/11994
+  ++ stdenv.lib.optional stdenv.isDarwin ./strip.patch;
 
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
   GOARCH = if stdenv.isDarwin then "amd64"
diff --git a/pkgs/development/compilers/go/strip.patch b/pkgs/development/compilers/go/strip.patch
new file mode 100644
index 000000000000..7b036802d51c
--- /dev/null
+++ b/pkgs/development/compilers/go/strip.patch
@@ -0,0 +1,12 @@
+diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
+index 0b14725..a7608ce 100644
+--- a/src/cmd/go/build.go
++++ b/src/cmd/go/build.go
+@@ -2310,6 +2310,7 @@ func (gcToolchain) ld(b *builder, root *action, out string, allactions []*action
+ 		}
+ 	}
+ 	var ldflags []string
++	ldflags = append(ldflags, "-s")
+ 	if buildContext.InstallSuffix != "" {
+ 		ldflags = append(ldflags, "-installsuffix", buildContext.InstallSuffix)
+ 	}