Skip to content

Commit 997b552

Browse files
authored
build: fix GOBIN for gomobile commands (#21361)
1 parent 4c268e6 commit 997b552

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build/ci.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,11 +884,12 @@ func gomobileTool(subcmd string, args ...string) *exec.Cmd {
884884
"PATH=" + GOBIN + string(os.PathListSeparator) + os.Getenv("PATH"),
885885
}
886886
for _, e := range os.Environ() {
887-
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") {
887+
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") || strings.HasPrefix(e, "GOBIN=") {
888888
continue
889889
}
890890
cmd.Env = append(cmd.Env, e)
891891
}
892+
cmd.Env = append(cmd.Env, "GOBIN="+GOBIN)
892893
return cmd
893894
}
894895

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

958959
if *local {
959960
// If we're building locally, use the build folder and stop afterwards
960-
bind.Dir, _ = filepath.Abs(GOBIN)
961+
bind.Dir = GOBIN
961962
build.MustRun(bind)
962963
return
963964
}

0 commit comments

Comments
 (0)