From 4007ceb6afa4bee457d7248ffcbb19740d2ecd78 Mon Sep 17 00:00:00 2001 From: Colin <486199+c00w@users.noreply.github.com> Date: Tue, 28 Apr 2020 20:16:20 -0400 Subject: [PATCH] treewide get rid of go 1.12 (#83253) * treewide Drop unneeded go 1.12 overrides * Fix packr to be go module compatible. I updated to version 2.8.0 which is the latest on master. Then due to the 2 different sets of go modules which are used, I split the build into two different derivations, then merged them togethor using symlinkJoin to have the same output structure as the existing derivation. * Remove consul dependency on go1.12 I updated the consul version to 1.7.2 and flipped it to building using modules. * Remove go1.12 from perkeep. Update the version to the latest unstable on master. * Update scaleway-cli to not be pinned to go1.12 Switched the version to 1.20 * Update prometheus-varnish-exporter to not depend on go1.12 * Update lnd to build with go1.12 Updated the version Forced only building subpackages with main to prevent panics over multiple modules in one repo * Remove go1.12 from openshift Had to update the version to 4.1.0 and do a bit of munging to get this to work * Remove go1.12 completely. These are no longer needed. * Update bazel-watcher and make it build with go 1.14 --- pkgs/applications/blockchains/lnd.nix | 8 +- pkgs/applications/misc/perkeep/default.nix | 6 +- .../networking/cluster/openshift/default.nix | 23 +- pkgs/development/compilers/go/1.12.nix | 247 ------------------ .../compilers/go/remove-test-pie.patch | 24 -- .../compilers/go/ssl-cert-file-1.12.1.patch | 59 ----- pkgs/development/libraries/packr/default.nix | 43 ++- .../tools/bazel-watcher/default.nix | 24 +- pkgs/servers/consul/default.nix | 30 ++- .../prometheus/varnish-exporter.nix | 8 +- pkgs/tools/admin/scaleway-cli/default.nix | 4 +- pkgs/top-level/aliases.nix | 3 + pkgs/top-level/all-packages.nix | 95 ++----- 13 files changed, 104 insertions(+), 470 deletions(-) delete mode 100644 pkgs/development/compilers/go/1.12.nix delete mode 100644 pkgs/development/compilers/go/remove-test-pie.patch delete mode 100644 pkgs/development/compilers/go/ssl-cert-file-1.12.1.patch diff --git a/pkgs/applications/blockchains/lnd.nix b/pkgs/applications/blockchains/lnd.nix index dd45746c8df5..0aa087e20afc 100644 --- a/pkgs/applications/blockchains/lnd.nix +++ b/pkgs/applications/blockchains/lnd.nix @@ -2,16 +2,18 @@ buildGoModule rec { pname = "lnd"; - version = "0.9.0-beta"; + version = "0.9.2-beta"; src = fetchFromGitHub { owner = "lightningnetwork"; repo = "lnd"; rev = "v${version}"; - sha256 = "1hq105s9ykp6nsn4iicjnl3mwspqkbfsswkx7sgzv3jggg08fkq9"; + sha256 = "0gm33z89fiqv231ks2mkpsblskcsijipq8fcmip6m6jy8g06b1gb"; }; - modSha256 = "1pvcvpiz6ck8xkgpypchrq9kgkik0jxd7f3jhihbgldsh4zaqiaq"; + modSha256 = "1khxplvyaqgaddrx1nna1fw0nb1xz9bmqpxpfifif4f5nmx90gbr"; + + subPackages = ["cmd/lncli" "cmd/lnd"]; meta = with lib; { description = "Lightning Network Daemon"; diff --git a/pkgs/applications/misc/perkeep/default.nix b/pkgs/applications/misc/perkeep/default.nix index 87a6bdf5e53d..5a1e5ba65ded 100644 --- a/pkgs/applications/misc/perkeep/default.nix +++ b/pkgs/applications/misc/perkeep/default.nix @@ -13,13 +13,13 @@ let in buildGoPackage rec { name = "perkeep-${version}"; - version = "unstable-2019-07-29"; + version = "unstable-2020-03-23"; src = fetchFromGitHub { owner = "perkeep"; repo = "perkeep"; - rev = "c9f78d02adf9740f3b8d403a1418554293cc9f41"; - sha256 = "11rin94pjzg0kvizrq9ss42fjw7wfwx3g1pk8zdlhyfkiwwh2rmg"; + rev = "c2e31370ddefd86b6112a5d891100ea3382a4254"; + sha256 = "0jf02k20ms7h60wglcq6dj3vqi9rlfww7db5iplgwznbij70c1i4"; }; goPackagePath = "perkeep.org"; diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index bcd259b138f7..19272c37ee8f 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, buildGoPackage, which, go-bindata, rsync, utillinux -, coreutils, kerberos, clang, installShellFiles +, coreutils, kerberos, ncurses, clang, installShellFiles , components ? [ "cmd/oc" "cmd/openshift" @@ -9,12 +9,12 @@ with lib; let - version = "3.11.0"; + version = "4.1.0"; ver = stdenv.lib.elemAt (stdenv.lib.splitVersion version); versionMajor = ver 0; versionMinor = ver 1; versionPatch = ver 2; - gitCommit = "0cbc58b"; + gitCommit = "b4261e0"; # version is in vendor/k8s.io/kubernetes/pkg/version/base.go k8sversion = "v1.11.1"; k8sgitcommit = "b1b2997"; @@ -28,29 +28,17 @@ in buildGoPackage rec { owner = "openshift"; repo = "origin"; rev = "v${version}"; - sha256 = "06q4v2a1mm6c659ab0rzkqz6b66vx4avqfg0s9xckwhq420lzgka"; + sha256 = "16bc6ljm418kxz92gz8ldm82491mvlqamrvigyr6ff72rf7ml7ba"; }; goPackagePath = "github.com/openshift/origin"; - buildInputs = [ kerberos ]; + buildInputs = [ kerberos ncurses ]; nativeBuildInputs = [ which rsync go-bindata clang installShellFiles ]; patchPhase = '' patchShebangs ./hack - - substituteInPlace pkg/oc/clusterup/docker/host/host.go \ - --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt findmnt' \ - 'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/findmnt' - - substituteInPlace pkg/oc/clusterup/docker/host/host.go \ - --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mount' \ - 'nsenter --mount=/rootfs/proc/1/ns/mnt ${utillinux}/bin/mount' - - substituteInPlace pkg/oc/clusterup/docker/host/host.go \ - --replace 'nsenter --mount=/rootfs/proc/1/ns/mnt mkdir' \ - 'nsenter --mount=/rootfs/proc/1/ns/mnt ${coreutils}/bin/mkdir' ''; buildPhase = '' @@ -58,6 +46,7 @@ in buildGoPackage rec { # Openshift build require this variables to be set # unless there is a .git folder which is not the case with fetchFromGitHub echo "OS_GIT_VERSION=v${version}" >> os-version-defs + echo "OS_GIT_TREE_STATE=clean" >> os-version-defs echo "OS_GIT_MAJOR=${versionMajor}" >> os-version-defs echo "OS_GIT_MINOR=${versionMinor}" >> os-version-defs echo "OS_GIT_PATCH=${versionPatch}" >> os-version-defs diff --git a/pkgs/development/compilers/go/1.12.nix b/pkgs/development/compilers/go/1.12.nix deleted file mode 100644 index 65e97d4e929e..000000000000 --- a/pkgs/development/compilers/go/1.12.nix +++ /dev/null @@ -1,247 +0,0 @@ -{ stdenv, fetchurl, tzdata, iana-etc, runCommand -, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation -, mailcap, runtimeShell -, buildPackages, pkgsTargetTarget -}: - -let - - inherit (stdenv.lib) optionals optionalString; - - goBootstrap = runCommand "go-bootstrap" {} '' - mkdir $out - cp -rf ${buildPackages.go_bootstrap}/* $out/ - chmod -R u+w $out - find $out -name "*.c" -delete - cp -rf $out/bin/* $out/share/go/bin/ - ''; - - goarch = platform: { - i686 = "386"; - x86_64 = "amd64"; - aarch64 = "arm64"; - arm = "arm"; - armv5tel = "arm"; - armv6l = "arm"; - armv7l = "arm"; - }.${platform.parsed.cpu.name} or (throw "Unsupported system"); - -in - -stdenv.mkDerivation rec { - pname = "go"; - version = "1.12.17"; - - src = fetchurl { - url = "https://dl.google.com/go/go${version}.src.tar.gz"; - sha256 = "09cbl90maxry713wd18jdqrms3ivbvcm472csnxc78rsqhc851yy"; - }; - - # perl is used for testing go vet - nativeBuildInputs = [ perl which pkgconfig patch procps ]; - buildInputs = [ cacert pcre ] - ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ] - ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ]; - - depsTargetTargetPropagated = optionals stdenv.isDarwin [ Security Foundation ]; - - hardeningDisable = [ "all" ]; - - prePatch = '' - patchShebangs ./ # replace /bin/bash - - # This source produces shell script at run time, - # and thus it is not corrected by patchShebangs. - substituteInPlace misc/cgo/testcarchive/carchive_test.go \ - --replace '#!/usr/bin/env bash' '#!${runtimeShell}' - - # Patch the mimetype database location which is missing on NixOS. - substituteInPlace src/mime/type_unix.go \ - --replace '/etc/mime.types' '${mailcap}/etc/mime.types' - - # Disabling the 'os/http/net' tests (they want files not available in - # chroot builds) - rm src/net/{listen,parse}_test.go - rm src/syscall/exec_linux_test.go - - # !!! substituteInPlace does not seems to be effective. - # The os test wants to read files in an existing path. Just don't let it be /usr/bin. - sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go - sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go - # Disable the unix socket test - sed -i '/TestShutdownUnix/areturn' src/net/net_test.go - # Disable the hostname test - sed -i '/TestHostname/areturn' src/os/os_test.go - # ParseInLocation fails the test - sed -i '/TestParseInSydney/areturn' src/time/format_test.go - # Remove the api check as it never worked - sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go - # Remove the coverage test as we have removed this utility - sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go - # Remove the timezone naming test - sed -i '/TestLoadFixed/areturn' src/time/time_test.go - # Remove disable setgid test - sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go - # Remove cert tests that conflict with NixOS's cert resolution - sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go - # TestWritevError hangs sometimes - sed -i '/TestWritevError/areturn' src/net/writev_test.go - # TestVariousDeadlines fails sometimes - sed -i '/TestVariousDeadlines/areturn' src/net/timeout_test.go - - sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go - sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go - - # Disable cgo lookup tests not works, they depend on resolver - rm src/net/cgo_unix_test.go - - # Disable TestGcSys because it's flakey in our tests, but the failure is not - # reproducible by multiple people in other environments. - # See https://github.com/NixOS/nixpkgs/issues/68361#issuecomment-537849272 and following - # NOTE: Try re-enabling for releases newer than 1.12.9 - sed -i '/TestGcSys/areturn' src/runtime/gc_test.go - - '' + optionalString stdenv.isLinux '' - sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go - '' + optionalString stdenv.isAarch32 '' - echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash - '' + 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 '/TestChdirAndGetwd/areturn' src/os/os_test.go - sed -i '/TestCredentialNoSetGroups/areturn' src/os/exec/exec_posix_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 - - sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go - - # TestCurrent fails because Current is not implemented on Darwin - sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go - sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go - - touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd - ''; - - patches = [ - ./remove-tools-1.11.patch - ./ssl-cert-file-1.12.1.patch - ./remove-test-pie.patch - ./creds-test.patch - ./go-1.9-skip-flaky-19608.patch - ./go-1.9-skip-flaky-20072.patch - ./skip-external-network-tests.patch - ./skip-nohup-tests.patch - ] ++ [ - # breaks under load: https://github.com/golang/go/issues/25628 - (if stdenv.isAarch32 - then ./skip-test-extra-files-on-aarch32.patch - else ./skip-test-extra-files-on-386.patch) - ]; - - postPatch = '' - find . -name '*.orig' -exec rm {} ';' - ''; - - GOOS = stdenv.targetPlatform.parsed.kernel.name; - GOARCH = goarch stdenv.targetPlatform; - # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. - # Go will nevertheless build a for host system that we will copy over in - # the install phase. - GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name; - GOHOSTARCH = goarch stdenv.buildPlatform; - - # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those - # to be different from CC/CXX - CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" - else - null; - CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then - "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++" - else - null; - - GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - GO386 = 387; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; - # Hopefully avoids test timeouts on Hydra - GO_TEST_TIMEOUT_SCALE = 3; - - # Indicate that we are running on build infrastructure - # Some tests assume things like home directories and users exists - GO_BUILDER_NAME = "nix"; - - GOROOT_BOOTSTRAP="${goBootstrap}/share/go"; - - postConfigure = '' - export GOCACHE=$TMPDIR/go-cache - # this is compiled into the binary - export GOROOT_FINAL=$out/share/go - - export PATH=$(pwd)/bin:$PATH - - # Independent from host/target, CC should produce code for the building system. - export CC=${buildPackages.stdenv.cc}/bin/cc - ulimit -a - ''; - - postBuild = '' - (cd src && ./make.bash) - ''; - - doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin; - - checkPhase = '' - runHook preCheck - (cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild) - runHook postCheck - ''; - - preInstall = '' - rm -r pkg/{bootstrap,obj} - # Contains the wrong perl shebang when cross compiling, - # since it is not used for anything we can deleted as well. - rm src/regexp/syntax/make_perl_groups.pl - '' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then '' - mv bin/*_*/* bin - rmdir bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH} - ''} - '' else if (stdenv.hostPlatform != stdenv.targetPlatform) then '' - rm -rf bin/*_* - ${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) '' - rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH} - ''} - '' else ""); - - installPhase = '' - runHook preInstall - mkdir -p $GOROOT_FINAL - cp -a bin pkg src lib misc api doc $GOROOT_FINAL - ln -s $GOROOT_FINAL/bin $out/bin - runHook postInstall - ''; - - setupHook = ./setup-hook.sh; - - disallowedReferences = [ goBootstrap ]; - - meta = with stdenv.lib; { - branch = "1.12"; - homepage = "http://golang.org/"; - description = "The Go Programming language"; - license = licenses.bsd3; - maintainers = with maintainers; [ cstrahan orivej mic92 rvolosatovs Frostman ]; - platforms = platforms.linux ++ platforms.darwin; - }; -} diff --git a/pkgs/development/compilers/go/remove-test-pie.patch b/pkgs/development/compilers/go/remove-test-pie.patch deleted file mode 100644 index fb8e116af76f..000000000000 --- a/pkgs/development/compilers/go/remove-test-pie.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- source.org/src/cmd/dist/test.go 2018-02-22 10:40:40.089632339 +0000 -+++ source/src/cmd/dist/test.go 2018-02-22 10:56:53.075193788 +0000 -@@ -526,21 +526,6 @@ - }) - } - -- // Test internal linking of PIE binaries where it is supported. -- if goos == "linux" && goarch == "amd64" && !isAlpineLinux() { -- // Issue 18243: We don't have a way to set the default -- // dynamic linker used in internal linking mode. So -- // this test is skipped on Alpine. -- t.tests = append(t.tests, distTest{ -- name: "pie_internal", -- heading: "internal linking of -buildmode=pie", -- fn: func(dt *distTest) error { -- t.addCmd(dt, "src", t.goTest(), "reflect", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60)) -- return nil -- }, -- }) -- } -- - // sync tests - t.tests = append(t.tests, distTest{ - name: "sync_cpu", diff --git a/pkgs/development/compilers/go/ssl-cert-file-1.12.1.patch b/pkgs/development/compilers/go/ssl-cert-file-1.12.1.patch deleted file mode 100644 index aa3116d76c12..000000000000 --- a/pkgs/development/compilers/go/ssl-cert-file-1.12.1.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -Naur a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go ---- a/src/crypto/x509/root_cgo_darwin.go 2019-03-15 11:33:55.920232337 -0700 -+++ b/src/crypto/x509/root_cgo_darwin.go 2019-03-15 11:34:53.323180897 -0700 -@@ -270,11 +270,20 @@ - import "C" - import ( - "errors" -+ "io/ioutil" -+ "os" - "unsafe" - ) - - func loadSystemRoots() (*CertPool, error) { - roots := NewCertPool() -+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { -+ data, err := ioutil.ReadFile(file) -+ if err == nil { -+ roots.AppendCertsFromPEM(data) -+ return roots, nil -+ } -+ } - - var data C.CFDataRef = 0 - var untrustedData C.CFDataRef = 0 -diff -Naur a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go ---- a/src/crypto/x509/root_darwin.go 2019-03-15 11:33:55.920232337 -0700 -+++ b/src/crypto/x509/root_darwin.go 2019-03-15 11:36:21.205123541 -0700 -@@ -92,6 +92,14 @@ - verifyCh = make(chan rootCandidate) - ) - -+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { -+ data, err := ioutil.ReadFile(file) -+ if err == nil { -+ roots.AppendCertsFromPEM(data) -+ return roots, nil -+ } -+ } -+ - // Using 4 goroutines to pipe into verify-cert seems to be - // about the best we can do. The verify-cert binary seems to - // just RPC to another server with coarse locking anyway, so -diff -Naur a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go ---- a/src/crypto/x509/root_unix.go 2019-03-15 11:33:55.920232337 -0700 -+++ b/src/crypto/x509/root_unix.go 2019-03-15 11:37:15.737326340 -0700 -@@ -38,6 +38,13 @@ - - func loadSystemRoots() (*CertPool, error) { - roots := NewCertPool() -+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { -+ data, err := ioutil.ReadFile(file) -+ if err == nil { -+ roots.AppendCertsFromPEM(data) -+ return roots, nil -+ } -+ } - - files := certFiles - if f := os.Getenv(certFileEnv); f != "" { diff --git a/pkgs/development/libraries/packr/default.nix b/pkgs/development/libraries/packr/default.nix index 4482a9cd312d..6a53743a10ea 100644 --- a/pkgs/development/libraries/packr/default.nix +++ b/pkgs/development/libraries/packr/default.nix @@ -1,22 +1,46 @@ { buildGoModule , fetchFromGitHub , lib +, stdenv +, symlinkJoin }: -buildGoModule rec { - pname = "packr"; - version = "2.7.1"; +let p2 = buildGoModule rec { + pname = "packr2"; + version = "2.8.0"; src = fetchFromGitHub { owner = "gobuffalo"; - repo = pname; + repo = "packr"; rev = "v${version}"; - sha256 = "0m5kl2fq8gf1v4vllgag2xl8fd382sdgqrcdb8f5alsnrdn08kb9"; + sha256 = "1x78yq2yg0r82h7a67078llni85gk9nbd2ismlbqgppap7fcpyai"; + }+"/v2"; + + subPackages = [ "packr2" ]; + + modSha256 = "1xxqyn78074jna0iri7sks6b2l4sdnn5sg57n09vrrf6kh39h2y9"; + + meta = with stdenv.lib; { + description = "The simple and easy way to embed static files into Go binaries"; + homepage = "https://github.com/gobuffalo/packr"; + license = licenses.mit; + maintainers = with maintainers; [ mmahut ]; + }; +}; +p1 = buildGoModule rec { + pname = "packr1"; + version = "2.8.0"; + + src = fetchFromGitHub { + owner = "gobuffalo"; + repo = "packr"; + rev = "v${version}"; + sha256 = "1x78yq2yg0r82h7a67078llni85gk9nbd2ismlbqgppap7fcpyai"; }; - subPackages = [ "packr" "v2/packr2" ]; + subPackages = [ "packr" ]; - modSha256 = "0afhkvivma16bi8rz3kwcsz9mhmcn4zm6rrymxkvazx6b844hcdv"; + modSha256 = "045qfdi82yhpghjd0cimxhas4nkj7g30n9qyvkrl9ck01sahx76f"; meta = with lib; { description = "The simple and easy way to embed static files into Go binaries"; @@ -24,4 +48,9 @@ buildGoModule rec { license = licenses.mit; maintainers = with maintainers; [ mmahut ]; }; +}; +in +symlinkJoin{ + name = "packr"; + paths = [p1 p2]; } diff --git a/pkgs/development/tools/bazel-watcher/default.nix b/pkgs/development/tools/bazel-watcher/default.nix index 27c72b351e73..9cdd72eeaaf4 100644 --- a/pkgs/development/tools/bazel-watcher/default.nix +++ b/pkgs/development/tools/bazel-watcher/default.nix @@ -5,35 +5,29 @@ , go , python , stdenv +, iana-etc +, mailcap +, tzdata }: let patches = [ ./use-go-in-path.patch - - # update rules_go to fix the build. Remove these when updating past 0.10.3 - (fetchpatch { - url = "https://github.com/bazelbuild/bazel-watcher/commit/686130f50cea274f7453f6abc8c5249654047462.patch"; - sha256 = "0rzs01sfiinl5d3dq9sx1bhl8kkzppdwh964fr7bzafqcxv5llmb"; - }) - (fetchpatch { - url = "https://github.com/bazelbuild/bazel-watcher/commit/18bdb44832ccc533e0ab3923ef80060eeb24582d.patch"; - sha256 = "0k5hvlxlg4n092d53cbfxqqhzc6f1jv4licdhhi1dhckkhb4sdk6"; - }) ]; in buildBazelPackage rec { name = "bazel-watcher-${version}"; - version = "0.10.3"; + version = "0.13.0"; src = fetchFromGitHub { owner = "bazelbuild"; repo = "bazel-watcher"; rev = "v${version}"; - sha256 = "17z4nqqsdrainbh8fmhf6sgrxwf7aknadmn94z1yqpxa7kb9x33v"; + sha256 = "1fc3sp79znbbq1yjap56lham72n7cap8yfghpzrzmpl5brybjkvm"; }; nativeBuildInputs = [ go git python ]; + removeRulesCC = false; bazelTarget = "//ibazel"; @@ -55,6 +49,10 @@ buildBazelPackage rec { rm -rf $bazelOut/external/{go_sdk,\@go_sdk.marker} sed -e '/^FILE:@go_sdk.*/d' -i $bazelOut/external/\@*.marker + # Retains go build input markers + chmod -R 755 $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker} + rm -rf $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker} + # Remove the gazelle tools, they contain go binaries that are built # non-deterministically. As long as the gazelle version matches the tools # should be equivalent. @@ -62,7 +60,7 @@ buildBazelPackage rec { sed -e '/^FILE:@bazel_gazelle_go_repository_tools.*/d' -i $bazelOut/external/\@*.marker ''; - sha256 = "0cmj186n2y1g9kkdhcivmh2qvigvpnbp03m575b7hgsxi1cp3ssj"; + sha256 = "0wj573dcirssr2cmq90b4yl57mv3gsxaj1s26afvkz1dvyxmq7sz"; }; buildAttrs = { diff --git a/pkgs/servers/consul/default.nix b/pkgs/servers/consul/default.nix index 8703e76cb713..299ad0bdbcb7 100644 --- a/pkgs/servers/consul/default.nix +++ b/pkgs/servers/consul/default.nix @@ -1,19 +1,17 @@ -{ stdenv, buildGoPackage, fetchFromGitHub }: +{ stdenv, buildGoModule, fetchFromGitHub }: -buildGoPackage rec { +buildGoModule rec { pname = "consul"; version = "1.7.2"; rev = "v${version}"; - goPackagePath = "github.com/hashicorp/consul"; - - # Note: Currently only release tags are supported, because they have the Consul UI - # vendored. See - # https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834 - # If you want to use a non-release commit as `src`, you probably want to improve - # this derivation so that it can build the UI's JavaScript from source. - # See https://github.com/NixOS/nixpkgs/pull/49082 for something like that. - # Or, if you want to patch something that doesn't touch the UI, you may want + # Note: Currently only release tags are supported, because they have the Consul UI + # vendored. See + # https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834 + # If you want to use a non-release commit as `src`, you probably want to improve + # this derivation so that it can build the UI's JavaScript from source. + # See https://github.com/NixOS/nixpkgs/pull/49082 for something like that. + # Or, if you want to patch something that doesn't touch the UI, you may want # to apply your changes as patches on top of a release commit. src = fetchFromGitHub { owner = "hashicorp"; @@ -22,8 +20,14 @@ buildGoPackage rec { sha256 = "1q587d8aqfkwg4fymr56fnf038vkxbdqz5yilz96dzny27dhspj4"; }; - preBuild = '' - buildFlagsArray+=("-ldflags" "-X github.com/hashicorp/consul/version.GitDescribe=v${version} -X github.com/hashicorp/consul/version.Version=${version} -X github.com/hashicorp/consul/version.VersionPrerelease=") + # This corresponds to paths with package main - normally unneeded but consul + # has a split module structure in one repo + subPackages = ["." "connect/certgen"]; + + modSha256 = "164834gr8a7qvp72ccjpkbbg4h8idrcxvcp1fl7yi59iqsswfr7b"; + + preBuild = '' + buildFlagsArray+=("-ldflags" "-X github.com/hashicorp/consul/version.GitDescribe=v${version} -X github.com/hashicorp/consul/version.Version=${version} -X github.com/hashicorp/consul/version.VersionPrerelease=") ''; meta = with stdenv.lib; { diff --git a/pkgs/servers/monitoring/prometheus/varnish-exporter.nix b/pkgs/servers/monitoring/prometheus/varnish-exporter.nix index d77675671950..03656470b92e 100644 --- a/pkgs/servers/monitoring/prometheus/varnish-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/varnish-exporter.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "prometheus_varnish_exporter"; - version = "1.5.2"; + version = "unstable-2020-03-26"; src = fetchFromGitHub { owner = "jonnenauha"; repo = "prometheus_varnish_exporter"; - rev = version; - sha256 = "0rpabw6a6paavv62f0gzhax9brzcgkly27rhkf0ihw8736gkw8ar"; + rev = "f0f90fc69723de8b716cda16cb419e8a025130ff"; + sha256 = "1viiiyvhpr7cnf8ykaaq4fzgg9xvn4hnlhv7cagy3jkjlmz60947"; }; - modSha256 = "0w1zg9jc2466srx9pdckw7rzn7ma4pbd0617b1h98v364wjzgj72"; + modSha256 = "1vb720axjziiqcba4bdi528r6mc97ci0pfsk0ny50isrkh0s3jzz"; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/tools/admin/scaleway-cli/default.nix b/pkgs/tools/admin/scaleway-cli/default.nix index 68c20493d195..f9b608ebc4c6 100644 --- a/pkgs/tools/admin/scaleway-cli/default.nix +++ b/pkgs/tools/admin/scaleway-cli/default.nix @@ -2,7 +2,7 @@ buildGoPackage rec{ pname = "scaleway-cli"; - version = "1.17"; + version = "1.20"; goPackagePath = "github.com/scaleway/scaleway-cli"; @@ -10,7 +10,7 @@ buildGoPackage rec{ owner = "scaleway"; repo = "scaleway-cli"; rev = "v${version}"; - sha256 = "0v50wk6q8537880whi6w83dia9y934v0s2xr1z52cn3mrsjghsnd"; + sha256 = "14likzp3hl04nq9nmpmh9m5zqjyspy5cyk20dkh03c1nhkd4vcnx"; }; meta = with stdenv.lib; { diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 9d861fc538fc..7aa3ace7b5f5 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -60,6 +60,8 @@ mapAliases ({ bittorrentSync14 = throw "bittorrentSync14 has been deprecated by resilio-sync."; # added 2019-06-03 bittorrentSync20 = throw "bittorrentSync20 has been deprecated by resilio-sync."; # added 2019-06-03 buildPerlPackage = perlPackages.buildPerlPackage; # added 2018-10-12 + buildGo112Package = throw "buildGo112Package has been removed"; # added 2020-04-26 + buildGo112Module = throw "buildGo112Module has been removed"; # added 2020-04-26 bundler_HEAD = bundler; # added 2015-11-15 cantarell_fonts = cantarell-fonts; # added 2018-03-03 catfish = xfce.catfish; # added 2019-12-22 @@ -166,6 +168,7 @@ mapAliases ({ gnuradio-rds = gr-rds; # added 2019-05-27 gnuradio-osmosdr = gr-osmosdr; # added 2019-05-27 gnustep-make = gnustep.make; # added 2016-7-6 + go_1_12 = throw "go_1_12 has been removed"; # added 2020-04-26 go-pup = pup; # added 2017-12-19 gobjectIntrospection = gobject-introspection; # added 2018-12-02 goimports = gotools; # added 2018-09-16 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f23704e76e81..666927850d23 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -292,11 +292,7 @@ in packer = callPackage ../development/tools/packer { }; - packr = callPackage ../development/libraries/packr { - # Version 2.6.0 fails to build with go 1.13 due to nested modules: - # go: directory v2/packr2 is outside main module - buildGoModule = buildGo112Module; - }; + packr = callPackage ../development/libraries/packr { }; pet = callPackage ../development/tools/pet { }; @@ -1497,11 +1493,7 @@ in compactor = callPackage ../applications/networking/compactor { }; - consul = callPackage ../servers/consul { - # Version 1.6.0 fails to build with go 1.13 due to broken dependency: - # go/src/github.com/hashicorp/consul/vendor/github.com/envoyproxy/go-control-plane/envoy/type/http_status.pb.go:11:2: code in directory /build/go/src/github.com/hashicorp/consul/vendor/github.com/envoyproxy/protoc-gen-validate/validate expects import "github.com/lyft/protoc-gen-validate/validate" - buildGoPackage = buildGo112Package; - }; + consul = callPackage ../servers/consul { }; consul-alerts = callPackage ../servers/monitoring/consul-alerts { }; @@ -2772,11 +2764,7 @@ in curl_unix_socket = callPackage ../tools/networking/curl-unix-socket { }; - curlie = callPackage ../tools/networking/curlie { - # Version 1.2.0 fails to build with go 1.13 due to: - # verifying golang.org/x/crypto@v0.0.0-20180524125353-159ae71589f3: golang.org/x/crypto@v0.0.0-20180524125353-159ae71589f3: Get https://sum.golang.org/lookup/golang.org/x/crypto@v0.0.0-20180524125353-159ae71589f3: dial tcp: lookup sum.golang.org on [::1]:53: read udp [::1]:49088->[::1]:53: read: connection refused - buildGoModule = buildGo112Module; - }; + curlie = callPackage ../tools/networking/curlie { }; cunit = callPackage ../tools/misc/cunit { }; bcunit = callPackage ../tools/misc/bcunit { }; @@ -3900,9 +3888,7 @@ in grpcurl = callPackage ../tools/networking/grpcurl { }; - grpcui = callPackage ../tools/networking/grpcui { - buildGoModule = buildGo112Module; - }; + grpcui = callPackage ../tools/networking/grpcui { }; grub = pkgsi686Linux.callPackage ../tools/misc/grub ({ stdenv = overrideCC stdenv buildPackages.pkgsi686Linux.gcc6; @@ -4325,12 +4311,7 @@ in iperf3 = callPackage ../tools/networking/iperf/3.nix { }; iperf = iperf3; - ipfs = callPackage ../applications/networking/ipfs { - # Version 0.4.22 fails to build with go 1.13 due to version validation: - # go: github.com/go-critic/go-critic@v0.0.0-20181204210945-ee9bf5809ead: invalid pseudo-version: does not match version-control timestamp (2019-02-10T22:04:43Z) - # This is fixed in master, but release containing the fix does not exist yet. - buildGoModule = buildGo112Module; - }; + ipfs = callPackage ../applications/networking/ipfs { }; ipfs-migrator = callPackage ../applications/networking/ipfs-migrator { }; ipfs-cluster = callPackage ../applications/networking/ipfs-cluster { }; @@ -5431,7 +5412,7 @@ in noip = callPackage ../tools/networking/noip { }; - nomad = callPackage ../applications/networking/cluster/nomad { }; + nomad = callPackage ../applications/networking/cluster/nomad { }; notable = callPackage ../applications/misc/notable { }; @@ -8571,13 +8552,6 @@ in inherit (darwin.apple_sdk.frameworks) Security; }; - go_1_12 = callPackage ../development/compilers/go/1.12.nix ({ - inherit (darwin.apple_sdk.frameworks) Security Foundation; - } // lib.optionalAttrs stdenv.isAarch64 { - stdenv = gcc8Stdenv; - buildPackages = buildPackages // { stdenv = gcc8Stdenv; }; - }); - go_1_14 = callPackage ../development/compilers/go/1.14.nix ({ inherit (darwin.apple_sdk.frameworks) Security Foundation; } // lib.optionalAttrs stdenv.isAarch64 { @@ -9951,9 +9925,7 @@ in bazel-remote = callPackage ../development/tools/build-managers/bazel/bazel-remote { }; - bazel-watcher = callPackage ../development/tools/bazel-watcher { - go = go_1_12; - }; + bazel-watcher = callPackage ../development/tools/bazel-watcher { }; bazel-gazelle = callPackage ../development/tools/bazel-gazelle { }; @@ -15204,18 +15176,12 @@ in ### DEVELOPMENT / GO MODULES - buildGo112Package = callPackage ../development/go-packages/generic { - go = buildPackages.go_1_12; - }; buildGo114Package = callPackage ../development/go-packages/generic { go = buildPackages.go_1_14; }; buildGoPackage = buildGo114Package; - buildGo112Module = callPackage ../development/go-modules/generic { - go = buildPackages.go_1_12; - }; buildGo114Module = callPackage ../development/go-modules/generic { go = buildPackages.go_1_14; }; @@ -15534,9 +15500,7 @@ in grafana_reporter = callPackage ../servers/monitoring/grafana-reporter { }; - gobetween = callPackage ../servers/gobetween { - buildGoModule = buildGo112Module; - }; + gobetween = callPackage ../servers/gobetween { }; h2o = callPackage ../servers/http/h2o { }; @@ -15994,11 +15958,7 @@ in prometheus-statsd-exporter = callPackage ../servers/monitoring/prometheus/statsd-exporter.nix { }; prometheus-surfboard-exporter = callPackage ../servers/monitoring/prometheus/surfboard-exporter.nix { }; prometheus-unifi-exporter = callPackage ../servers/monitoring/prometheus/unifi-exporter { }; - prometheus-varnish-exporter = callPackage ../servers/monitoring/prometheus/varnish-exporter.nix { - # Version 1.5.1 fails to build with go 1.13 due to test failure - # FAIL github.com/jonnenauha/prometheus_varnish_exporter 0.041s - buildGoModule = buildGo112Module; - }; + prometheus-varnish-exporter = callPackage ../servers/monitoring/prometheus/varnish-exporter.nix { }; prometheus-jmx-httpserver = callPackage ../servers/monitoring/prometheus/jmx-httpserver.nix { }; prometheus-wireguard-exporter = callPackage ../servers/monitoring/prometheus/wireguard-exporter.nix { inherit (darwin.apple_sdk.frameworks) Security; @@ -16394,9 +16354,7 @@ in cpustat = callPackage ../os-specific/linux/cpustat { }; - cockroachdb = callPackage ../servers/sql/cockroachdb { - buildGoPackage = buildGo112Package; - }; + cockroachdb = callPackage ../servers/sql/cockroachdb { }; conky = callPackage ../os-specific/linux/conky ({ lua = lua5_3_compat; @@ -17250,11 +17208,7 @@ in gotests = callPackage ../development/tools/gotests { }; - gotestsum = callPackage ../development/tools/gotestsum { - # Version 0.3.5 fails to build with go 1.13: - # build ./testjson/internal/badmain: cannot find module for path ./testjson/internal/badmain - buildGoModule = buildGo112Module; - }; + gotestsum = callPackage ../development/tools/gotestsum { }; impl = callPackage ../development/tools/impl { }; @@ -18739,11 +18693,7 @@ in poppler = poppler_0_61; }; - perkeep = callPackage ../applications/misc/perkeep { - # Revision c9f78d02adf9740f3b8d403a1418554293cc9f41 fails to build with go 1.13 due to a dependency: - # go: bazil.org/fuse@v0.0.0-20160811212531-371fbbdaa898: Get https://proxy.golang.org/bazil.org/fuse/@v/v0.0.0-20160811212531-371fbbdaa898.mod: dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:36526->[::1]:53: read: connection refused - buildGoPackage = buildGo112Package; - }; + perkeep = callPackage ../applications/misc/perkeep { }; canto-curses = callPackage ../applications/networking/feedreaders/canto-curses { }; @@ -20558,10 +20508,7 @@ in marp = callPackage ../applications/office/marp { }; - magnetico = callPackage ../applications/networking/p2p/magnetico { - # Version 2019-08-14 fails to build with go 1.13 due to missing go.sum - buildGoModule = buildGo112Module; - }; + magnetico = callPackage ../applications/networking/p2p/magnetico { }; matchbox = callPackage ../applications/window-managers/matchbox { }; @@ -20849,9 +20796,7 @@ in open-policy-agent = callPackage ../development/tools/open-policy-agent { }; - openshift = callPackage ../applications/networking/cluster/openshift { - buildGoPackage = buildGo112Package; - }; + openshift = callPackage ../applications/networking/cluster/openshift { }; oroborus = callPackage ../applications/window-managers/oroborus {}; @@ -22086,9 +22031,7 @@ in teleprompter = callPackage ../applications/misc/teleprompter {}; - tendermint = callPackage ../tools/networking/tendermint { - buildGoModule = buildGo112Module; - }; + tendermint = callPackage ../tools/networking/tendermint { }; termdown = (newScope pythonPackages) ../applications/misc/termdown { }; @@ -23132,9 +23075,7 @@ in }; litecoind = litecoin.override { withGui = false; }; - lnd = callPackage ../applications/blockchains/lnd.nix { - buildGoModule = buildGo112Module; - }; + lnd = callPackage ../applications/blockchains/lnd.nix { }; monero = callPackage ../applications/blockchains/monero { inherit (darwin.apple_sdk.frameworks) CoreData IOKit PCSC; @@ -23799,9 +23740,7 @@ in sauerbraten = callPackage ../games/sauerbraten {}; - scaleway-cli = callPackage ../tools/admin/scaleway-cli { - buildGoPackage = buildGo112Package; - }; + scaleway-cli = callPackage ../tools/admin/scaleway-cli { }; scid = callPackage ../games/scid { tcl = tcl-8_5;