Merge changes from topic "parallel-singletons"

* changes:
  Parallelize singleton execution
  android: Allow running some singletons in parallel.
This commit is contained in:
Treehugger Robot
2023-05-22 16:40:16 +00:00
committed by Gerrit Code Review
42 changed files with 101 additions and 63 deletions

View File

@@ -42,7 +42,7 @@ func init() {
} }
func RegisterAndroidMkBuildComponents(ctx RegistrationContext) { func RegisterAndroidMkBuildComponents(ctx RegistrationContext) {
ctx.RegisterSingletonType("androidmk", AndroidMkSingleton) ctx.RegisterParallelSingletonType("androidmk", AndroidMkSingleton)
} }
// Enable androidmk support. // Enable androidmk support.

View File

@@ -22,7 +22,7 @@ import (
) )
func init() { func init() {
RegisterSingletonType("api_levels", ApiLevelsSingleton) RegisterParallelSingletonType("api_levels", ApiLevelsSingleton)
} }
const previewAPILevelBase = 9000 const previewAPILevelBase = 9000

View File

@@ -23,7 +23,7 @@ import (
func init() { func init() {
ctx := InitRegistrationContext ctx := InitRegistrationContext
ctx.RegisterSingletonModuleType("buildinfo_prop", buildinfoPropFactory) ctx.RegisterParallelSingletonModuleType("buildinfo_prop", buildinfoPropFactory)
} }
type buildinfoPropProperties struct { type buildinfoPropProperties struct {

View File

@@ -28,7 +28,7 @@ func init() {
// Register the gen_notice module type. // Register the gen_notice module type.
func RegisterGenNoticeBuildComponents(ctx RegistrationContext) { func RegisterGenNoticeBuildComponents(ctx RegistrationContext) {
ctx.RegisterSingletonType("gen_notice_build_rules", GenNoticeBuildRulesFactory) ctx.RegisterParallelSingletonType("gen_notice_build_rules", GenNoticeBuildRulesFactory)
ctx.RegisterModuleType("gen_notice", GenNoticeFactory) ctx.RegisterModuleType("gen_notice", GenNoticeFactory)
} }

View File

@@ -42,7 +42,7 @@ func readSoongMetrics(config Config) (SoongMetrics, bool) {
} }
func init() { func init() {
RegisterSingletonType("soong_metrics", soongMetricsSingletonFactory) RegisterParallelSingletonType("soong_metrics", soongMetricsSingletonFactory)
} }
func soongMetricsSingletonFactory() Singleton { return soongMetricsSingleton{} } func soongMetricsSingletonFactory() Singleton { return soongMetricsSingleton{} }

View File

@@ -3724,7 +3724,7 @@ func (m *moduleContext) TargetRequiredModuleNames() []string {
} }
func init() { func init() {
RegisterSingletonType("buildtarget", BuildTargetSingleton) RegisterParallelSingletonType("buildtarget", BuildTargetSingleton)
} }
func BuildTargetSingleton() Singleton { func BuildTargetSingleton() Singleton {

View File

@@ -65,16 +65,19 @@ type singleton struct {
// True if this should be registered as a pre-singleton, false otherwise. // True if this should be registered as a pre-singleton, false otherwise.
pre bool pre bool
// True if this should be registered as a parallel singleton.
parallel bool
name string name string
factory SingletonFactory factory SingletonFactory
} }
func newSingleton(name string, factory SingletonFactory) singleton { func newSingleton(name string, factory SingletonFactory, parallel bool) singleton {
return singleton{false, name, factory} return singleton{pre: false, parallel: parallel, name: name, factory: factory}
} }
func newPreSingleton(name string, factory SingletonFactory) singleton { func newPreSingleton(name string, factory SingletonFactory) singleton {
return singleton{true, name, factory} return singleton{pre: true, parallel: false, name: name, factory: factory}
} }
func (s singleton) componentName() string { func (s singleton) componentName() string {
@@ -86,7 +89,7 @@ func (s singleton) register(ctx *Context) {
if s.pre { if s.pre {
ctx.RegisterPreSingletonType(s.name, adaptor) ctx.RegisterPreSingletonType(s.name, adaptor)
} else { } else {
ctx.RegisterSingletonType(s.name, adaptor) ctx.RegisterSingletonType(s.name, adaptor, s.parallel)
} }
} }
@@ -145,8 +148,16 @@ func RegisterModuleTypeForDocs(name string, factory reflect.Value) {
moduleTypeByFactory[factory] = name moduleTypeByFactory[factory] = name
} }
func registerSingletonType(name string, factory SingletonFactory, parallel bool) {
singletons = append(singletons, newSingleton(name, factory, parallel))
}
func RegisterSingletonType(name string, factory SingletonFactory) { func RegisterSingletonType(name string, factory SingletonFactory) {
singletons = append(singletons, newSingleton(name, factory)) registerSingletonType(name, factory, false)
}
func RegisterParallelSingletonType(name string, factory SingletonFactory) {
registerSingletonType(name, factory, true)
} }
func RegisterPreSingletonType(name string, factory SingletonFactory) { func RegisterPreSingletonType(name string, factory SingletonFactory) {
@@ -220,17 +231,17 @@ func (ctx *Context) registerSingletonMakeVarsProvider(makevars SingletonMakeVars
func collateGloballyRegisteredSingletons() sortableComponents { func collateGloballyRegisteredSingletons() sortableComponents {
allSingletons := append(sortableComponents(nil), singletons...) allSingletons := append(sortableComponents(nil), singletons...)
allSingletons = append(allSingletons, allSingletons = append(allSingletons,
singleton{false, "bazeldeps", BazelSingleton}, singleton{pre: false, parallel: true, name: "bazeldeps", factory: BazelSingleton},
// Register phony just before makevars so it can write out its phony rules as Make rules // Register phony just before makevars so it can write out its phony rules as Make rules
singleton{false, "phony", phonySingletonFactory}, singleton{pre: false, parallel: false, name: "phony", factory: phonySingletonFactory},
// Register makevars after other singletons so they can export values through makevars // Register makevars after other singletons so they can export values through makevars
singleton{false, "makevars", makeVarsSingletonFunc}, singleton{pre: false, parallel: false, name: "makevars", factory: makeVarsSingletonFunc},
// Register env and ninjadeps last so that they can track all used environment variables and // Register env and ninjadeps last so that they can track all used environment variables and
// Ninja file dependencies stored in the config. // Ninja file dependencies stored in the config.
singleton{false, "ninjadeps", ninjaDepsSingletonFactory}, singleton{pre: false, parallel: false, name: "ninjadeps", factory: ninjaDepsSingletonFactory},
) )
return allSingletons return allSingletons
@@ -259,7 +270,9 @@ func ModuleTypeByFactory() map[reflect.Value]string {
type RegistrationContext interface { type RegistrationContext interface {
RegisterModuleType(name string, factory ModuleFactory) RegisterModuleType(name string, factory ModuleFactory)
RegisterSingletonModuleType(name string, factory SingletonModuleFactory) RegisterSingletonModuleType(name string, factory SingletonModuleFactory)
RegisterParallelSingletonModuleType(name string, factory SingletonModuleFactory)
RegisterPreSingletonType(name string, factory SingletonFactory) RegisterPreSingletonType(name string, factory SingletonFactory)
RegisterParallelSingletonType(name string, factory SingletonFactory)
RegisterSingletonType(name string, factory SingletonFactory) RegisterSingletonType(name string, factory SingletonFactory)
PreArchMutators(f RegisterMutatorFunc) PreArchMutators(f RegisterMutatorFunc)
@@ -315,8 +328,15 @@ func (ctx *initRegistrationContext) RegisterModuleType(name string, factory Modu
} }
func (ctx *initRegistrationContext) RegisterSingletonModuleType(name string, factory SingletonModuleFactory) { func (ctx *initRegistrationContext) RegisterSingletonModuleType(name string, factory SingletonModuleFactory) {
ctx.registerSingletonModuleType(name, factory, false)
}
func (ctx *initRegistrationContext) RegisterParallelSingletonModuleType(name string, factory SingletonModuleFactory) {
ctx.registerSingletonModuleType(name, factory, true)
}
func (ctx *initRegistrationContext) registerSingletonModuleType(name string, factory SingletonModuleFactory, parallel bool) {
s, m := SingletonModuleFactoryAdaptor(name, factory) s, m := SingletonModuleFactoryAdaptor(name, factory)
ctx.RegisterSingletonType(name, s) ctx.registerSingletonType(name, s, parallel)
ctx.RegisterModuleType(name, m) ctx.RegisterModuleType(name, m)
// Overwrite moduleTypesForDocs with the original factory instead of the lambda returned by // Overwrite moduleTypesForDocs with the original factory instead of the lambda returned by
// SingletonModuleFactoryAdaptor so that docs can find the module type documentation on the // SingletonModuleFactoryAdaptor so that docs can find the module type documentation on the
@@ -324,12 +344,20 @@ func (ctx *initRegistrationContext) RegisterSingletonModuleType(name string, fac
RegisterModuleTypeForDocs(name, reflect.ValueOf(factory)) RegisterModuleTypeForDocs(name, reflect.ValueOf(factory))
} }
func (ctx *initRegistrationContext) RegisterSingletonType(name string, factory SingletonFactory) { func (ctx *initRegistrationContext) registerSingletonType(name string, factory SingletonFactory, parallel bool) {
if _, present := ctx.singletonTypes[name]; present { if _, present := ctx.singletonTypes[name]; present {
panic(fmt.Sprintf("singleton type %q is already registered", name)) panic(fmt.Sprintf("singleton type %q is already registered", name))
} }
ctx.singletonTypes[name] = factory ctx.singletonTypes[name] = factory
RegisterSingletonType(name, factory) registerSingletonType(name, factory, parallel)
}
func (ctx *initRegistrationContext) RegisterSingletonType(name string, factory SingletonFactory) {
ctx.registerSingletonType(name, factory, false)
}
func (ctx *initRegistrationContext) RegisterParallelSingletonType(name string, factory SingletonFactory) {
ctx.registerSingletonType(name, factory, true)
} }
func (ctx *initRegistrationContext) RegisterPreSingletonType(name string, factory SingletonFactory) { func (ctx *initRegistrationContext) RegisterPreSingletonType(name string, factory SingletonFactory) {

View File

@@ -15,7 +15,7 @@
package android package android
func init() { func init() {
RegisterSingletonType("testsuites", testSuiteFilesFactory) RegisterParallelSingletonType("testsuites", testSuiteFilesFactory)
} }
func testSuiteFilesFactory() Singleton { func testSuiteFilesFactory() Singleton {

View File

@@ -495,8 +495,18 @@ func (ctx *TestContext) RegisterSingletonModuleType(name string, factory Singlet
ctx.RegisterModuleType(name, m) ctx.RegisterModuleType(name, m)
} }
func (ctx *TestContext) RegisterParallelSingletonModuleType(name string, factory SingletonModuleFactory) {
s, m := SingletonModuleFactoryAdaptor(name, factory)
ctx.RegisterParallelSingletonType(name, s)
ctx.RegisterModuleType(name, m)
}
func (ctx *TestContext) RegisterSingletonType(name string, factory SingletonFactory) { func (ctx *TestContext) RegisterSingletonType(name string, factory SingletonFactory) {
ctx.singletons = append(ctx.singletons, newSingleton(name, factory)) ctx.singletons = append(ctx.singletons, newSingleton(name, factory, false))
}
func (ctx *TestContext) RegisterParallelSingletonType(name string, factory SingletonFactory) {
ctx.singletons = append(ctx.singletons, newSingleton(name, factory, true))
} }
func (ctx *TestContext) RegisterPreSingletonType(name string, factory SingletonFactory) { func (ctx *TestContext) RegisterPreSingletonType(name string, factory SingletonFactory) {

View File

@@ -27,7 +27,7 @@ func init() {
} }
func registerApexDepsInfoComponents(ctx android.RegistrationContext) { func registerApexDepsInfoComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("apex_depsinfo_singleton", apexDepsInfoSingletonFactory) ctx.RegisterParallelSingletonType("apex_depsinfo_singleton", apexDepsInfoSingletonFactory)
} }
type apexDepsInfoSingleton struct { type apexDepsInfoSingleton struct {

View File

@@ -33,7 +33,7 @@ func init() {
func registerApexKeyBuildComponents(ctx android.RegistrationContext) { func registerApexKeyBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("apex_key", ApexKeyFactory) ctx.RegisterModuleType("apex_key", ApexKeyFactory)
ctx.RegisterSingletonType("apex_keys_text", apexKeysTextFactory) ctx.RegisterParallelSingletonType("apex_keys_text", apexKeysTextFactory)
} }
type apexKey struct { type apexKey struct {

View File

@@ -51,7 +51,7 @@ func init() {
pctx.VariableConfigMethod("hostPrebuiltTag", android.Config.PrebuiltOS) pctx.VariableConfigMethod("hostPrebuiltTag", android.Config.PrebuiltOS)
pctx.SourcePathVariable("bloaty", "prebuilts/build-tools/${hostPrebuiltTag}/bin/bloaty") pctx.SourcePathVariable("bloaty", "prebuilts/build-tools/${hostPrebuiltTag}/bin/bloaty")
pctx.HostBinToolVariable("bloatyMerger", "bloaty_merger") pctx.HostBinToolVariable("bloatyMerger", "bloaty_merger")
android.RegisterSingletonType("file_metrics", fileSizesSingleton) android.RegisterParallelSingletonType("file_metrics", fileSizesSingleton)
fileSizeMeasurerKey = blueprint.NewProvider(measuredFiles{}) fileSizeMeasurerKey = blueprint.NewProvider(measuredFiles{})
} }

View File

@@ -83,7 +83,7 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) {
ctx.TopDown("sabi_deps", sabiDepsMutator) ctx.TopDown("sabi_deps", sabiDepsMutator)
}) })
ctx.RegisterSingletonType("kythe_extract_all", kytheExtractAllFactory) ctx.RegisterParallelSingletonType("kythe_extract_all", kytheExtractAllFactory)
} }
// Deps is a struct containing module names of dependencies, separated by the kind of dependency. // Deps is a struct containing module names of dependencies, separated by the kind of dependency.

View File

@@ -30,7 +30,7 @@ import (
// The info file is generated in $OUT/module_bp_cc_depend.json. // The info file is generated in $OUT/module_bp_cc_depend.json.
func init() { func init() {
android.RegisterSingletonType("ccdeps_generator", ccDepsGeneratorSingleton) android.RegisterParallelSingletonType("ccdeps_generator", ccDepsGeneratorSingleton)
} }
func ccDepsGeneratorSingleton() android.Singleton { func ccDepsGeneratorSingleton() android.Singleton {

View File

@@ -29,7 +29,7 @@ import (
// structure (see variable CLionOutputProjectsDirectory for root). // structure (see variable CLionOutputProjectsDirectory for root).
func init() { func init() {
android.RegisterSingletonType("cmakelists_generator", cMakeListsGeneratorSingleton) android.RegisterParallelSingletonType("cmakelists_generator", cMakeListsGeneratorSingleton)
} }
func cMakeListsGeneratorSingleton() android.Singleton { func cMakeListsGeneratorSingleton() android.Singleton {

View File

@@ -32,7 +32,7 @@ import (
// make SOONG_GEN_COMPDB=1 nothing to get all targets. // make SOONG_GEN_COMPDB=1 nothing to get all targets.
func init() { func init() {
android.RegisterSingletonType("compdb_generator", compDBGeneratorSingleton) android.RegisterParallelSingletonType("compdb_generator", compDBGeneratorSingleton)
} }
func compDBGeneratorSingleton() android.Singleton { func compDBGeneratorSingleton() android.Singleton {

View File

@@ -28,7 +28,7 @@ import (
func init() { func init() {
android.RegisterModuleType("cc_fuzz", LibFuzzFactory) android.RegisterModuleType("cc_fuzz", LibFuzzFactory)
android.RegisterSingletonType("cc_fuzz_packaging", fuzzPackagingFactory) android.RegisterParallelSingletonType("cc_fuzz_packaging", fuzzPackagingFactory)
} }
type FuzzProperties struct { type FuzzProperties struct {

View File

@@ -19,8 +19,8 @@ import (
) )
func init() { func init() {
android.RegisterSingletonType("ndk_abi_dump", NdkAbiDumpSingleton) android.RegisterParallelSingletonType("ndk_abi_dump", NdkAbiDumpSingleton)
android.RegisterSingletonType("ndk_abi_diff", NdkAbiDiffSingleton) android.RegisterParallelSingletonType("ndk_abi_diff", NdkAbiDiffSingleton)
} }
func getNdkAbiDumpInstallBase(ctx android.PathContext) android.OutputPath { func getNdkAbiDumpInstallBase(ctx android.PathContext) android.OutputPath {

View File

@@ -66,7 +66,7 @@ func RegisterNdkModuleTypes(ctx android.RegistrationContext) {
ctx.RegisterModuleType("ndk_library", NdkLibraryFactory) ctx.RegisterModuleType("ndk_library", NdkLibraryFactory)
ctx.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory) ctx.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory)
ctx.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory) ctx.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
ctx.RegisterSingletonType("ndk", NdkSingleton) ctx.RegisterParallelSingletonType("ndk", NdkSingleton)
} }
func getNdkInstallBase(ctx android.PathContext) android.InstallPath { func getNdkInstallBase(ctx android.PathContext) android.InstallPath {

View File

@@ -23,7 +23,7 @@ import (
func init() { func init() {
// Use singleton type to gather all generated soong modules. // Use singleton type to gather all generated soong modules.
android.RegisterSingletonType("stublibraries", stubLibrariesSingleton) android.RegisterParallelSingletonType("stublibraries", stubLibrariesSingleton)
} }
type stubLibraries struct { type stubLibraries struct {

View File

@@ -201,7 +201,7 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
} }
func init() { func init() {
android.RegisterSingletonType("tidy_phony_targets", TidyPhonySingleton) android.RegisterParallelSingletonType("tidy_phony_targets", TidyPhonySingleton)
} }
// This TidyPhonySingleton generates both tidy-* and obj-* phony targets for C/C++ files. // This TidyPhonySingleton generates both tidy-* and obj-* phony targets for C/C++ files.

View File

@@ -417,16 +417,16 @@ func VndkMutator(mctx android.BottomUpMutatorContext) {
func init() { func init() {
RegisterVndkLibraryTxtTypes(android.InitRegistrationContext) RegisterVndkLibraryTxtTypes(android.InitRegistrationContext)
android.RegisterSingletonType("vndk-snapshot", VndkSnapshotSingleton) android.RegisterParallelSingletonType("vndk-snapshot", VndkSnapshotSingleton)
} }
func RegisterVndkLibraryTxtTypes(ctx android.RegistrationContext) { func RegisterVndkLibraryTxtTypes(ctx android.RegistrationContext) {
ctx.RegisterSingletonModuleType("llndk_libraries_txt", llndkLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("llndk_libraries_txt", llndkLibrariesTxtFactory)
ctx.RegisterSingletonModuleType("vndksp_libraries_txt", vndkSPLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndksp_libraries_txt", vndkSPLibrariesTxtFactory)
ctx.RegisterSingletonModuleType("vndkcore_libraries_txt", vndkCoreLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndkcore_libraries_txt", vndkCoreLibrariesTxtFactory)
ctx.RegisterSingletonModuleType("vndkprivate_libraries_txt", vndkPrivateLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndkprivate_libraries_txt", vndkPrivateLibrariesTxtFactory)
ctx.RegisterSingletonModuleType("vndkproduct_libraries_txt", vndkProductLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndkproduct_libraries_txt", vndkProductLibrariesTxtFactory)
ctx.RegisterSingletonModuleType("vndkcorevariant_libraries_txt", vndkUsingCoreVariantLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndkcorevariant_libraries_txt", vndkUsingCoreVariantLibrariesTxtFactory)
} }
type vndkLibrariesTxt struct { type vndkLibrariesTxt struct {

View File

@@ -197,7 +197,7 @@ var pctx = android.NewPackageContext("android/soong/dexpreopt")
func init() { func init() {
pctx.Import("android/soong/android") pctx.Import("android/soong/android")
android.RegisterSingletonType("dexpreopt-soong-config", func() android.Singleton { android.RegisterParallelSingletonType("dexpreopt-soong-config", func() android.Singleton {
return &globalSoongConfigSingleton{} return &globalSoongConfigSingleton{}
}) })
} }

View File

@@ -465,7 +465,7 @@ func dexpreoptBootJarsFactory() android.SingletonModule {
} }
func RegisterDexpreoptBootJarsComponents(ctx android.RegistrationContext) { func RegisterDexpreoptBootJarsComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonModuleType("dex_bootjars", dexpreoptBootJarsFactory) ctx.RegisterParallelSingletonModuleType("dex_bootjars", dexpreoptBootJarsFactory)
} }
func SkipDexpreoptBootJars(ctx android.PathContext) bool { func SkipDexpreoptBootJars(ctx android.PathContext) bool {

View File

@@ -28,7 +28,7 @@ func init() {
} }
func RegisterDexpreoptCheckBuildComponents(ctx android.RegistrationContext) { func RegisterDexpreoptCheckBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonModuleType("dexpreopt_systemserver_check", dexpreoptSystemserverCheckFactory) ctx.RegisterParallelSingletonModuleType("dexpreopt_systemserver_check", dexpreoptSystemserverCheckFactory)
} }
// A build-time check to verify if all compilation artifacts of system server jars are installed // A build-time check to verify if all compilation artifacts of system server jars are installed

View File

@@ -38,7 +38,7 @@ func init() {
func RegisterJavaFuzzBuildComponents(ctx android.RegistrationContext) { func RegisterJavaFuzzBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("java_fuzz", JavaFuzzFactory) ctx.RegisterModuleType("java_fuzz", JavaFuzzFactory)
ctx.RegisterSingletonType("java_fuzz_packaging", javaFuzzPackagingFactory) ctx.RegisterParallelSingletonType("java_fuzz_packaging", javaFuzzPackagingFactory)
} }
type JavaFuzzTest struct { type JavaFuzzTest struct {

View File

@@ -25,7 +25,7 @@ func init() {
} }
func RegisterHiddenApiSingletonComponents(ctx android.RegistrationContext) { func RegisterHiddenApiSingletonComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("hiddenapi", hiddenAPISingletonFactory) ctx.RegisterParallelSingletonType("hiddenapi", hiddenAPISingletonFactory)
} }
var PrepareForTestWithHiddenApiBuildComponents = android.FixtureRegisterWithContext(RegisterHiddenApiSingletonComponents) var PrepareForTestWithHiddenApiBuildComponents = android.FixtureRegisterWithContext(RegisterHiddenApiSingletonComponents)

View File

@@ -73,8 +73,8 @@ func registerJavaBuildComponents(ctx android.RegistrationContext) {
ctx.BottomUp("jacoco_deps", jacocoDepsMutator).Parallel() ctx.BottomUp("jacoco_deps", jacocoDepsMutator).Parallel()
}) })
ctx.RegisterSingletonType("logtags", LogtagsSingleton) ctx.RegisterParallelSingletonType("logtags", LogtagsSingleton)
ctx.RegisterSingletonType("kythe_java_extract", kytheExtractJavaFactory) ctx.RegisterParallelSingletonType("kythe_java_extract", kytheExtractJavaFactory)
} }
func RegisterJavaSdkMemberTypes() { func RegisterJavaSdkMemberTypes() {

View File

@@ -26,7 +26,7 @@ import (
// called. Dependency info file is generated in $OUT/module_bp_java_depend.json. // called. Dependency info file is generated in $OUT/module_bp_java_depend.json.
func init() { func init() {
android.RegisterSingletonType("jdeps_generator", jDepsGeneratorSingleton) android.RegisterParallelSingletonType("jdeps_generator", jDepsGeneratorSingleton)
} }
func jDepsGeneratorSingleton() android.Singleton { func jDepsGeneratorSingleton() android.Singleton {

View File

@@ -705,7 +705,7 @@ func (l *lintSingleton) MakeVars(ctx android.MakeVarsContext) {
var _ android.SingletonMakeVarsProvider = (*lintSingleton)(nil) var _ android.SingletonMakeVarsProvider = (*lintSingleton)(nil)
func init() { func init() {
android.RegisterSingletonType("lint", android.RegisterParallelSingletonType("lint",
func() android.Singleton { return &lintSingleton{} }) func() android.Singleton { return &lintSingleton{} })
registerLintBuildComponents(android.InitRegistrationContext) registerLintBuildComponents(android.InitRegistrationContext)

View File

@@ -26,7 +26,7 @@ func init() {
} }
func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContext) { func registerPlatformBootclasspathBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonModuleType("platform_bootclasspath", platformBootclasspathFactory) ctx.RegisterParallelSingletonModuleType("platform_bootclasspath", platformBootclasspathFactory)
} }
// The tags used for the dependencies between the platform bootclasspath and any configured boot // The tags used for the dependencies between the platform bootclasspath and any configured boot

View File

@@ -36,7 +36,7 @@ var CompatConfigSdkMemberType = &compatConfigMemberType{
} }
func registerPlatformCompatConfigBuildComponents(ctx android.RegistrationContext) { func registerPlatformCompatConfigBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("platform_compat_config_singleton", platformCompatConfigSingletonFactory) ctx.RegisterParallelSingletonType("platform_compat_config_singleton", platformCompatConfigSingletonFactory)
ctx.RegisterModuleType("platform_compat_config", PlatformCompatConfigFactory) ctx.RegisterModuleType("platform_compat_config", PlatformCompatConfigFactory)
ctx.RegisterModuleType("prebuilt_platform_compat_config", prebuiltCompatConfigFactory) ctx.RegisterModuleType("prebuilt_platform_compat_config", prebuiltCompatConfigFactory)
ctx.RegisterModuleType("global_compat_config", globalCompatConfigFactory) ctx.RegisterModuleType("global_compat_config", globalCompatConfigFactory)

View File

@@ -28,7 +28,7 @@ import (
func init() { func init() {
android.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory) android.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory)
android.RegisterSingletonType("sdk", sdkSingletonFactory) android.RegisterParallelSingletonType("sdk", sdkSingletonFactory)
android.RegisterMakeVarsProvider(pctx, sdkMakeVars) android.RegisterMakeVarsProvider(pctx, sdkMakeVars)
} }

View File

@@ -20,7 +20,7 @@ import (
) )
func init() { func init() {
android.RegisterSingletonType("update-meta", UpdateMetaSingleton) android.RegisterParallelSingletonType("update-meta", UpdateMetaSingleton)
} }
func UpdateMetaSingleton() android.Singleton { func UpdateMetaSingleton() android.Singleton {

View File

@@ -51,7 +51,7 @@ func init() {
} }
func RegisterProvenanceSingleton(ctx android.RegistrationContext) { func RegisterProvenanceSingleton(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("provenance_metadata_singleton", provenanceInfoSingletonFactory) ctx.RegisterParallelSingletonType("provenance_metadata_singleton", provenanceInfoSingletonFactory)
} }
var PrepareForTestWithProvenanceSingleton = android.FixtureRegisterWithContext(RegisterProvenanceSingleton) var PrepareForTestWithProvenanceSingleton = android.FixtureRegisterWithContext(RegisterProvenanceSingleton)

View File

@@ -19,7 +19,7 @@ import (
) )
func init() { func init() {
android.RegisterSingletonType("rustdoc", RustdocSingleton) android.RegisterParallelSingletonType("rustdoc", RustdocSingleton)
} }
func RustdocSingleton() android.Singleton { func RustdocSingleton() android.Singleton {

View File

@@ -74,7 +74,7 @@ func rustProjectGeneratorSingleton() android.Singleton {
} }
func init() { func init() {
android.RegisterSingletonType("rust_project_generator", rustProjectGeneratorSingleton) android.RegisterParallelSingletonType("rust_project_generator", rustProjectGeneratorSingleton)
} }
// sourceProviderVariantSource returns the path to the source file if this // sourceProviderVariantSource returns the path to the source file if this

View File

@@ -45,7 +45,7 @@ func init() {
}) })
pctx.Import("android/soong/rust/config") pctx.Import("android/soong/rust/config")
pctx.ImportAs("cc_config", "android/soong/cc/config") pctx.ImportAs("cc_config", "android/soong/cc/config")
android.InitRegistrationContext.RegisterSingletonType("kythe_rust_extract", kytheExtractRustFactory) android.InitRegistrationContext.RegisterParallelSingletonType("kythe_rust_extract", kytheExtractRustFactory)
} }
type Flags struct { type Flags struct {

View File

@@ -200,8 +200,8 @@ func registerRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
ctx.BottomUp("rust_stdlinkage", LibstdMutator).Parallel() ctx.BottomUp("rust_stdlinkage", LibstdMutator).Parallel()
ctx.BottomUp("rust_begin", BeginMutator).Parallel() ctx.BottomUp("rust_begin", BeginMutator).Parallel()
}) })
ctx.RegisterSingletonType("rust_project_generator", rustProjectGeneratorSingleton) ctx.RegisterParallelSingletonType("rust_project_generator", rustProjectGeneratorSingleton)
ctx.RegisterSingletonType("kythe_rust_extract", kytheExtractRustFactory) ctx.RegisterParallelSingletonType("kythe_rust_extract", kytheExtractRustFactory)
ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) { ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("rust_sanitizers", rustSanitizerRuntimeMutator).Parallel() ctx.BottomUp("rust_sanitizers", rustSanitizerRuntimeMutator).Parallel()
}) })

View File

@@ -75,7 +75,7 @@ type hostSnapshotFakeJsonFlags struct {
} }
func registerHostSnapshotComponents(ctx android.RegistrationContext) { func registerHostSnapshotComponents(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("host-fake-snapshot", HostToolsFakeAndroidSingleton) ctx.RegisterParallelSingletonType("host-fake-snapshot", HostToolsFakeAndroidSingleton)
} }
type hostFakeSingleton struct { type hostFakeSingleton struct {

View File

@@ -68,7 +68,7 @@ var RecoverySnapshotImageName = "recovery"
type RecoverySnapshotImage struct{} type RecoverySnapshotImage struct{}
func (RecoverySnapshotImage) Init(ctx android.RegistrationContext) { func (RecoverySnapshotImage) Init(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("recovery-snapshot", RecoverySnapshotSingleton) ctx.RegisterParallelSingletonType("recovery-snapshot", RecoverySnapshotSingleton)
} }
func (RecoverySnapshotImage) RegisterAdditionalModule(ctx android.RegistrationContext, name string, factory android.ModuleFactory) { func (RecoverySnapshotImage) RegisterAdditionalModule(ctx android.RegistrationContext, name string, factory android.ModuleFactory) {

View File

@@ -78,8 +78,8 @@ var VendorSnapshotImageName = "vendor"
type VendorSnapshotImage struct{} type VendorSnapshotImage struct{}
func (VendorSnapshotImage) Init(ctx android.RegistrationContext) { func (VendorSnapshotImage) Init(ctx android.RegistrationContext) {
ctx.RegisterSingletonType("vendor-snapshot", VendorSnapshotSingleton) ctx.RegisterParallelSingletonType("vendor-snapshot", VendorSnapshotSingleton)
ctx.RegisterSingletonType("vendor-fake-snapshot", VendorFakeSnapshotSingleton) ctx.RegisterParallelSingletonType("vendor-fake-snapshot", VendorFakeSnapshotSingleton)
} }
func (VendorSnapshotImage) RegisterAdditionalModule(ctx android.RegistrationContext, name string, factory android.ModuleFactory) { func (VendorSnapshotImage) RegisterAdditionalModule(ctx android.RegistrationContext, name string, factory android.ModuleFactory) {