From 03fb76216974b88c5a15288245e3cc904b66c519 Mon Sep 17 00:00:00 2001 From: Kslr Date: Tue, 6 Oct 2020 13:17:30 +0800 Subject: [PATCH] removes all file system paths from the compiled executable, to improve build reproducibility --- infra/bazel/build.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/bazel/build.bzl b/infra/bazel/build.bzl index 57ffc91d..3e3892f4 100644 --- a/infra/bazel/build.bzl +++ b/infra/bazel/build.bzl @@ -19,6 +19,7 @@ def _go_command(ctx): "-asmflags", '"all=-trimpath=${GOPATH}/src"', "-ldflags", "'%s'" % ld_flags, "-tags", "'%s'" % ctx.attr.gotags, + "-trimpath", pkg, ] @@ -28,7 +29,6 @@ def _go_command(ctx): "CGO_ENABLED=0", "GOOS="+ctx.attr.os, "GOARCH="+ctx.attr.arch, - #"GOROOT_FINAL=/go", "GO111MODULE=on", "GOCACHE=${TMPDIR}/gocache" ]