Loading rust/androidmk.go +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ func (mod *Module) AndroidMkEntries() []android.AndroidMkEntries { entries.AddStrings("LOCAL_RLIB_LIBRARIES", mod.Properties.AndroidMkRlibs...) entries.AddStrings("LOCAL_DYLIB_LIBRARIES", mod.Properties.AndroidMkDylibs...) entries.AddStrings("LOCAL_PROC_MACRO_LIBRARIES", mod.Properties.AndroidMkProcMacroLibs...) entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.Properties.AndroidMkSharedLibs...) entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.transitiveAndroidMkSharedLibs.ToList()...) entries.AddStrings("LOCAL_STATIC_LIBRARIES", mod.Properties.AndroidMkStaticLibs...) entries.AddStrings("LOCAL_SOONG_LINK_TYPE", mod.makeLinkType) if mod.UseVndk() { Loading rust/binary_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ func TestStaticBinaryFlags(t *testing.T) { if !android.InList("libc", fizzMod.Properties.AndroidMkStaticLibs) { t.Errorf("static binary not linking against libc as a static library") } if len(fizzMod.Properties.AndroidMkSharedLibs) > 0 { if len(fizzMod.transitiveAndroidMkSharedLibs.ToList()) > 0 { t.Errorf("static binary incorrectly linking against shared libraries") } } Loading rust/rust.go +10 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ type BaseProperties struct { AndroidMkRlibs []string `blueprint:"mutated"` AndroidMkDylibs []string `blueprint:"mutated"` AndroidMkProcMacroLibs []string `blueprint:"mutated"` AndroidMkSharedLibs []string `blueprint:"mutated"` AndroidMkStaticLibs []string `blueprint:"mutated"` ImageVariationPrefix string `blueprint:"mutated"` Loading Loading @@ -168,6 +167,8 @@ type Module struct { // For apex variants, this is set as apex.min_sdk_version apexSdkVersion android.ApiLevel transitiveAndroidMkSharedLibs *android.DepSet[string] } func (mod *Module) Header() bool { Loading Loading @@ -1218,6 +1219,9 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { }) } var transitiveAndroidMkSharedLibs []*android.DepSet[string] var directAndroidMkSharedLibs []string ctx.VisitDirectDeps(func(dep android.Module) { depName := ctx.OtherModuleName(dep) depTag := ctx.OtherModuleDependencyTag(dep) Loading Loading @@ -1261,6 +1265,8 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { mod.Properties.AndroidMkProcMacroLibs = append(mod.Properties.AndroidMkProcMacroLibs, makeLibName) } transitiveAndroidMkSharedLibs = append(transitiveAndroidMkSharedLibs, rustDep.transitiveAndroidMkSharedLibs) if android.IsSourceDepTagWithOutputTag(depTag, "") { // Since these deps are added in path_properties.go via AddDependencies, we need to ensure the correct // OS/Arch variant is used. Loading Loading @@ -1388,7 +1394,7 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { // Record baseLibName for snapshots. mod.Properties.SnapshotSharedLibs = append(mod.Properties.SnapshotSharedLibs, cc.BaseLibName(depName)) mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, makeLibName) directAndroidMkSharedLibs = append(directAndroidMkSharedLibs, makeLibName) exportDep = true case cc.IsHeaderDepTag(depTag): exportedInfo := ctx.OtherModuleProvider(dep, cc.FlagExporterInfoProvider).(cc.FlagExporterInfo) Loading Loading @@ -1425,6 +1431,8 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { } }) mod.transitiveAndroidMkSharedLibs = android.NewDepSet[string](android.PREORDER, directAndroidMkSharedLibs, transitiveAndroidMkSharedLibs) var rlibDepFiles RustLibraries for _, dep := range directRlibDeps { rlibDepFiles = append(rlibDepFiles, RustLibrary{Path: dep.UnstrippedOutputFile(), CrateName: dep.CrateName()}) Loading rust/rust_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -267,7 +267,7 @@ func TestDepsTracking(t *testing.T) { t.Errorf("Proc_macro dependency not detected (dependency missing from AndroidMkProcMacroLibs)") } if !android.InList("libshared", module.Properties.AndroidMkSharedLibs) { if !android.InList("libshared", module.transitiveAndroidMkSharedLibs.ToList()) { t.Errorf("Shared library dependency not detected (dependency missing from AndroidMkSharedLibs)") } Loading rust/vendor_snapshot_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -1063,7 +1063,7 @@ func TestVendorSnapshotUse(t *testing.T) { } } libclientAndroidMkSharedLibs := ctx.ModuleForTests("libclient", sharedVariant).Module().(*Module).Properties.AndroidMkSharedLibs libclientAndroidMkSharedLibs := ctx.ModuleForTests("libclient", sharedVariant).Module().(*Module).transitiveAndroidMkSharedLibs.ToList() if g, w := libclientAndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor", "lib64", "liblog.vendor", "libc.vendor", "libm.vendor", "libdl.vendor"}; !reflect.DeepEqual(g, w) { t.Errorf("wanted libclient AndroidMkSharedLibs %q, got %q", w, g) } Loading @@ -1078,7 +1078,7 @@ func TestVendorSnapshotUse(t *testing.T) { t.Errorf("wanted libclient libclientAndroidMkDylibs %q, got %q", w, libclientAndroidMkDylibs) } libclient32AndroidMkSharedLibs := ctx.ModuleForTests("libclient", shared32Variant).Module().(*Module).Properties.AndroidMkSharedLibs libclient32AndroidMkSharedLibs := ctx.ModuleForTests("libclient", shared32Variant).Module().(*Module).transitiveAndroidMkSharedLibs.ToList() if g, w := libclient32AndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor", "lib32", "liblog.vendor", "libc.vendor", "libm.vendor", "libdl.vendor"}; !reflect.DeepEqual(g, w) { t.Errorf("wanted libclient32 AndroidMkSharedLibs %q, got %q", w, g) } Loading Loading
rust/androidmk.go +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ func (mod *Module) AndroidMkEntries() []android.AndroidMkEntries { entries.AddStrings("LOCAL_RLIB_LIBRARIES", mod.Properties.AndroidMkRlibs...) entries.AddStrings("LOCAL_DYLIB_LIBRARIES", mod.Properties.AndroidMkDylibs...) entries.AddStrings("LOCAL_PROC_MACRO_LIBRARIES", mod.Properties.AndroidMkProcMacroLibs...) entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.Properties.AndroidMkSharedLibs...) entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.transitiveAndroidMkSharedLibs.ToList()...) entries.AddStrings("LOCAL_STATIC_LIBRARIES", mod.Properties.AndroidMkStaticLibs...) entries.AddStrings("LOCAL_SOONG_LINK_TYPE", mod.makeLinkType) if mod.UseVndk() { Loading
rust/binary_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ func TestStaticBinaryFlags(t *testing.T) { if !android.InList("libc", fizzMod.Properties.AndroidMkStaticLibs) { t.Errorf("static binary not linking against libc as a static library") } if len(fizzMod.Properties.AndroidMkSharedLibs) > 0 { if len(fizzMod.transitiveAndroidMkSharedLibs.ToList()) > 0 { t.Errorf("static binary incorrectly linking against shared libraries") } } Loading
rust/rust.go +10 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ type BaseProperties struct { AndroidMkRlibs []string `blueprint:"mutated"` AndroidMkDylibs []string `blueprint:"mutated"` AndroidMkProcMacroLibs []string `blueprint:"mutated"` AndroidMkSharedLibs []string `blueprint:"mutated"` AndroidMkStaticLibs []string `blueprint:"mutated"` ImageVariationPrefix string `blueprint:"mutated"` Loading Loading @@ -168,6 +167,8 @@ type Module struct { // For apex variants, this is set as apex.min_sdk_version apexSdkVersion android.ApiLevel transitiveAndroidMkSharedLibs *android.DepSet[string] } func (mod *Module) Header() bool { Loading Loading @@ -1218,6 +1219,9 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { }) } var transitiveAndroidMkSharedLibs []*android.DepSet[string] var directAndroidMkSharedLibs []string ctx.VisitDirectDeps(func(dep android.Module) { depName := ctx.OtherModuleName(dep) depTag := ctx.OtherModuleDependencyTag(dep) Loading Loading @@ -1261,6 +1265,8 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { mod.Properties.AndroidMkProcMacroLibs = append(mod.Properties.AndroidMkProcMacroLibs, makeLibName) } transitiveAndroidMkSharedLibs = append(transitiveAndroidMkSharedLibs, rustDep.transitiveAndroidMkSharedLibs) if android.IsSourceDepTagWithOutputTag(depTag, "") { // Since these deps are added in path_properties.go via AddDependencies, we need to ensure the correct // OS/Arch variant is used. Loading Loading @@ -1388,7 +1394,7 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { // Record baseLibName for snapshots. mod.Properties.SnapshotSharedLibs = append(mod.Properties.SnapshotSharedLibs, cc.BaseLibName(depName)) mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, makeLibName) directAndroidMkSharedLibs = append(directAndroidMkSharedLibs, makeLibName) exportDep = true case cc.IsHeaderDepTag(depTag): exportedInfo := ctx.OtherModuleProvider(dep, cc.FlagExporterInfoProvider).(cc.FlagExporterInfo) Loading Loading @@ -1425,6 +1431,8 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { } }) mod.transitiveAndroidMkSharedLibs = android.NewDepSet[string](android.PREORDER, directAndroidMkSharedLibs, transitiveAndroidMkSharedLibs) var rlibDepFiles RustLibraries for _, dep := range directRlibDeps { rlibDepFiles = append(rlibDepFiles, RustLibrary{Path: dep.UnstrippedOutputFile(), CrateName: dep.CrateName()}) Loading
rust/rust_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -267,7 +267,7 @@ func TestDepsTracking(t *testing.T) { t.Errorf("Proc_macro dependency not detected (dependency missing from AndroidMkProcMacroLibs)") } if !android.InList("libshared", module.Properties.AndroidMkSharedLibs) { if !android.InList("libshared", module.transitiveAndroidMkSharedLibs.ToList()) { t.Errorf("Shared library dependency not detected (dependency missing from AndroidMkSharedLibs)") } Loading
rust/vendor_snapshot_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -1063,7 +1063,7 @@ func TestVendorSnapshotUse(t *testing.T) { } } libclientAndroidMkSharedLibs := ctx.ModuleForTests("libclient", sharedVariant).Module().(*Module).Properties.AndroidMkSharedLibs libclientAndroidMkSharedLibs := ctx.ModuleForTests("libclient", sharedVariant).Module().(*Module).transitiveAndroidMkSharedLibs.ToList() if g, w := libclientAndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor", "lib64", "liblog.vendor", "libc.vendor", "libm.vendor", "libdl.vendor"}; !reflect.DeepEqual(g, w) { t.Errorf("wanted libclient AndroidMkSharedLibs %q, got %q", w, g) } Loading @@ -1078,7 +1078,7 @@ func TestVendorSnapshotUse(t *testing.T) { t.Errorf("wanted libclient libclientAndroidMkDylibs %q, got %q", w, libclientAndroidMkDylibs) } libclient32AndroidMkSharedLibs := ctx.ModuleForTests("libclient", shared32Variant).Module().(*Module).Properties.AndroidMkSharedLibs libclient32AndroidMkSharedLibs := ctx.ModuleForTests("libclient", shared32Variant).Module().(*Module).transitiveAndroidMkSharedLibs.ToList() if g, w := libclient32AndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor", "lib32", "liblog.vendor", "libc.vendor", "libm.vendor", "libdl.vendor"}; !reflect.DeepEqual(g, w) { t.Errorf("wanted libclient32 AndroidMkSharedLibs %q, got %q", w, g) } Loading