git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #68195 from adisbladis/drop-go-1_11

Drop unsupported go version 1.11

commit7782fcfffe2ef922df538d7316e96bf2884fa0e1 authoradisbladis <adisbladis@gmail.com> dateWed 11 Sep 2019, 15:05 (7 years ago) parent1593d913e501fe
4 files changed+33−268
pkgs/development/compilers/go/1.11.nix−232 pkgs/servers/mirrorbits/default.nix+5 pkgs/tools/misc/mongodb-tools/default.nix+26−15 pkgs/top-level/all-packages.nix+2−21
pkgs/development/compilers/go/1.11.nixdeleted−232
@@ -1,232 +0,0 @@
1−{ stdenv, fetchurl, tzdata, iana-etc, runCommand
2−, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
3−, mailcap, runtimeShell
4−, buildPackages, pkgsTargetTarget
5−}:
6−
7−let
8−
9− inherit (stdenv.lib) optionals optionalString;
10−
11− goBootstrap = runCommand "go-bootstrap" {} ''
12− mkdir $out
13− cp -rf ${buildPackages.go_bootstrap}/* $out/
14− chmod -R u+w $out
15− find $out -name "*.c" -delete
16− cp -rf $out/bin/* $out/share/go/bin/
17− '';
18−
19− goarch = platform: {
20− i686 = "386";
21− x86_64 = "amd64";
22− aarch64 = "arm64";
23− arm = "arm";
24− armv5tel = "arm";
25− armv6l = "arm";
26− armv7l = "arm";
27− }.${platform.parsed.cpu.name} or (throw "Unsupported system");
28−
29−in
30−
31−stdenv.mkDerivation rec {
32− pname = "go";
33− version = "1.11.13";
34−
35− src = fetchurl {
36− url = "https://dl.google.com/go/go${version}.src.tar.gz";
37− sha256 = "0xj0pbviikdf8g0sfz5hwxf7hwz8b8g5akqnrvyclhgnsdghjcjh";
38− };
39−
40− # perl is used for testing go vet
41− nativeBuildInputs = [ perl which pkgconfig patch procps ];
42− buildInputs = [ cacert pcre ]
43− ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
44− ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
45−
46−
47− propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];
48−
49− hardeningDisable = [ "all" ];
50−
51− prePatch = ''
52− patchShebangs ./ # replace /bin/bash
53−
54− # This source produces shell script at run time,
55− # and thus it is not corrected by patchShebangs.
56− substituteInPlace misc/cgo/testcarchive/carchive_test.go \
57− --replace '#!/usr/bin/env bash' '#!${runtimeShell}'
58−
59− # Patch the mimetype database location which is missing on NixOS.
60− substituteInPlace src/mime/type_unix.go \
61− --replace '/etc/mime.types' '${mailcap}/etc/mime.types'
62−
63− # Disabling the 'os/http/net' tests (they want files not available in
64− # chroot builds)
65− rm src/net/{listen,parse}_test.go
66− rm src/syscall/exec_linux_test.go
67−
68− # !!! substituteInPlace does not seems to be effective.
69− # The os test wants to read files in an existing path. Just don't let it be /usr/bin.
70− sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
71− sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
72− # Disable the unix socket test
73− sed -i '/TestShutdownUnix/areturn' src/net/net_test.go
74− # Disable the hostname test
75− sed -i '/TestHostname/areturn' src/os/os_test.go
76− # ParseInLocation fails the test
77− sed -i '/TestParseInSydney/areturn' src/time/format_test.go
78− # Remove the api check as it never worked
79− sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
80− # Remove the coverage test as we have removed this utility
81− sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go
82− # Remove the timezone naming test
83− sed -i '/TestLoadFixed/areturn' src/time/time_test.go
84− # Remove disable setgid test
85− sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go
86− # Remove cert tests that conflict with NixOS's cert resolution
87− sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go
88− # TestWritevError hangs sometimes
89− sed -i '/TestWritevError/areturn' src/net/writev_test.go
90− # TestVariousDeadlines fails sometimes
91− sed -i '/TestVariousDeadlines/areturn' src/net/timeout_test.go
92−
93− sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
94− sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
95−
96− # Disable cgo lookup tests not works, they depend on resolver
97− rm src/net/cgo_unix_test.go
98−
99− '' + optionalString stdenv.isLinux ''
100− sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
101− '' + optionalString stdenv.isAarch32 ''
102− echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
103− '' + optionalString stdenv.isDarwin ''
104− substituteInPlace src/race.bash --replace \
105− "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
106− sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
107− sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
108− sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
109−
110− sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go
111− sed -i '/TestCredentialNoSetGroups/areturn' src/os/exec/exec_posix_test.go
112− sed -i '/TestRead0/areturn' src/os/os_test.go
113− sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
114−
115− sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go
116− sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go
117−
118− sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
119−
120− sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
121−
122− touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
123− '';
124−
125− patches = [
126− ./remove-tools-1.11.patch
127− ./ssl-cert-file-1.12.1.patch
128− ./remove-test-pie.patch
129− ./creds-test.patch
130− ./go-1.9-skip-flaky-19608.patch
131− ./go-1.9-skip-flaky-20072.patch
132− ./remove-fhs-test-references.patch
133− ./skip-external-network-tests.patch
134− ./skip-nohup-tests.patch
135− # breaks under load: https://github.com/golang/go/issues/25628
136− ./skip-test-extra-files-on-386.patch
137− ];
138−
139− GOOS = stdenv.targetPlatform.parsed.kernel.name;
140− GOARCH = goarch stdenv.targetPlatform;
141− # GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
142− # Go will nevertheless build a for host system that we will copy over in
143− # the install phase.
144− GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name;
145− GOHOSTARCH = goarch stdenv.buildPlatform;
146−
147− # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
148− # to be different from CC/CXX
149− CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
150− "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
151− else
152− null;
153− CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
154− "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"
155− else
156− null;
157−
158− GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
159− GO386 = 387; # from Arch: don't assume sse2 on i686
160− CGO_ENABLED = 1;
161− # Hopefully avoids test timeouts on Hydra
162− GO_TEST_TIMEOUT_SCALE = 3;
163−
164− # Indicate that we are running on build infrastructure
165− # Some tests assume things like home directories and users exists
166− GO_BUILDER_NAME = "nix";
167−
168− GOROOT_BOOTSTRAP="${goBootstrap}/share/go";
169−
170− postConfigure = ''
171− export GOCACHE=$TMPDIR/go-cache
172− # this is compiled into the binary
173− export GOROOT_FINAL=$out/share/go
174−
175− export PATH=$(pwd)/bin:$PATH
176−
177− # Independent from host/target, CC should produce code for the building system.
178− export CC=${buildPackages.stdenv.cc}/bin/cc
179− ulimit -a
180− '';
181−
182− postBuild = ''
183− (cd src && ./make.bash)
184− '';
185−
186− doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin;
187−
188− checkPhase = ''
189− runHook preCheck
190− (cd src && ./run.bash --no-rebuild)
191− runHook postCheck
192− '';
193−
194− preInstall = ''
195− rm -r pkg/{bootstrap,obj}
196− # Contains the wrong perl shebang when cross compiling,
197− # since it is not used for anything we can deleted as well.
198− rm src/regexp/syntax/make_perl_groups.pl
199− '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then ''
200− mv bin/*_*/* bin
201− rmdir bin/*_*
202− ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) ''
203− rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH}
204− ''}
205− '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then ''
206− rm -rf bin/*_*
207− ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) ''
208− rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH}
209− ''}
210− '' else "");
211−
212− installPhase = ''
213− runHook preInstall
214− mkdir -p $GOROOT_FINAL
215− cp -a bin pkg src lib misc api doc $GOROOT_FINAL
216− ln -s $GOROOT_FINAL/bin $out/bin
217− runHook postInstall
218− '';
219−
220− setupHook = ./setup-hook.sh;
221−
222− disallowedReferences = [ goBootstrap ];
223−
224− meta = with stdenv.lib; {
225− branch = "1.11";
226− homepage = http://golang.org/;
227− description = "The Go Programming language";
228− license = licenses.bsd3;
229− maintainers = with maintainers; [ cstrahan orivej velovix mic92 rvolosatovs ];
230− platforms = platforms.linux ++ platforms.darwin;
231− };
232−}
pkgs/servers/mirrorbits/default.nix+5
@@ -24,6 +24,11 @@ buildGoPackage rec {
2424 rm -rf testing
2525 '';
2626
27+ # Fix build with go >=1.12
28+ preBuild = ''
29+ sed -i s/"_Ctype_struct_GeoIPRecordTag"/"C.struct_GeoIPRecordTag"/ ./go/src/github.com/etix/geoip/geoip.go
30+ '';
31+
2732 goPackagePath = "github.com/etix/mirrorbits";
2833 goDeps = ./deps.nix;
2934
pkgs/tools/misc/mongodb-tools/default.nix+26−15
@@ -1,27 +1,38 @@
1−{ stdenv, buildGoPackage, fetchFromGitHub, openssl_1_0_2, pkgconfig, libpcap }:
1+{ stdenv
2+, lib
3+, buildGoPackage
4+, fetchFromGitHub
5+, openssl_1_0_2
6+, pkgconfig
7+, libpcap
8+}:
29
310let
411 tools = [
5− "bsondump" "mongodump" "mongoexport" "mongofiles" "mongoimport"
6− "mongoreplay" "mongorestore" "mongostat" "mongotop"
12+ "bsondump"
13+ "mongoimport"
14+ "mongoexport"
15+ "mongodump"
16+ "mongorestore"
17+ "mongostat"
18+ "mongofiles"
19+ "mongotop"
20+ "mongoreplay"
721 ];
8−in
22+ version = "4.2.0";
923
10−with stdenv.lib;
11−
12−buildGoPackage rec {
24+in buildGoPackage {
1325 pname = "mongo-tools";
14− version = "3.7.2";
15− rev = "r${version}";
26+ inherit version;
1627
1728 goPackagePath = "github.com/mongodb/mongo-tools";
18− subPackages = map (t: t + "/main") tools;
29+ subPackages = tools;
1930
2031 src = fetchFromGitHub {
21− inherit rev;
32+ rev = "r${version}";
2233 owner = "mongodb";
2334 repo = "mongo-tools";
24− sha256 = "1y5hd4qw7422sqkj8vmy4agscvin3ck54r515bjrzn69iw73nhfl";
35+ sha256 = "0mjwvx0cxvb6zam6jyr3753xjnwcygxcjzqhhlsq0b3xnwws9yh7";
2536 };
2637
2738 nativeBuildInputs = [ pkgconfig ];
@@ -31,18 +42,18 @@ buildGoPackage rec {
3142 # Let's work around this with our own installer
3243 buildPhase = ''
3344 # move vendored codes so nixpkgs go builder could find it
34− mv go/src/github.com/mongodb/mongo-tools/vendor/src/* go/src/github.com/mongodb/mongo-tools/vendor/
35−
3645 runHook preBuild
46+
3747 ${stdenv.lib.concatMapStrings (t: ''
3848 go build -o "$bin/bin/${t}" -tags ssl -ldflags "-s -w" $goPackagePath/${t}/main
3949 '') tools}
50+
4051 runHook postBuild
4152 '';
4253
4354 meta = {
4455 homepage = https://github.com/mongodb/mongo-tools;
4556 description = "Tools for the MongoDB";
46− license = licenses.asl20;
57+ license = lib.licenses.asl20;
4758 };
4859}
pkgs/top-level/all-packages.nix+2−21
@@ -1993,11 +1993,7 @@ in
19931993
19941994 mongodb-compass = callPackage ../tools/misc/mongodb-compass { };
19951995
1996− mongodb-tools = callPackage ../tools/misc/mongodb-tools {
1997− # XXX: this is failing with Go 1.12. Error is related to cgo, an
1998− # update to this package might fix it.
1999− buildGoPackage = buildGo111Package;
2000− };
1996+ mongodb-tools = callPackage ../tools/misc/mongodb-tools { };
20011997
20021998 moosefs = callPackage ../tools/filesystems/moosefs { };
20031999
@@ -4798,11 +4794,7 @@ in
47984794
47994795 miredo = callPackage ../tools/networking/miredo { };
48004796
4801− mirrorbits = callPackage ../servers/mirrorbits {
4802− # XXX: this is failing with Go 1.12. Error is related to cgo, an
4803− # update to this package might fix it.
4804− buildGoPackage = buildGo111Package;
4805− };
4797+ mirrorbits = callPackage ../servers/mirrorbits { };
48064798
48074799 mitmproxy = callPackage ../tools/networking/mitmproxy { };
48084800
@@ -7908,10 +7900,6 @@ in
79087900 inherit (darwin.apple_sdk.frameworks) Security;
79097901 };
79107902
7911− go_1_11 = callPackage ../development/compilers/go/1.11.nix {
7912− inherit (darwin.apple_sdk.frameworks) Security Foundation;
7913− };
7914−
79157903 go_1_12 = callPackage ../development/compilers/go/1.12.nix {
79167904 inherit (darwin.apple_sdk.frameworks) Security Foundation;
79177905 };
@@ -14349,19 +14337,12 @@ in
1434914337
1435014338 ### DEVELOPMENT / GO MODULES
1435114339
14352− buildGo111Package = callPackage ../development/go-packages/generic {
14353− go = buildPackages.go_1_11;
14354− };
1435514340 buildGo112Package = callPackage ../development/go-packages/generic {
1435614341 go = buildPackages.go_1_12;
1435714342 };
1435814343
1435914344 buildGoPackage = buildGo112Package;
1436014345
14361− buildGo111Module = callPackage ../development/go-modules/generic {
14362− go = buildPackages.go_1_11;
14363− };
14364−
1436514346 buildGo112Module = callPackage ../development/go-modules/generic {
1436614347 go = buildPackages.go_1_12;
1436714348 };