Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f072120c authored by Yu Liu's avatar Yu Liu
Browse files

Skip writing ninja file for module with a cache hit during incremental build.

This is just the first change, many more will come to make this feature
really work. The main changes included here are:

1. Skip the writing of ninja file if a module has a cache hit.
2. Handle the case where a skipped module doesn't have the build defs
   info for the OrderOnlyStrings dedup logic to work by caching the
   missing info.

Bug: 335718784
Test: local manual tests
Change-Id: I32542bd1e7fd268113e072e7f68b51b293d83d03
parent 2800675b
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -220,15 +220,10 @@ func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.Module
}

func (module *DeclarationsModule) BuildActionProviderKeys() []blueprint.AnyProviderKey {
	return []blueprint.AnyProviderKey{android.AconfigDeclarationsProviderKey}
	return []blueprint.AnyProviderKey{
		android.AconfigDeclarationsProviderKey,
		android.AconfigReleaseDeclarationsProviderKey,
	}

func (module *DeclarationsModule) PackageContextPath() string {
	return pkgPath
}

func (module *DeclarationsModule) CachedRules() []blueprint.Rule {
	return []blueprint.Rule{aconfigRule, aconfigTextRule}
}

var _ blueprint.Incremental = &DeclarationsModule{}
+2 −2
Original line number Diff line number Diff line
@@ -23,8 +23,7 @@ import (
)

var (
	pkgPath = "android/soong/aconfig"
	pctx    = android.NewPackageContext(pkgPath)
	pctx = android.NewPackageContext("android/soong/aconfig")

	// For aconfig_declarations: Generate cache file
	aconfigRule = pctx.AndroidStaticRule("aconfig",
@@ -111,6 +110,7 @@ func init() {
	pctx.HostBinToolVariable("soong_zip", "soong_zip")

	gob.Register(android.AconfigDeclarationsProviderData{})
	gob.Register(android.AconfigReleaseDeclarationsProviderData{})
	gob.Register(android.ModuleOutPath{})
}

+1 −1
Original line number Diff line number Diff line
@@ -1921,7 +1921,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)

		restored := false
		if incrementalAnalysis && cacheKey != nil {
			restored = ctx.bp.RestoreBuildActions(cacheKey, incrementalModule)
			restored = ctx.bp.RestoreBuildActions(cacheKey)
		}

		if !restored {