From e05e2253c6dbb26917f0eeec43cc7a20328ace1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Tue, 26 Jul 2022 16:29:06 +0200 Subject: [PATCH] fastly: specify go OS and arch explicitly Use `GOHOSTOS` and `GOHOSTARCH` instead of `go version`; supported in the fastly source code since e2f1500bf591e919e3fd9683294ac9d5b0606789. --- pkgs/misc/fastly/default.nix | 5 +++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/misc/fastly/default.nix b/pkgs/misc/fastly/default.nix index eb0ebd27b8ab..a56b39688130 100644 --- a/pkgs/misc/fastly/default.nix +++ b/pkgs/misc/fastly/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, installShellFiles, buildGoModule }: +{ lib, fetchFromGitHub, installShellFiles, buildGoModule, go }: buildGoModule rec { pname = "fastly"; @@ -34,10 +34,11 @@ buildGoModule rec { "-w" "-X github.com/fastly/cli/pkg/revision.AppVersion=v${version}" "-X github.com/fastly/cli/pkg/revision.Environment=release" + "-X github.com/fastly/cli/pkg/revision.GoHostOS=${go.GOHOSTOS}" + "-X github.com/fastly/cli/pkg/revision.GoHostArch=${go.GOHOSTARCH}" ]; preBuild = '' ldflags+=" -X github.com/fastly/cli/pkg/revision.GitCommit=$(cat COMMIT)" - ldflags+=" -X 'github.com/fastly/cli/pkg/revision.GoVersion=$(go version)'" ''; postInstall = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 06e842477314..ca822097f25f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3709,7 +3709,9 @@ with pkgs; extrude = callPackage ../tools/security/extrude { }; - fastly = callPackage ../misc/fastly {}; + fastly = callPackage ../misc/fastly { + # If buildGoModule is overriden, provide a matching version of the go attribute + }; f2 = callPackage ../tools/misc/f2 {};