Restrict mixed build cquery to deps of depth 2.
This will be the list of targets directly being requested + additional targets necessary for mixed_root. This reduces the size of the cquery file by ~300Kb. Additionally, it removes unnecessary targets, making it ever so slightly easier to find what one is looking for in cquery.out for debugging purposes. Test: build/bazel/ci/mixed_droid.sh Change-Id: I6d0e337c9ab7c13388459dee16415be0ab3c0506
This commit is contained in:
@@ -696,7 +696,7 @@ func (context *bazelContext) InvokeBazel() error {
|
|||||||
cqueryOutput, cqueryErr, err = context.issueBazelCommand(
|
cqueryOutput, cqueryErr, err = context.issueBazelCommand(
|
||||||
context.paths,
|
context.paths,
|
||||||
bazel.CqueryBuildRootRunName,
|
bazel.CqueryBuildRootRunName,
|
||||||
bazelCommand{"cquery", fmt.Sprintf("deps(%s)", buildrootLabel)},
|
bazelCommand{"cquery", fmt.Sprintf("deps(%s, 2)", buildrootLabel)},
|
||||||
"--output=starlark",
|
"--output=starlark",
|
||||||
"--starlark:file="+absolutePath(cqueryFileRelpath))
|
"--starlark:file="+absolutePath(cqueryFileRelpath))
|
||||||
err = ioutil.WriteFile(filepath.Join(soongInjectionPath, "cquery.out"),
|
err = ioutil.WriteFile(filepath.Join(soongInjectionPath, "cquery.out"),
|
||||||
|
@@ -11,7 +11,7 @@ func TestRequestResultsAfterInvokeBazel(t *testing.T) {
|
|||||||
label := "//foo:bar"
|
label := "//foo:bar"
|
||||||
arch := Arm64
|
arch := Arm64
|
||||||
bazelContext, _ := testBazelContext(t, map[bazelCommand]string{
|
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)
|
g, ok := bazelContext.GetOutputFiles(label, arch)
|
||||||
if ok {
|
if ok {
|
||||||
|
Reference in New Issue
Block a user