Remove --extra_toolchains flag from aquery runner

When specifying --extra_toolchains=//prebuilts/clang/host/linux-x86:all, there is no control over the sort order of toolchains, which can result in a more generic toolchain being used rather than the most specific (and correct) toolchain.

Apparently, this flag is causing Bazel to drop some flags from CppCompile actions. This causes mixed-build's outputs different from Soong build. The mixed-build also generates different from Bazel build because we don't use the flag when using `b` to build the targets.

Test: Inspect differences in CppCompile actions from Soong's Bazel aquery handler and b aquery
Bug: 273995121
Change-Id: Id9e32c0cd12ab8577cd5b223ca9e19c982f3ae1f
This commit is contained in:
Vinh Tran
2023-03-17 12:35:39 -04:00
parent 9741785c4c
commit cbee4e3f2e

View File

@@ -736,15 +736,6 @@ func (r *builtinBazelRunner) createBazelCommand(config Config, paths *bazelPaths
// TODO(asmundak): is it needed in every build?
"--profile=" + shared.BazelMetricsFilename(paths, runName),
// Set default platforms to canonicalized values for mixed builds requests.
// If these are set in the bazelrc, they will have values that are
// non-canonicalized to @sourceroot labels, and thus be invalid when
// referenced from the buildroot.
//
// The actual platform values here may be overridden by configuration
// transitions from the buildroot.
fmt.Sprintf("--extra_toolchains=%s", "//prebuilts/clang/host/linux-x86:all"),
// We don't need to set --host_platforms because it's set in bazelrc files
// that the bazel shell script wrapper passes