fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
fmt.Fprintf(h, "import %q\n", p.ImportPath)
fmt.Fprintf(h, "omitdebug %v standard %v local %v prefix %q\n", p.Internal.OmitDebug, p.Standard, p.Internal.Local, p.Internal.LocalPrefix)
+ if cfg.BuildTrimpath {
+ fmt.Fprintln(h, "trimpath")
+ }
if p.Internal.ForceLibrary {
fmt.Fprintf(h, "forcelibrary\n")
}
fmt.Fprintf(h, "buildmode %s goos %s goarch %s\n", cfg.BuildBuildmode, cfg.Goos, cfg.Goarch)
fmt.Fprintf(h, "import %q\n", p.ImportPath)
fmt.Fprintf(h, "omitdebug %v standard %v local %v prefix %q\n", p.Internal.OmitDebug, p.Standard, p.Internal.Local, p.Internal.LocalPrefix)
+ if cfg.BuildTrimpath {
+ fmt.Fprintln(h, "trimpath")
+ }
// Toolchain-dependent configuration, shared with b.linkSharedActionID.
b.printLinkerConfig(h, p)
--- /dev/null
+env GO111MODULE=on
+
+# Set up fresh GOCACHE.
+env GOCACHE=$WORK/gocache
+mkdir $GOCACHE
+
+cd $WORK
+go build -o a.out
+
+# Varying -trimpath should cause a rebuild.
+go build -x -o a.out -trimpath
+stderr '(compile|gccgo)( |\.exe)'
+stderr 'link( |\.exe)'
+
+-- $WORK/hello.go --
+package main
+func main() { println("hello") }
+
+-- $WORK/go.mod --
+module m