From 8f15a83bc0ca62d24352760d5a25b569c393a0bf Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Tue, 26 May 2015 08:41:41 -0400 Subject: [PATCH] cmd/gomobile: do not run make.bash with user env The user may have set GOBIN, in which case the existing go command is overwritten. I cannot think of any relevant environment variables the user would set, so the easiest thing is not to use them at all. While here, fix the unit test I broke in cl/10319. Change-Id: I8cef353b5a0e4aabae97169ff553b53f7973ff8b Reviewed-on: https://go-review.googlesource.com/10397 Reviewed-by: Hyang-Ah Hana Kim --- cmd/gomobile/init.go | 1 - cmd/gomobile/init_test.go | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index 0216e69..8eae6f3 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -174,7 +174,6 @@ func runInit(cmd *command) error { printcmd("%s", strings.Join(make.Env, " ")+" "+strings.Join(make.Args, " ")) } if !buildN { - make.Env = environ(make.Env) if err := make.Run(); err != nil { return err } diff --git a/cmd/gomobile/init_test.go b/cmd/gomobile/init_test.go index af2e788..1e41de1 100644 --- a/cmd/gomobile/init_test.go +++ b/cmd/gomobile/init_test.go @@ -113,9 +113,8 @@ tar xfz $GOMOBILE/dl/gomobile-openal-soft-1.16.0.1.tar.gz mv $WORK/openal/include/AL $GOMOBILE/android-{{.NDK}}/arm/sysroot/usr/include/AL mkdir -p $GOMOBILE/android-{{.NDK}}/openal mv $WORK/openal/lib $GOMOBILE/android-{{.NDK}}/openal/lib -PATH=$PATH GOOS=android GOARCH=arm GOARM=7 CGO_ENABLED=1 CC_FOR_TARGET=$GOMOBILE/android-{{.NDK}}/arm/bin/arm-linux-androideabi-gcc{{.EXE}} CXX_FOR_TARGET=$GOMOBILE/android-{{.NDK}}/arm/bin/arm-linux-androideabi-g++{{.EXE}} {{.BuildScript}} -mv $WORK/go/pkg/tool/{{.GOOS}}_{{.GOARCH}}/5l{{.EXE}} $GOMOBILE/android-{{.NDK}}/arm/bin/5l{{.EXE}} -mv $WORK/go/pkg/tool/{{.GOOS}}_{{.GOARCH}}/5g{{.EXE}} $GOMOBILE/android-{{.NDK}}/arm/bin/5g{{.EXE}} +PATH=$PATH GOOS=android GOROOT=$WORK/go GOARCH=arm GOARM=7 CGO_ENABLED=1 CC_FOR_TARGET=$GOMOBILE/android-{{.NDK}}/arm/bin/arm-linux-androideabi-gcc{{.EXE}} CXX_FOR_TARGET=$GOMOBILE/android-{{.NDK}}/arm/bin/arm-linux-androideabi-g++{{.EXE}} {{.BuildScript}} +mv $WORK/go/pkg/tool/{{.GOOS}}_{{.GOARCH}}/compile{{.EXE}} $GOMOBILE/android-{{.NDK}}/arm/bin/compile{{.EXE}} mv $WORK/go/pkg/tool/{{.GOOS}}_{{.GOARCH}}/asm{{.EXE}} $GOMOBILE/android-{{.NDK}}/arm/bin/asm{{.EXE}} mv $WORK/go/pkg/tool/{{.GOOS}}_{{.GOARCH}}/cgo{{.EXE}} $GOMOBILE/android-{{.NDK}}/arm/bin/cgo{{.EXE}} mv $WORK/go/pkg/tool/{{.GOOS}}_{{.GOARCH}}/nm{{.EXE}} $GOMOBILE/android-{{.NDK}}/arm/bin/nm{{.EXE}}