about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-20T02·55+0100
committertazjin <mail@tazj.in>2020-07-20T11·33+0000
commit31516eb9cde89824a58f4ebf30baaddc21ef9202 (patch)
treee90026065702bbcccc3b566ffd987572e53529f6 /nix
parent16823d075ccd2f07f282c66b601ad4af44d5f1fa (diff)
fix(buildTypedGo): Use builtins.baseNameOf when renaming inputs r/1407
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 <ericvolp12@gmail.com>
Diffstat (limited to 'nix')
-rw-r--r--nix/buildTypedGo/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nix/buildTypedGo/default.nix b/nix/buildTypedGo/default.nix
index 88eb8688ce2a..f135b1ebb454 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