about summary refs log tree commit diff
path: root/nix/buildGo/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-24T20·36+0300
committerflokli <flokli@flokli.de>2023-10-24T20·36+0000
commit5c91ddbeeffde92b41bb4e2720aaea98d7758ef9 (patch)
tree7f9f6beb4a64bdef77d6001f31437b0361ab719a /nix/buildGo/default.nix
parent6a04ba6bc55c5b3beda74b8f4629e3e1a56b7a8e (diff)
chore(nix/buildGo): bump to go 1.19 r/6877
Reading from lukegb's tea leaves.

Change-Id: I5705fcb3212943e62de6e74cf8460171383121d5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9796
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'nix/buildGo/default.nix')
-rw-r--r--nix/buildGo/default.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/nix/buildGo/default.nix b/nix/buildGo/default.nix
index bd2e323300..a7b1f6771e 100644
--- a/nix/buildGo/default.nix
+++ b/nix/buildGo/default.nix
@@ -24,8 +24,8 @@ let
 
   inherit (pkgs) lib runCommand fetchFromGitHub protobuf symlinkJoin;
 
-  # TODO: Adapt to Go 1.19 changes
-  go = pkgs.go_1_18;
+  # TODO: Adapt to Go 1.20 changes
+  go = pkgs.go_1_19;
 
   # Helpers for low-level Go compiler invocations
   spaceOut = lib.concatStringsSep " ";
@@ -59,7 +59,7 @@ let
   program = { name, srcs, deps ? [ ], x_defs ? { } }:
     let uniqueDeps = allDeps (map (d: d.gopkg) deps);
     in runCommand name { } ''
-      ${go}/bin/go tool compile -o ${name}.a -trimpath=$PWD -trimpath=${go} ${includeSources uniqueDeps} ${spaceOut srcs}
+      ${go}/bin/go tool compile -o ${name}.a -trimpath=$PWD -trimpath=${go} -p main ${includeSources uniqueDeps} ${spaceOut srcs}
       mkdir -p $out/bin
       export GOROOT_FINAL=go
       ${go}/bin/go tool link -o $out/bin/${name} -buildid nix ${xFlags x_defs} ${includeLibs uniqueDeps} ${name}.a
@@ -79,8 +79,8 @@ let
       # This is required for several popular packages (e.g. x/sys).
       ifAsm = do: lib.optionalString (sfiles != [ ]) do;
       asmBuild = ifAsm ''
-        ${go}/bin/go tool asm -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -gensymabis -o ./symabis ${spaceOut sfiles}
-        ${go}/bin/go tool asm -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -o ./asm.o ${spaceOut sfiles}
+        ${go}/bin/go tool asm -p ${path} -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -gensymabis -o ./symabis ${spaceOut sfiles}
+        ${go}/bin/go tool asm -p ${path} -trimpath $PWD -I $PWD -I ${go}/share/go/pkg/include -D GOOS_linux -D GOARCH_amd64 -o ./asm.o ${spaceOut sfiles}
       '';
       asmLink = ifAsm "-symabis ./symabis -asmhdr $out/go_asm.h";
       asmPack = ifAsm ''