From 94d2aeb559c4427718f6010ba082b7be7ee82f6d Mon Sep 17 00:00:00 2001 From: "Maurice B. Lewis" Date: Sun, 27 Sep 2020 22:20:41 +0000 Subject: [PATCH] terraform-providers: add version to patchGoModVendor providers (#97590) Add version to binaries produced via patchGoModVendor to allow run-time provider version validation by terraform. This was initially introduced in 4e63119c540 (terraform: add the version component to terraform provider paths (#34497), 2018-02-06) but broken in 3e5149a79ad (terraform-providers: fix the google and google-beta providers, 2020-03-24) for terraform-providers.google and terraform-providers.google-beta, and in 20f55a9fc07 (terraform-providers.ibm: move to update-all script, 2020-04-26) for terraform-providers.ibm. --- .../networking/cluster/terraform-providers/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/terraform-providers/default.nix b/pkgs/applications/networking/cluster/terraform-providers/default.nix index 686b9ef9500..8b28f8bab54 100644 --- a/pkgs/applications/networking/cluster/terraform-providers/default.nix +++ b/pkgs/applications/networking/cluster/terraform-providers/default.nix @@ -17,7 +17,7 @@ let }; # Terraform allow checking the provider versions, but this breaks # if the versions are not provided via file paths. - postBuild = "mv go/bin/${repo}{,_v${version}}"; + postBuild = "mv $NIX_BUILD_TOP/go/bin/${repo}{,_v${version}}"; }; # Google is now using the vendored go modules, which works a bit differently @@ -39,6 +39,8 @@ let # just build and install into $GOPATH/bin buildPhase = '' go install -mod=vendor -v -p 16 . + + runHook postBuild ''; # don't run the tests, they are broken in this setup