Skip to content

Commit d494074

Browse files
authored
build: fix regressions with the -dlgo change (#21831)
This fixes cross-build and mobile framework failures. It also disables the mac test builder because it was failing all the time in hard to understand ways and we can't afford it anymore under Travis CI's new pricing.
1 parent d990df9 commit d494074

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

.travis.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,6 @@ jobs:
5555
script:
5656
- go run build/ci.go test -coverage $TEST_PACKAGES
5757

58-
- stage: build
59-
os: osx
60-
osx_image: xcode11.3
61-
go: 1.15.x
62-
env:
63-
- GO111MODULE=on
64-
script:
65-
- echo "Increase the maximum number of open file descriptors on macOS"
66-
- NOFILE=20480
67-
- sudo sysctl -w kern.maxfiles=$NOFILE
68-
- sudo sysctl -w kern.maxfilesperproc=$NOFILE
69-
- sudo launchctl limit maxfiles $NOFILE $NOFILE
70-
- sudo launchctl limit maxfiles
71-
- ulimit -S -n $NOFILE
72-
- ulimit -n
73-
- unset -f cd # workaround for https://github.com/travis-ci/travis-ci/issues/8703
74-
- go run build/ci.go test -coverage $TEST_PACKAGES
75-
7658
# This builder does the Ubuntu PPA upload
7759
- stage: build
7860
if: type = push

build/ci.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func doInstall(cmdline []string) {
243243
}
244244

245245
// Configure C compiler.
246-
if *cc == "" {
246+
if *cc != "" {
247247
gobuild.Env = append(gobuild.Env, "CC="+*cc)
248248
} else if os.Getenv("CC") != "" {
249249
gobuild.Env = append(gobuild.Env, "CC="+os.Getenv("CC"))
@@ -259,6 +259,9 @@ func doInstall(cmdline []string) {
259259
// Put the default settings in.
260260
gobuild.Args = append(gobuild.Args, buildFlags(env)...)
261261

262+
// We use -trimpath to avoid leaking local paths into the built executables.
263+
gobuild.Args = append(gobuild.Args, "-trimpath")
264+
262265
// Show packages during build.
263266
gobuild.Args = append(gobuild.Args, "-v")
264267

@@ -294,8 +297,6 @@ func buildFlags(env build.Environment) (flags []string) {
294297
if len(ld) > 0 {
295298
flags = append(flags, "-ldflags", strings.Join(ld, " "))
296299
}
297-
// We use -trimpath to avoid leaking local paths into the built executables.
298-
flags = append(flags, "-trimpath")
299300
return flags
300301
}
301302

@@ -318,6 +319,7 @@ func localGoTool(goroot string, subcmd string, args ...string) *exec.Cmd {
318319

319320
// goToolSetEnv forwards the build environment to the go tool.
320321
func goToolSetEnv(cmd *exec.Cmd) {
322+
cmd.Env = append(cmd.Env, "GOBIN="+GOBIN)
321323
for _, e := range os.Environ() {
322324
if strings.HasPrefix(e, "GOBIN=") || strings.HasPrefix(e, "CC=") {
323325
continue
@@ -514,7 +516,7 @@ func doDebianSource(cmdline []string) {
514516
gobundle := downloadGoSources(*cachedir)
515517

516518
// Download all the dependencies needed to build the sources and run the ci script
517-
srcdepfetch := goTool("install", "-n", "./...")
519+
srcdepfetch := goTool("mod", "download")
518520
srcdepfetch.Env = append(os.Environ(), "GOPATH="+filepath.Join(*workdir, "modgopath"))
519521
build.MustRun(srcdepfetch)
520522

0 commit comments

Comments
 (0)