lol

Merge pull request #35350 from adisbladis/drop/go-1_8

go: Remove old version 1.8

authored by

adisbladis and committed by
GitHub
0b3a5b56 4da66a7c

+50 -337
+43 -2
pkgs/applications/misc/perkeep/default.nix
··· 1 - { stdenv, lib, go_1_8, fetchzip, git }: 1 + { stdenv, lib, go, fetchzip, git, fetchpatch, fetchFromGitHub, fetchgit }: 2 + 3 + # When perkeep is updated all deps in the let block should be removed 4 + let 5 + gopherjs = fetchFromGitHub { 6 + owner = "gopherjs"; 7 + repo = "gopherjs"; 8 + # Rev matching https://github.com/perkeep/perkeep/commit/2e46fca5cc1179dbd90bec49fec3870e6eca6c45 9 + rev = "b40cd48c38f9a18eb3db20d163bad78de12cf0b7"; 10 + sha256 = "0kniz8dg5bymb03qriizza1h3gpymf97vsgq9vd222282pdj0vyc"; 11 + }; 12 + 13 + gotool = fetchFromGitHub { 14 + owner = "kisielk"; 15 + repo = "gotool"; 16 + rev = "80517062f582ea3340cd4baf70e86d539ae7d84d"; 17 + sha256 = "14af2pa0ssyp8bp2mvdw184s5wcysk6akil3wzxmr05wwy951iwn"; 18 + }; 19 + 20 + gcimporter15 = fetchgit { 21 + url = "https://go.googlesource.com/tools"; 22 + rev = "f8f2f88271bf2c23f28a09d288d26507a9503c97"; 23 + sha256 = "1pchwizx1sdli59g8r0p4djfjkchcvh8msfpp3ibvz3xl250jh0n"; 24 + }; 2 25 26 + in 3 27 stdenv.mkDerivation rec { 4 28 name = "perkeep-${version}"; 5 29 version = "20170505"; ··· 9 33 sha256 = "1vliyvkyzmhdi6knbh8rdsswmz3h0rpxdpq037jwbdbkjccxjdwa"; 10 34 }; 11 35 12 - buildInputs = [ git go_1_8 ]; 36 + # When perkeep is updated postPatch should be removed 37 + postPatch = '' 38 + rm -r ./vendor/github.com/gopherjs/gopherjs/ 39 + cp -a ${gopherjs} ./vendor/github.com/gopherjs/gopherjs 40 + mkdir -p ./vendor/github.com/kisielk/ 41 + cp -a ${gotool} ./vendor/github.com/kisielk/gotool 42 + mkdir -p ./vendor/golang.org/x/tools/go 43 + cp -a ${gcimporter15}/go/gcimporter15 ./vendor/golang.org/x/tools/go/gcimporter15 44 + 45 + substituteInPlace vendor/github.com/gopherjs/gopherjs/build/build.go \ 46 + --replace '"github.com/fsnotify/fsnotify"' 'fsnotify "camlistore.org/pkg/misc/fakefsnotify"' 47 + 48 + substituteInPlace ./make.go \ 49 + --replace "goVersionMinor = '8'" "goVersionMinor = '9'" \ 50 + --replace "gopherJSGoMinor = '8'" "gopherJSGoMinor = '9'" 51 + ''; 52 + 53 + buildInputs = [ git go ]; 13 54 14 55 goPackagePath = ""; 15 56 buildPhase = ''
-182
pkgs/development/compilers/go/1.8.nix
··· 1 - { stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin 2 - , perl, which, pkgconfig, patch, procps 3 - , pcre, cacert, llvm 4 - , Security, Foundation, bash 5 - , makeWrapper, git, subversion, mercurial, bazaar }: 6 - 7 - let 8 - 9 - inherit (stdenv.lib) optional optionals optionalString; 10 - 11 - clangHack = writeScriptBin "clang" '' 12 - #!${stdenv.shell} 13 - exec ${stdenv.cc}/bin/clang "$@" 2> >(sed '/ld: warning:.*ignoring unexpected dylib file/ d' 1>&2) 14 - ''; 15 - 16 - goBootstrap = runCommand "go-bootstrap" {} '' 17 - mkdir $out 18 - cp -rf ${go_bootstrap}/* $out/ 19 - chmod -R u+w $out 20 - find $out -name "*.c" -delete 21 - cp -rf $out/bin/* $out/share/go/bin/ 22 - ''; 23 - 24 - in 25 - 26 - stdenv.mkDerivation rec { 27 - name = "go-${version}"; 28 - version = "1.8.7"; 29 - 30 - src = fetchFromGitHub { 31 - owner = "golang"; 32 - repo = "go"; 33 - rev = "go${version}"; 34 - sha256 = "06v83fb75079dy2dc1927sr9bwvcpkkzl9d4wcw10scj70vj4a0x"; 35 - }; 36 - 37 - # perl is used for testing go vet 38 - nativeBuildInputs = [ perl which pkgconfig patch makeWrapper ] 39 - ++ optionals stdenv.isLinux [ procps ]; 40 - buildInputs = [ cacert pcre ] 41 - ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ] 42 - ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ]; 43 - propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ]; 44 - 45 - hardeningDisable = [ "all" ]; 46 - 47 - prePatch = '' 48 - patchShebangs ./ # replace /bin/bash 49 - 50 - # This source produces shell script at run time, 51 - # and thus it is not corrected by patchShebangs. 52 - substituteInPlace misc/cgo/testcarchive/carchive_test.go \ 53 - --replace '#!/usr/bin/env bash' '#!${stdenv.shell}' 54 - 55 - # Disabling the 'os/http/net' tests (they want files not available in 56 - # chroot builds) 57 - rm src/net/{listen,parse}_test.go 58 - rm src/syscall/exec_linux_test.go 59 - 60 - # !!! substituteInPlace does not seems to be effective. 61 - # The os test wants to read files in an existing path. Just don't let it be /usr/bin. 62 - sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go 63 - sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go 64 - # Disable the unix socket test 65 - sed -i '/TestShutdownUnix/areturn' src/net/net_test.go 66 - # Disable the hostname test 67 - sed -i '/TestHostname/areturn' src/os/os_test.go 68 - # ParseInLocation fails the test 69 - sed -i '/TestParseInSydney/areturn' src/time/format_test.go 70 - # Remove the api check as it never worked 71 - sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go 72 - # Remove the coverage test as we have removed this utility 73 - sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go 74 - # Remove the timezone naming test 75 - sed -i '/TestLoadFixed/areturn' src/time/time_test.go 76 - 77 - sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go 78 - sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go 79 - 80 - # Disable cgo lookup tests not works, they depend on resolver 81 - rm src/net/cgo_unix_test.go 82 - 83 - '' + optionalString stdenv.isLinux '' 84 - sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go 85 - '' + optionalString stdenv.isArm '' 86 - sed -i '/TestCurrent/areturn' src/os/user/user_test.go 87 - echo '#!${stdenv.shell}' > misc/cgo/testplugin/test.bash 88 - '' + optionalString stdenv.isDarwin '' 89 - substituteInPlace src/race.bash --replace \ 90 - "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true 91 - sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go 92 - sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go 93 - sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go 94 - 95 - sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go 96 - sed -i '/TestRead0/areturn' src/os/os_test.go 97 - sed -i '/TestNohup/areturn' src/os/signal/signal_test.go 98 - sed -i '/TestCurrent/areturn' src/os/user/user_test.go 99 - sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go 100 - 101 - sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go 102 - sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go 103 - 104 - sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go 105 - 106 - sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go 107 - sed -i 's/unrecognized/unknown/' src/cmd/go/build.go 108 - 109 - touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd 110 - 111 - sed -i '1 a\exit 0' misc/cgo/errors/test.bash 112 - ''; 113 - 114 - patches = 115 - [ ./remove-tools-1.8.patch 116 - ./ssl-cert-file.patch 117 - ./creds-test.patch 118 - ./remove-test-pie-1.8.patch 119 - ]; 120 - 121 - postPatch = optionalString stdenv.isDarwin '' 122 - echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil" 123 - substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil 124 - ''; 125 - 126 - GOOS = if stdenv.isDarwin then "darwin" else "linux"; 127 - GOARCH = if stdenv.isDarwin then "amd64" 128 - else if stdenv.system == "i686-linux" then "386" 129 - else if stdenv.system == "x86_64-linux" then "amd64" 130 - else if stdenv.isArm then "arm" 131 - else if stdenv.isAarch64 then "arm64" 132 - else throw "Unsupported system"; 133 - GOARM = optionalString (stdenv.system == "armv5tel-linux") "5"; 134 - GO386 = 387; # from Arch: don't assume sse2 on i686 135 - CGO_ENABLED = 1; 136 - GOROOT_BOOTSTRAP = "${goBootstrap}/share/go"; 137 - 138 - # Hopefully avoids test timeouts on Hydra 139 - GO_TEST_TIMEOUT_SCALE = 3; 140 - 141 - # The go build actually checks for CC=*/clang and does something different, so we don't 142 - # just want the generic `cc` here. 143 - CC = if stdenv.isDarwin then "clang" else "cc"; 144 - 145 - configurePhase = '' 146 - mkdir -p $out/share/go/bin 147 - export GOROOT=$out/share/go 148 - export GOBIN=$GOROOT/bin 149 - export PATH=$GOBIN:$PATH 150 - ulimit -a 151 - ''; 152 - 153 - postConfigure = optionalString stdenv.isDarwin '' 154 - export PATH=${clangHack}/bin:$PATH 155 - ''; 156 - 157 - installPhase = '' 158 - cp -r . $GOROOT 159 - ( cd $GOROOT/src && ./all.bash ) 160 - 161 - # (https://github.com/golang/go/wiki/GoGetTools) 162 - wrapProgram $out/share/go/bin/go --prefix PATH ":" "${stdenv.lib.makeBinPath [ git subversion mercurial bazaar ]}" 163 - ''; 164 - 165 - preFixup = '' 166 - rm -r $out/share/go/pkg/bootstrap 167 - ln -s $out/share/go/bin $out/bin 168 - ''; 169 - 170 - setupHook = ./setup-hook.sh; 171 - 172 - disallowedReferences = [ go_bootstrap ]; 173 - 174 - meta = with stdenv.lib; { 175 - branch = "1.8"; 176 - homepage = http://golang.org/; 177 - description = "The Go Programming language"; 178 - license = licenses.bsd3; 179 - maintainers = with maintainers; [ cstrahan wkennington ]; 180 - platforms = platforms.linux ++ platforms.darwin; 181 - }; 182 - }
-23
pkgs/development/compilers/go/remove-test-pie-1.8.patch
··· 1 - diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go 2 - index c51dcea..8fbec5e 100644 3 - --- a/src/cmd/dist/test.go 4 - +++ b/src/cmd/dist/test.go 5 - @@ -461,17 +461,5 @@ func (t *tester) registerTests() { 6 - }) 7 - } 8 - 9 - - // Test internal linking of PIE binaries where it is supported. 10 - - if t.goos == "linux" && t.goarch == "amd64" { 11 - - t.tests = append(t.tests, distTest{ 12 - - name: "pie_internal", 13 - - heading: "internal linking of -buildmode=pie", 14 - - fn: func(dt *distTest) error { 15 - - t.addCmd(dt, "src", "go", "test", "reflect", "-short", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60), t.tags(), t.runFlag("")) 16 - - return nil 17 - - }, 18 - - }) 19 - - } 20 - - 21 - // sync tests 22 - t.tests = append(t.tests, distTest{ 23 - name: "sync_cpu",
-35
pkgs/development/compilers/go/remove-tools-1.8.patch
··· 1 - diff --git a/src/go/build/build.go b/src/go/build/build.go 2 - index 9706b8b..f250751 100644 3 - --- a/src/go/build/build.go 4 - +++ b/src/go/build/build.go 5 - @@ -1513,7 +1513,7 @@ func init() { 6 - } 7 - 8 - // ToolDir is the directory containing build tools. 9 - -var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) 10 - +var ToolDir = runtime.GOTOOLDIR() 11 - 12 - // IsLocalImport reports whether the import path is 13 - // a local import path, like ".", "..", "./foo", or "../foo". 14 - diff --git a/src/runtime/extern.go b/src/runtime/extern.go 15 - index 441dcd9..a50277e 100644 16 - --- a/src/runtime/extern.go 17 - +++ b/src/runtime/extern.go 18 - @@ -230,6 +230,17 @@ func GOROOT() string { 19 - return sys.DefaultGoroot 20 - } 21 - 22 - +// GOTOOLDIR returns the root of the Go tree. 23 - +// It uses the GOTOOLDIR environment variable, if set, 24 - +// or else the root used during the Go build. 25 - +func GOTOOLDIR() string { 26 - + s := gogetenv("GOTOOLDIR") 27 - + if s != "" { 28 - + return s 29 - + } 30 - + return GOROOT() + "/pkg/tool/" + GOOS + "_" + GOARCH 31 - +} 32 - + 33 - // Version returns the Go tree's version string. 34 - // It is either the commit hash and date at the time of the build or, 35 - // when possible, a release tag like "go1.3".
-80
pkgs/development/compilers/go/ssl-cert-file.patch
··· 1 - diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go 2 - index a4b33c7..9700b75 100644 3 - --- a/src/crypto/x509/root_cgo_darwin.go 4 - +++ b/src/crypto/x509/root_cgo_darwin.go 5 - @@ -151,11 +151,20 @@ int FetchPEMRoots(CFDataRef *pemRoots) { 6 - import "C" 7 - import ( 8 - "errors" 9 - + "io/ioutil" 10 - + "os" 11 - "unsafe" 12 - ) 13 - 14 - func loadSystemRoots() (*CertPool, error) { 15 - roots := NewCertPool() 16 - + if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { 17 - + data, err := ioutil.ReadFile(file) 18 - + if err == nil { 19 - + roots.AppendCertsFromPEM(data) 20 - + return roots, nil 21 - + } 22 - + } 23 - 24 - var data C.CFDataRef = nil 25 - err := C.FetchPEMRoots(&data) 26 - diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go 27 - index 66cdb5e..bb28036 100644 28 - --- a/src/crypto/x509/root_darwin.go 29 - +++ b/src/crypto/x509/root_darwin.go 30 - @@ -61,17 +61,25 @@ func execSecurityRoots() (*CertPool, error) { 31 - println(fmt.Sprintf("crypto/x509: %d certs have a trust policy", len(hasPolicy))) 32 - } 33 - 34 - - cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain") 35 - - data, err := cmd.Output() 36 - - if err != nil { 37 - - return nil, err 38 - - } 39 - - 40 - var ( 41 - mu sync.Mutex 42 - roots = NewCertPool() 43 - numVerified int // number of execs of 'security verify-cert', for debug stats 44 - ) 45 - 46 - + if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { 47 - + data, err := ioutil.ReadFile(file) 48 - + if err == nil { 49 - + roots.AppendCertsFromPEM(data) 50 - + return roots, nil 51 - + } 52 - + } 53 - + 54 - + cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain") 55 - + data, err := cmd.Output() 56 - + if err != nil { 57 - + return nil, err 58 - + } 59 - + 60 - blockCh := make(chan *pem.Block) 61 - var wg sync.WaitGroup 62 - diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go 63 - index 7bcb3d6..3986e1a 100644 64 - --- a/src/crypto/x509/root_unix.go 65 - +++ b/src/crypto/x509/root_unix.go 66 - @@ -24,6 +24,14 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate 67 - 68 - func loadSystemRoots() (*CertPool, error) { 69 - roots := NewCertPool() 70 - + if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { 71 - + data, err := ioutil.ReadFile(file) 72 - + if err == nil { 73 - + roots.AppendCertsFromPEM(data) 74 - + return roots, nil 75 - + } 76 - + } 77 - + 78 - var firstErr error 79 - for _, file := range certFiles { 80 - data, err := ioutil.ReadFile(file)
+2 -2
pkgs/servers/sql/cockroachdb/default.nix
··· 2 2 3 3 buildGoPackage rec { 4 4 name = "cockroach-${version}"; 5 - version = "1.1.2"; 5 + version = "1.1.5"; 6 6 7 7 goPackagePath = "github.com/cockroachdb/cockroach"; 8 8 9 9 src = fetchurl { 10 10 url = "https://binaries.cockroachdb.com/cockroach-v${version}.src.tgz"; 11 - sha256 = "0h1fijzihp85a18flq4brdc3b38gj867kfkp31gncnmff0xb8kam"; 11 + sha256 = "0i2lg60424i1yg9dhapfsy3majnlbad2wlf93d9l161jf5lp9a2d"; 12 12 }; 13 13 14 14 nativeBuildInputs = [ cmake xz which autoconf ];
+5 -13
pkgs/top-level/all-packages.nix
··· 6206 6206 inherit (darwin.apple_sdk.frameworks) Security; 6207 6207 }; 6208 6208 6209 - go_1_8 = callPackage ../development/compilers/go/1.8.nix { 6210 - inherit (darwin.apple_sdk.frameworks) Security Foundation; 6211 - }; 6212 - 6213 6209 go_1_9 = callPackage ../development/compilers/go/1.9.nix { 6214 6210 inherit (darwin.apple_sdk.frameworks) Security Foundation; 6215 6211 }; ··· 11857 11853 11858 11854 ### DEVELOPMENT / GO MODULES 11859 11855 11860 - buildGo18Package = callPackage ../development/go-modules/generic { 11861 - go = go_1_8; 11862 - }; 11863 - 11864 11856 buildGo19Package = callPackage ../development/go-modules/generic { 11865 11857 go = go_1_9; 11866 11858 }; ··· 12786 12778 12787 12779 cifs-utils = callPackage ../os-specific/linux/cifs-utils { }; 12788 12780 12789 - cockroachdb = callPackage ../servers/sql/cockroachdb { 12790 - # Go 1.9 build fails with "go1.8.* required (see CONTRIBUTING.md)". 12791 - buildGoPackage = buildGo18Package; 12792 - }; 12781 + cockroachdb = callPackage ../servers/sql/cockroachdb { }; 12793 12782 12794 12783 conky = callPackage ../os-specific/linux/conky ({ 12795 12784 lua = lua5_1; # conky can use 5.2, but toluapp can not ··· 14694 14683 openjpeg = openjpeg_1; 14695 14684 }; 14696 14685 14697 - perkeep = callPackage ../applications/misc/perkeep { }; 14686 + perkeep = callPackage ../applications/misc/perkeep { 14687 + # Perkeep is very particular about which go version to build with. 14688 + go = go_1_9; 14689 + }; 14698 14690 14699 14691 canto-curses = callPackage ../applications/networking/feedreaders/canto-curses { }; 14700 14692