Only generate kythe xrefs on the primary module

Currently the kythe build is hitting the 6 hour timeout, but we're
generating kythe files for all variants. Generating them only for
the primary variant should drastically cut its runtime.

Bug: 345440993
Test: Presubmits
Change-Id: I3846b25c7f0bc22153e4f0a0cb81c5015854dd70
This commit is contained in:
Cole Faust
2024-06-11 11:45:53 -07:00
parent 4eef64a70b
commit 9decf834ce
2 changed files with 3 additions and 3 deletions

View File

@@ -485,7 +485,7 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs
coverageFiles = make(android.Paths, 0, len(srcFiles))
}
var kytheFiles android.Paths
if flags.emitXrefs {
if flags.emitXrefs && ctx.Module() == ctx.PrimaryModule() {
kytheFiles = make(android.Paths, 0, len(srcFiles))
}
@@ -664,7 +664,7 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs
})
// Register post-process build statements (such as for tidy or kythe).
if emitXref {
if emitXref && ctx.Module() == ctx.PrimaryModule() {
kytheFile := android.ObjPathWithExt(ctx, subdir, srcFile, "kzip")
ctx.Build(pctx, android.BuildParams{
Rule: kytheExtract,