mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
build: Add -trimpath compiler option (#6904)
Quoting the manual: -trimpath remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin with either "go" (for the standard library), or a module path@version (when using modules), or a plain import path (when using GOPATH). That is, when we panic, instead of: goroutine 1 [running]: main.main() /Users/jb/dev/syncthing/syncthing/cmd/syncthing/main.go:272 +0x116 we get: goroutine 1 [running]: main.main() github.com/syncthing/syncthing@/cmd/syncthing/main.go:272 +0x116 (Module path and file path within module.)
This commit is contained in:
parent
086d1f8f6a
commit
96e35aa7f5
4
build.go
4
build.go
@ -465,7 +465,7 @@ func install(target target, tags []string) {
|
||||
defer shouldCleanupSyso(sysoPath)
|
||||
}
|
||||
|
||||
args := []string{"install", "-v"}
|
||||
args := []string{"install", "-v", "-trimpath"}
|
||||
args = appendParameters(args, tags, target.buildPkgs...)
|
||||
runPrint(goCmd, args...)
|
||||
}
|
||||
@ -493,7 +493,7 @@ func build(target target, tags []string) {
|
||||
defer shouldCleanupSyso(sysoPath)
|
||||
}
|
||||
|
||||
args := []string{"build", "-v"}
|
||||
args := []string{"build", "-v", "-trimpath"}
|
||||
args = appendParameters(args, tags, target.buildPkgs...)
|
||||
runPrint(goCmd, args...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user