Change CommonModuleInfoProvider to a pointer.
Bug: 358427516
Test: Manually verified genereated ninja and mk files, unit tests.
Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
diff --git a/rust/doc.go b/rust/doc.go
index cf2f8b3..3616c8e 100644
--- a/rust/doc.go
+++ b/rust/doc.go
@@ -38,7 +38,7 @@
FlagWithArg("-D ", docDir.String())
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
+ if !android.OtherModulePointerProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
diff --git a/rust/rust.go b/rust/rust.go
index 5f3d7a9..54b5d92 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -1480,10 +1480,10 @@
rustInfo, hasRustInfo := android.OtherModuleProvider(ctx, dep, RustInfoProvider)
ccInfo, _ := android.OtherModuleProvider(ctx, dep, cc.CcInfoProvider)
linkableInfo, hasLinkableInfo := android.OtherModuleProvider(ctx, dep, cc.LinkableInfoProvider)
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
+ commonInfo := android.OtherModulePointerProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
if hasRustInfo && !linkableInfo.Static && !linkableInfo.Shared {
//Handle Rust Modules
- makeLibName := rustMakeLibName(rustInfo, linkableInfo, &commonInfo, depName+rustInfo.RustSubName)
+ makeLibName := rustMakeLibName(rustInfo, linkableInfo, commonInfo, depName+rustInfo.RustSubName)
switch {
case depTag == dylibDepTag:
@@ -1628,7 +1628,7 @@
}
} else if hasLinkableInfo {
//Handle C dependencies
- makeLibName := cc.MakeLibName(ccInfo, linkableInfo, &commonInfo, depName)
+ makeLibName := cc.MakeLibName(ccInfo, linkableInfo, commonInfo, depName)
if !hasRustInfo {
if commonInfo.Target.Os != ctx.Os() {
ctx.ModuleErrorf("OS mismatch between %q and %q", ctx.ModuleName(), depName)
diff --git a/rust/test.go b/rust/test.go
index 2fed0d6..cedced2 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -165,7 +165,7 @@
if linkableDep.OutputFile.Valid() {
// Copy the output in "lib[64]" so that it's compatible with
// the default rpath values.
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
+ commonInfo := android.OtherModulePointerProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
libDir := "lib"
if commonInfo.Target.Arch.ArchType.Multilib == "lib64" {
libDir = "lib64"