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 <ericvolp12@gmail.com>
This commit is contained in:
parent
16823d075c
commit
31516eb9cd
1 changed files with 2 additions and 1 deletions
|
@ -8,13 +8,14 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
|
baseNameOf
|
||||||
stringLength
|
stringLength
|
||||||
substring;
|
substring;
|
||||||
|
|
||||||
inherit (depot.nix.buildGo) gpackage program;
|
inherit (depot.nix.buildGo) gpackage program;
|
||||||
|
|
||||||
go2goext = file: substring 0 ((stringLength file) - 1) file;
|
go2goext = file: substring 0 ((stringLength file) - 1) file;
|
||||||
go2go = file: pkgs.runCommandNoCC "${go2goext (toString file)}" {} ''
|
go2go = file: pkgs.runCommandNoCC "${go2goext (baseNameOf file)}" {} ''
|
||||||
cp ${file} .
|
cp ${file} .
|
||||||
${pkgs.go}/bin/go tool go2go translate *.go2
|
${pkgs.go}/bin/go tool go2go translate *.go2
|
||||||
mv *.go $out
|
mv *.go $out
|
||||||
|
|
Loading…
Reference in a new issue