From 060a9227c24639ca5a339fbb57b8e05a5eabb92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Mar 2020 16:27:27 +0000 Subject: [PATCH 1/8] buildGoModule: enable strictDeps This will improve cross compiling in the long run. See also https://github.com/NixOS/nixpkgs/pull/82786 --- pkgs/development/go-modules/generic/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 1bf13c18821..42b446b9fa8 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -208,6 +208,8 @@ let find $out/bin -type f -exec ${removeExpr removeReferences} '{}' + || true ''; + strictDeps = true; + disallowedReferences = lib.optional (!allowGoReference) go; passthru = passthru // { inherit go go-modules modSha256; }; From 72f3f99907aae9d2b42551b0090673ddbabaab33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Mar 2020 17:42:22 +0000 Subject: [PATCH 2/8] magnetico: move go-bindata to nativeBuildInputs fixes strictDeps --- pkgs/applications/networking/p2p/magnetico/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/p2p/magnetico/default.nix b/pkgs/applications/networking/p2p/magnetico/default.nix index 94720f35504..efab9aa992a 100644 --- a/pkgs/applications/networking/p2p/magnetico/default.nix +++ b/pkgs/applications/networking/p2p/magnetico/default.nix @@ -13,7 +13,7 @@ buildGoModule rec { modSha256 = "1h9fij8mxlxfw7kxix00n10fkhkvmf8529fxbk1n30cxc1bs2szf"; - buildInputs = [ go-bindata ]; + nativeBuildInputs = [ go-bindata ]; buildPhase = '' make magneticow magneticod ''; From e63be529708199f58984b4add377110343892a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Mar 2020 17:42:54 +0000 Subject: [PATCH 3/8] gvisor: remove unneeded go-bindata --- pkgs/applications/virtualization/gvisor/containerd-shim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/gvisor/containerd-shim.nix b/pkgs/applications/virtualization/gvisor/containerd-shim.nix index 0161a117def..d30897df79e 100644 --- a/pkgs/applications/virtualization/gvisor/containerd-shim.nix +++ b/pkgs/applications/virtualization/gvisor/containerd-shim.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, buildGoModule, go-bindata }: +{ lib, fetchFromGitHub, buildGoModule }: buildGoModule rec { name = "gvisor-containerd-shim-${version}"; From f288afefc10773011ec188145f9c35bf77c3dde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Mar 2020 17:43:26 +0000 Subject: [PATCH 4/8] documize-community: fix strict deps build --- pkgs/servers/documize-community/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/documize-community/default.nix b/pkgs/servers/documize-community/default.nix index 0607902295a..7780d900bad 100644 --- a/pkgs/servers/documize-community/default.nix +++ b/pkgs/servers/documize-community/default.nix @@ -13,7 +13,7 @@ buildGoModule rec { modSha256 = "1z0v7n8klaxcqv7mvzf3jzgrp78zb4yiibx899ppk6i5qnj4xiv0"; - buildInputs = [ go-bindata-assetfs go-bindata ]; + nativeBuildInputs = [ go-bindata go-bindata-assetfs ]; subPackages = [ "edition/community.go" ]; From f545f92f726fe9aa674682f86edf40ab88cade50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Mar 2020 17:43:54 +0000 Subject: [PATCH 5/8] imgproxy: fix strict deps build --- pkgs/servers/imgproxy/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/imgproxy/default.nix b/pkgs/servers/imgproxy/default.nix index be78e1aa831..4cdfddcff6f 100644 --- a/pkgs/servers/imgproxy/default.nix +++ b/pkgs/servers/imgproxy/default.nix @@ -13,11 +13,9 @@ buildGoModule rec { modSha256 = "0kgd8lwcdns3skvd4bj4z85mq6hkk79mb0zzwky0wqxni8f73s6w"; - buildInputs = [ - gobject-introspection - pkg-config - vips - ]; + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ gobject-introspection vips ]; preBuild = '' export CGO_LDFLAGS_ALLOW='-(s|w)' From b5144456ccb57b48a48173bf04277217b7f9aa50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Mar 2020 17:50:41 +0000 Subject: [PATCH 6/8] aerc: fix strict deps build --- pkgs/applications/networking/mailreaders/aerc/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/aerc/default.nix b/pkgs/applications/networking/mailreaders/aerc/default.nix index 0fa30a85d1b..7b24ed93406 100644 --- a/pkgs/applications/networking/mailreaders/aerc/default.nix +++ b/pkgs/applications/networking/mailreaders/aerc/default.nix @@ -17,10 +17,8 @@ in buildGoModule rec { modSha256 = "127xrah6xxrvc224g5dxn432sagrssx8v7phzapcsdajsnmagq6x"; nativeBuildInputs = [ - go scdoc python3.pkgs.wrapPython - notmuch ]; patches = [ @@ -31,7 +29,7 @@ in buildGoModule rec { python3.pkgs.colorama ]; - buildInputs = [ python3 perl ]; + buildInputs = [ python3 notmuch ]; GOFLAGS="-tags=notmuch"; From ae08790703b48fde1f6f384ec3bc03c0e64ab2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 18 Mar 2020 10:43:09 +0000 Subject: [PATCH 7/8] teleport: fix build with strict deps --- pkgs/servers/teleport/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/teleport/default.nix b/pkgs/servers/teleport/default.nix index dc92a10fe24..1e1c0f938db 100644 --- a/pkgs/servers/teleport/default.nix +++ b/pkgs/servers/teleport/default.nix @@ -14,8 +14,11 @@ buildGoPackage rec { }; goPackagePath = "github.com/gravitational/teleport"; + subPackages = [ "tool/tctl" "tool/teleport" "tool/tsh" ]; - buildInputs = [ zip ]; + + nativeBuildInputs = [ zip ]; + postBuild = '' pushd . cd $NIX_BUILD_TOP/go/src/github.com/gravitational/teleport @@ -27,7 +30,7 @@ buildGoPackage rec { cd $NIX_BUILD_TOP/go/bin zip -q -A teleport popd - ''; + ''; dontStrip = true; From ea871809844410e2a64169094cc63895ed8a2228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 18 Mar 2020 10:43:51 +0000 Subject: [PATCH 8/8] openshift: fix build with strict deps --- pkgs/applications/networking/cluster/openshift/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index 3b96ef4ea45..fb88dfdbb64 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -33,7 +33,9 @@ in buildGoPackage rec { goPackagePath = "github.com/openshift/origin"; - buildInputs = [ which rsync go-bindata kerberos clang ]; + buildInputs = [ kerberos ]; + + nativeBuildInputs = [ which rsync go-bindata clang ]; patchPhase = '' patchShebangs ./hack