diff options
| -rw-r--r-- | aconfig/all_aconfig_declarations.go | 2 | ||||
| -rw-r--r-- | aconfig/build_flags/build_flags_singleton.go | 5 | ||||
| -rw-r--r-- | android/variable.go | 1 | ||||
| -rw-r--r-- | bloaty/bloaty.go | 4 | ||||
| -rw-r--r-- | cc/api_level.go | 6 | ||||
| -rw-r--r-- | cc/cc.go | 48 | ||||
| -rw-r--r-- | cc/llndk_library.go | 39 | ||||
| -rw-r--r-- | java/testing.go | 1 | ||||
| -rw-r--r-- | rust/doc.go | 10 | ||||
| -rw-r--r-- | rust/rust.go | 2 | ||||
| -rw-r--r-- | scripts/gen_build_prop.py | 3 |
11 files changed, 81 insertions, 40 deletions
diff --git a/aconfig/all_aconfig_declarations.go b/aconfig/all_aconfig_declarations.go index 3d07e16dc..e3ef7ddcc 100644 --- a/aconfig/all_aconfig_declarations.go +++ b/aconfig/all_aconfig_declarations.go @@ -111,7 +111,7 @@ func (this *allAconfigDeclarationsSingleton) GenerateSingletonBuildActions(ctx a // Find all of the aconfig_declarations modules var packages = make(map[string]int) var cacheFiles android.Paths - ctx.VisitAllModules(func(module android.Module) { + ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { decl, ok := android.OtherModuleProvider(ctx, module, android.AconfigReleaseDeclarationsProviderKey) if !ok { return diff --git a/aconfig/build_flags/build_flags_singleton.go b/aconfig/build_flags/build_flags_singleton.go index e375d9c70..3a06e72d6 100644 --- a/aconfig/build_flags/build_flags_singleton.go +++ b/aconfig/build_flags/build_flags_singleton.go @@ -15,8 +15,9 @@ package build_flags import ( - "android/soong/android" "fmt" + + "android/soong/android" ) // A singleton module that collects all of the build flags declared in the @@ -42,7 +43,7 @@ func (this *allBuildFlagDeclarationsSingleton) GenerateBuildActions(ctx android. var flagsFiles android.Paths // Find all of the release_config_contribution modules var contributionDirs android.Paths - ctx.VisitAllModules(func(module android.Module) { + ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { decl, ok := android.OtherModuleProvider(ctx, module, BuildFlagDeclarationsProviderKey) if ok { flagsFiles = append(flagsFiles, decl.IntermediateCacheOutputPath) diff --git a/android/variable.go b/android/variable.go index 5bc0b297e..853d8efb7 100644 --- a/android/variable.go +++ b/android/variable.go @@ -216,6 +216,7 @@ type ProductVariables struct { Platform_display_version_name *string `json:",omitempty"` Platform_version_name *string `json:",omitempty"` Platform_sdk_version *int `json:",omitempty"` + Platform_sdk_minor_version *int `json:",omitempty"` Platform_sdk_codename *string `json:",omitempty"` Platform_sdk_version_or_codename *string `json:",omitempty"` Platform_sdk_final *bool `json:",omitempty"` diff --git a/bloaty/bloaty.go b/bloaty/bloaty.go index 26f2aa879..7f56050e9 100644 --- a/bloaty/bloaty.go +++ b/bloaty/bloaty.go @@ -84,8 +84,8 @@ func fileSizesSingleton() android.Singleton { func (singleton *sizesSingleton) GenerateBuildActions(ctx android.SingletonContext) { var deps android.Paths - ctx.VisitAllModules(func(m android.Module) { - if !m.ExportedToMake() { + ctx.VisitAllModuleProxies(func(m android.ModuleProxy) { + if !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoKey).ExportedToMake { return } filePaths, ok := android.OtherModuleProvider(ctx, m, fileSizeMeasurerKey) diff --git a/cc/api_level.go b/cc/api_level.go index deca72366..fa8dfaf2f 100644 --- a/cc/api_level.go +++ b/cc/api_level.go @@ -31,11 +31,7 @@ func MinApiForArch(ctx android.EarlyModuleContext, case android.Arm64, android.X86_64: return android.FirstLp64Version case android.Riscv64: - apiLevel, err := android.ApiLevelFromUser(ctx, "VanillaIceCream") - if err != nil { - panic(err) - } - return apiLevel + return android.FutureApiLevel default: panic(fmt.Errorf("Unknown arch %q", arch)) } @@ -81,12 +81,13 @@ type LinkerInfo struct { HeaderLibs []string ImplementationModuleName *string - BinaryDecoratorInfo *BinaryDecoratorInfo - LibraryDecoratorInfo *LibraryDecoratorInfo - TestBinaryInfo *TestBinaryInfo - BenchmarkDecoratorInfo *BenchmarkDecoratorInfo - ObjectLinkerInfo *ObjectLinkerInfo - StubDecoratorInfo *StubDecoratorInfo + BinaryDecoratorInfo *BinaryDecoratorInfo + LibraryDecoratorInfo *LibraryDecoratorInfo + TestBinaryInfo *TestBinaryInfo + BenchmarkDecoratorInfo *BenchmarkDecoratorInfo + ObjectLinkerInfo *ObjectLinkerInfo + StubDecoratorInfo *StubDecoratorInfo + PrebuiltLibraryLinkerInfo *PrebuiltLibraryLinkerInfo } type BinaryDecoratorInfo struct{} @@ -96,6 +97,7 @@ type LibraryDecoratorInfo struct { // Location of the static library in the sysroot. Empty if the library is // not included in the NDK. NdkSysrootPath android.Path + VndkFileName string } type SnapshotInfo struct { @@ -120,6 +122,10 @@ type ObjectLinkerInfo struct { NdkSysrootPath android.Path } +type PrebuiltLibraryLinkerInfo struct { + VndkFileName string +} + type LibraryInfo struct { BuildStubs bool } @@ -128,6 +134,13 @@ type InstallerInfo struct { StubDecoratorInfo *StubDecoratorInfo } +type LocalOrGlobalFlagsInfo struct { + CommonFlags []string // Flags that apply to C, C++, and assembly source files + CFlags []string // Flags that apply to C and C++ source files + ConlyFlags []string // Flags that apply to C source files + CppFlags []string // Flags that apply to C++ source files +} + // Common info about the cc module. type CcInfo struct { IsPrebuilt bool @@ -148,6 +161,7 @@ type LinkableInfo struct { StaticExecutable bool Static bool Shared bool + Header bool HasStubsVariants bool StubsVersion string IsStubs bool @@ -195,7 +209,11 @@ type LinkableInfo struct { APIListCoverageXMLPath android.ModuleOutPath // FuzzSharedLibraries returns the shared library dependencies for this module. // Expects that IsFuzzModule returns true. - FuzzSharedLibraries android.RuleBuilderInstalls + FuzzSharedLibraries android.RuleBuilderInstalls + IsVndkPrebuiltLibrary bool + HasLLNDKStubs bool + IsLLNDKMovedToApex bool + ImplementationModuleName string } var LinkableInfoProvider = blueprint.NewProvider[*LinkableInfo]() @@ -2356,9 +2374,11 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { case *binaryDecorator: ccInfo.LinkerInfo.BinaryDecoratorInfo = &BinaryDecoratorInfo{} case *libraryDecorator: + lk := c.linker.(*libraryDecorator) ccInfo.LinkerInfo.LibraryDecoratorInfo = &LibraryDecoratorInfo{ - InjectBsslHash: Bool(c.linker.(*libraryDecorator).Properties.Inject_bssl_hash), - NdkSysrootPath: c.linker.(*libraryDecorator).ndkSysrootPath, + InjectBsslHash: Bool(lk.Properties.Inject_bssl_hash), + NdkSysrootPath: lk.ndkSysrootPath, + VndkFileName: lk.getLibNameHelper(c.BaseModuleName(), true, false) + ".so", } case *testBinary: ccInfo.LinkerInfo.TestBinaryInfo = &TestBinaryInfo{ @@ -2372,6 +2392,11 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { } case *stubDecorator: ccInfo.LinkerInfo.StubDecoratorInfo = &StubDecoratorInfo{} + case *prebuiltLibraryLinker: + ccInfo.LinkerInfo.PrebuiltLibraryLinkerInfo = &PrebuiltLibraryLinkerInfo{ + VndkFileName: c.linker.(*prebuiltLibraryLinker).getLibNameHelper( + c.BaseModuleName(), true, false) + ".so", + } } if s, ok := c.linker.(SnapshotInterface); ok { @@ -2441,12 +2466,17 @@ func CreateCommonLinkableInfo(ctx android.ModuleContext, mod VersionedLinkableIn Multilib: mod.Multilib(), ImplementationModuleNameForMake: mod.ImplementationModuleNameForMake(), Symlinks: mod.Symlinks(), + Header: mod.Header(), + IsVndkPrebuiltLibrary: mod.IsVndkPrebuiltLibrary(), } vi := mod.VersionedInterface() if vi != nil { info.IsStubsImplementationRequired = vi.IsStubsImplementationRequired() info.APIListCoverageXMLPath = vi.GetAPIListCoverageXMLPath() + info.HasLLNDKStubs = vi.HasLLNDKStubs() + info.IsLLNDKMovedToApex = vi.IsLLNDKMovedToApex() + info.ImplementationModuleName = vi.ImplementationModuleName(mod.BaseModuleName()) } if !mod.PreventInstall() && fuzz.IsValid(ctx, mod.FuzzModuleStruct()) && mod.IsFuzzModule() { diff --git a/cc/llndk_library.go b/cc/llndk_library.go index 8ca3ca184..b119fdac1 100644 --- a/cc/llndk_library.go +++ b/cc/llndk_library.go @@ -82,11 +82,10 @@ type movedToApexLlndkLibraries struct { func (s *movedToApexLlndkLibraries) GenerateBuildActions(ctx android.SingletonContext) { // Make uses LLNDK_MOVED_TO_APEX_LIBRARIES to generate the linker config. movedToApexLlndkLibrariesMap := make(map[string]bool) - ctx.VisitAllModules(func(module android.Module) { - if library := moduleVersionedInterface(module); library != nil && library.HasLLNDKStubs() { - if library.IsLLNDKMovedToApex() { - name := library.ImplementationModuleName(module.(*Module).BaseModuleName()) - movedToApexLlndkLibrariesMap[name] = true + ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { + if library, ok := android.OtherModuleProvider(ctx, module, LinkableInfoProvider); ok { + if library.HasLLNDKStubs && library.IsLLNDKMovedToApex { + movedToApexLlndkLibrariesMap[library.ImplementationModuleName] = true } } }) @@ -151,14 +150,16 @@ func (txt *llndkLibrariesTxtModule) GenerateAndroidBuildActions(ctx android.Modu etc.SetCommonPrebuiltEtcInfo(ctx, txt) } -func getVndkFileName(m *Module) (string, error) { - if library, ok := m.linker.(*libraryDecorator); ok { - return library.getLibNameHelper(m.BaseModuleName(), true, false) + ".so", nil - } - if prebuilt, ok := m.linker.(*prebuiltLibraryLinker); ok { - return prebuilt.libraryDecorator.getLibNameHelper(m.BaseModuleName(), true, false) + ".so", nil +func getVndkFileName(info *LinkerInfo) (string, error) { + if info != nil { + if info.LibraryDecoratorInfo != nil { + return info.LibraryDecoratorInfo.VndkFileName, nil + } + if info.PrebuiltLibraryLinkerInfo != nil { + return info.PrebuiltLibraryLinkerInfo.VndkFileName, nil + } } - return "", fmt.Errorf("VNDK library should have libraryDecorator or prebuiltLibraryLinker as linker: %T", m.linker) + return "", fmt.Errorf("VNDK library should have libraryDecorator or prebuiltLibraryLinker as linker: %T", info) } func (txt *llndkLibrariesTxtModule) GenerateSingletonBuildActions(ctx android.SingletonContext) { @@ -167,9 +168,17 @@ func (txt *llndkLibrariesTxtModule) GenerateSingletonBuildActions(ctx android.Si return } - ctx.VisitAllModules(func(m android.Module) { - if c, ok := m.(*Module); ok && c.VendorProperties.IsLLNDK && !c.Header() && !c.IsVndkPrebuiltLibrary() { - filename, err := getVndkFileName(c) + ctx.VisitAllModuleProxies(func(m android.ModuleProxy) { + ccInfo, ok := android.OtherModuleProvider(ctx, m, CcInfoProvider) + if !ok { + return + } + linkableInfo, ok := android.OtherModuleProvider(ctx, m, LinkableInfoProvider) + if !ok { + return + } + if linkableInfo.IsLlndk && !linkableInfo.Header && !linkableInfo.IsVndkPrebuiltLibrary { + filename, err := getVndkFileName(ccInfo.LinkerInfo) if err != nil { ctx.ModuleErrorf(m, "%s", err) } diff --git a/java/testing.go b/java/testing.go index 3abbb8453..d7878d68d 100644 --- a/java/testing.go +++ b/java/testing.go @@ -424,7 +424,6 @@ func gatherRequiredDepsForTest() string { "kotlin-stdlib-jdk8", "kotlin-annotations", "stub-annotations", - "aconfig-annotations-lib", "aconfig_storage_stub", "unsupportedappusage", diff --git a/rust/doc.go b/rust/doc.go index fe205233d..2fb6ba98e 100644 --- a/rust/doc.go +++ b/rust/doc.go @@ -37,14 +37,14 @@ func (n *rustdocSingleton) GenerateBuildActions(ctx android.SingletonContext) { FlagWithArg("-C ", docDir.String()). FlagWithArg("-D ", docDir.String()) - ctx.VisitAllModules(func(module android.Module) { - if !module.Enabled(ctx) { + ctx.VisitAllModuleProxies(func(module android.ModuleProxy) { + if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled { return } - if m, ok := module.(*Module); ok { - if m.docTimestampFile.Valid() { - zipCmd.Implicit(m.docTimestampFile.Path()) + if m, ok := android.OtherModuleProvider(ctx, module, RustInfoProvider); ok { + if m.DocTimestampFile.Valid() { + zipCmd.Implicit(m.DocTimestampFile.Path()) } } }) diff --git a/rust/rust.go b/rust/rust.go index d8a044423..2e3d846dd 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -61,6 +61,7 @@ type RustInfo struct { SnapshotInfo *cc.SnapshotInfo SourceProviderInfo *SourceProviderInfo XrefRustFiles android.Paths + DocTimestampFile android.OptionalPath } var RustInfoProvider = blueprint.NewProvider[*RustInfo]() @@ -1173,6 +1174,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { RustSubName: mod.Properties.RustSubName, TransitiveAndroidMkSharedLibs: mod.transitiveAndroidMkSharedLibs, XrefRustFiles: mod.XrefRustFiles(), + DocTimestampFile: mod.docTimestampFile, } if mod.compiler != nil { rustInfo.CompilerInfo = &CompilerInfo{ diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py index 74befd5de..a0d25465c 100644 --- a/scripts/gen_build_prop.py +++ b/scripts/gen_build_prop.py @@ -113,6 +113,7 @@ def generate_common_build_props(args): print("####################################") config = args.config + build_flags = config["BuildFlags"] partition = args.partition if partition == "system": @@ -164,6 +165,7 @@ def generate_common_build_props(args): print(f"ro.{partition}.build.version.release={config['Platform_version_last_stable']}") print(f"ro.{partition}.build.version.release_or_codename={config['Platform_version_name']}") print(f"ro.{partition}.build.version.sdk={config['Platform_sdk_version']}") + print(f"ro.{partition}.build.version.sdk_minor={build_flags['RELEASE_PLATFORM_SDK_MINOR_VERSION']}") def generate_build_info(args): print() @@ -196,6 +198,7 @@ def generate_build_info(args): print(f"ro.build.display.id?={config['BuildDesc']}") print(f"ro.build.version.incremental={config['BuildNumber']}") print(f"ro.build.version.sdk={config['Platform_sdk_version']}") + print(f"ro.build.version.sdk_minor={build_flags['RELEASE_PLATFORM_SDK_MINOR_VERSION']}") print(f"ro.build.version.preview_sdk={config['Platform_preview_sdk_version']}") print(f"ro.build.version.preview_sdk_fingerprint={config['PlatformPreviewSdkFingerprint']}") print(f"ro.build.version.codename={config['Platform_sdk_codename']}") |