aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2017-03-29 18:20:57 +0800
committerGitHub <noreply@github.com>2017-03-29 18:20:57 +0800
commit1cf2ee4597e3e1902088fd84663d4ce4eff8946a (patch)
tree3f7ee3576ca1b596be5474a9b94e852d04d51c06 /build
parentbaf20010e72e31a34e0e2f7c58ccb8135e388b83 (diff)
downloadgo-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.tar
go-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.tar.gz
go-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.tar.bz2
go-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.tar.lz
go-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.tar.xz
go-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.tar.zst
go-tangerine-1cf2ee4597e3e1902088fd84663d4ce4eff8946a.zip
build: work around cgo linker issue on macOS 10.12.4 (#13849)
Fixes #3792 by stripping debug symbols.
Diffstat (limited to 'build')
-rw-r--r--build/ci.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/build/ci.go b/build/ci.go
index 622417580..9a6f1e196 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -217,9 +217,16 @@ func doInstall(cmdline []string) {
}
func buildFlags(env build.Environment) (flags []string) {
- // Set gitCommit constant via link-time assignment.
+ var ld []string
if env.Commit != "" {
- flags = append(flags, "-ldflags", "-X main.gitCommit="+env.Commit)
+ ld = append(ld, "-X", "main.gitCommit="+env.Commit)
+ }
+ if runtime.GOOS == "darwin" {
+ ld = append(ld, "-s")
+ }
+
+ if len(ld) > 0 {
+ flags = append(flags, "-ldflags", strings.Join(ld, " "))
}
return flags
}
@@ -266,6 +273,7 @@ func doTest(cmdline []string) {
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
)
flag.CommandLine.Parse(cmdline)
+ env := build.Env()
packages := []string{"./..."}
if len(flag.CommandLine.Args()) > 0 {
@@ -279,7 +287,7 @@ func doTest(cmdline []string) {
spellcheck(packages)
}
// Run the actual tests.
- gotest := goTool("test")
+ gotest := goTool("test", buildFlags(env)...)
// Test a single package at a time. CI builders are slow
// and some tests run into timeouts under load.
gotest.Args = append(gotest.Args, "-p", "1")