Fix bazel builds with unspecified arch

//build/bazel/platforms:android_target is an alias to
android_{arch}, so on bulids like "ndk" that don't
specify an arch, it fails.

It's also questionable if we should be setting the
platform to android in a mixed build in the first
place. What if we were mixed-building a host tool?

This reproduces when running
`OUT_DIR=out ./build/soong/scripts/build-ndk-prebuilts.sh`
with aosp/2263623. That script specifies --soong-only,
which is important because even without bazel, `m nothing`
on ndk-userdebug will fail with errors in makefile code.

Bug: 254701254
Test: Described above
Change-Id: I34cae0287830a19c4865fbd398f3c4e1ee1d2d66
This commit is contained in:
Cole Faust
2022-10-20 16:49:30 -07:00
parent a9e1df1522
commit f5eae990bc

View File

@@ -551,7 +551,6 @@ func (r *builtinBazelRunner) createBazelCommand(paths *bazelPaths, runName bazel
//
// The actual platform values here may be overridden by configuration
// transitions from the buildroot.
fmt.Sprintf("--platforms=%s", "//build/bazel/platforms:android_target"),
fmt.Sprintf("--extra_toolchains=%s", "//prebuilts/clang/host/linux-x86:all"),
// This should be parameterized on the host OS, but let's restrict to linux