From 31516eb9cde89824a58f4ebf30baaddc21ef9202 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 20 Jul 2020 03:55:22 +0100 Subject: fix(buildTypedGo): Use builtins.baseNameOf when renaming inputs Without this, we would end up with "double" store paths like this: /nix/store/848js1fvbjniv5n00hifmhgzzszl97vv--nix-store-ad6piq18wdkxnfzsbyn88ixvv7gfb1dp-main.go.drv We really only care about the `main.go` bit though. Change-Id: Ib0644781a0e232a45e1cae3dd05b9b828c9087ee Reviewed-on: https://cl.tvl.fyi/c/depot/+/1321 Tested-by: BuildkiteCI Reviewed-by: ericvolp12 --- nix/buildTypedGo/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nix') diff --git a/nix/buildTypedGo/default.nix b/nix/buildTypedGo/default.nix index 88eb8688ce..f135b1ebb4 100644 --- a/nix/buildTypedGo/default.nix +++ b/nix/buildTypedGo/default.nix @@ -8,13 +8,14 @@ let inherit (builtins) + baseNameOf stringLength substring; inherit (depot.nix.buildGo) gpackage program; go2goext = file: substring 0 ((stringLength file) - 1) file; - go2go = file: pkgs.runCommandNoCC "${go2goext (toString file)}" {} '' + go2go = file: pkgs.runCommandNoCC "${go2goext (baseNameOf file)}" {} '' cp ${file} . ${pkgs.go}/bin/go tool go2go translate *.go2 mv *.go $out -- cgit 1.4.1