Merge "Restrict mixed build cquery to deps of depth 2." am: 8cdd6f007d

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1849693

Change-Id: I55f2bd60b00ec40d9bb4564c20de147b44466a21
This commit is contained in:
Liz Kammer
2021-10-08 17:23:50 +00:00
committed by Automerger Merge Worker
2 changed files with 2 additions and 2 deletions

View File

@@ -694,7 +694,7 @@ func (context *bazelContext) InvokeBazel() error {
cqueryOutput, cqueryErr, err = context.issueBazelCommand(
context.paths,
bazel.CqueryBuildRootRunName,
bazelCommand{"cquery", fmt.Sprintf("deps(%s)", buildrootLabel)},
bazelCommand{"cquery", fmt.Sprintf("deps(%s, 2)", buildrootLabel)},
"--output=starlark",
"--starlark:file="+absolutePath(cqueryFileRelpath))
err = ioutil.WriteFile(filepath.Join(soongInjectionPath, "cquery.out"),

View File

@@ -11,7 +11,7 @@ func TestRequestResultsAfterInvokeBazel(t *testing.T) {
label := "//foo:bar"
arch := Arm64
bazelContext, _ := testBazelContext(t, map[bazelCommand]string{
bazelCommand{command: "cquery", expression: "deps(@soong_injection//mixed_builds:buildroot)"}: `//foo:bar|arm64>>out/foo/bar.txt`,
bazelCommand{command: "cquery", expression: "deps(@soong_injection//mixed_builds:buildroot, 2)"}: `//foo:bar|arm64>>out/foo/bar.txt`,
})
g, ok := bazelContext.GetOutputFiles(label, arch)
if ok {