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 <hyangah@gmail.com>
This commit is contained in:
David Crawshaw 2015-05-26 08:41:41 -04:00
parent 305154cb90
commit 8f15a83bc0
2 changed files with 2 additions and 4 deletions

View File

@ -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
}

View File

@ -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}}