Skip to content

Commit

Permalink
build: fix GOBIN for gomobile commands (#21361)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl authored Jul 23, 2020
1 parent 4c268e6 commit 997b552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,11 +884,12 @@ func gomobileTool(subcmd string, args ...string) *exec.Cmd {
"PATH=" + GOBIN + string(os.PathListSeparator) + os.Getenv("PATH"),
}
for _, e := range os.Environ() {
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") {
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") || strings.HasPrefix(e, "GOBIN=") {
continue
}
cmd.Env = append(cmd.Env, e)
}
cmd.Env = append(cmd.Env, "GOBIN="+GOBIN)
return cmd
}

Expand Down Expand Up @@ -957,7 +958,7 @@ func doXCodeFramework(cmdline []string) {

if *local {
// If we're building locally, use the build folder and stop afterwards
bind.Dir, _ = filepath.Abs(GOBIN)
bind.Dir = GOBIN
build.MustRun(bind)
return
}
Expand Down

0 comments on commit 997b552

Please sign in to comment.