Improve fetching build variable `TARGET_ARCH` in `buildbot-build.sh`.
Use `build/soong/soong_ui.bash` instead of sourcing
`build/envsetup.sh`, which also plays nicely with the use of
`shopt -s failglob` in script `tools/buildbot-build.sh` (script
`build/envsetup.sh` seems to have introduced new completion features
which are incompatible with `build/envsetup.sh`'s use of
`shopt -s failglob`.)
Test: art/tools/buildbot-build.sh --target
Change-Id: Ifddc05a505f66298fcd476649ab687d4bdd84984
diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh
index 59164ee..25f3b60 100755
--- a/tools/buildbot-build.sh
+++ b/tools/buildbot-build.sh
@@ -25,7 +25,7 @@
exit 1
fi
-TARGET_ARCH=$(source build/envsetup.sh > /dev/null; get_build_var TARGET_ARCH)
+TARGET_ARCH=$(build/soong/soong_ui.bash --dumpvar-mode TARGET_ARCH)
# Logic for setting out_dir from build/make/core/envsetup.mk:
if [[ -z $OUT_DIR ]]; then