Loading apex/apex.go +4 −0 Original line number Diff line number Diff line Loading @@ -1927,6 +1927,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { filesInfo = append(filesInfo, af) return true // track transitive dependencies } } else if rust.IsRlibDepTag(depTag) { // Rlib is statically linked, but it might have shared lib // dependencies. Track them. return true } else if java.IsbootImageContentDepTag(depTag) { // Add the contents of the boot image to the apex. switch child.(type) { Loading apex/apex_test.go +11 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,15 @@ func TestBasicApex(t *testing.T) { srcs: ["foo.rs"], crate_name: "foo", apex_available: ["myapex"], shared_libs: ["libfoo.shared_from_rust"], } cc_library_shared { name: "libfoo.shared_from_rust", srcs: ["mylib.cpp"], system_shared_libs: [], stl: "none", apex_available: ["myapex"], } rust_library_dylib { Loading Loading @@ -539,6 +548,7 @@ func TestBasicApex(t *testing.T) { ensureListContains(t, ctx.ModuleVariantsForTests("libfoo.rlib.rust"), "android_arm64_armv8-a_rlib_dylib-std_apex10000") ensureListContains(t, ctx.ModuleVariantsForTests("libfoo.dylib.rust"), "android_arm64_armv8-a_dylib_apex10000") ensureListContains(t, ctx.ModuleVariantsForTests("libbar.ffi"), "android_arm64_armv8-a_shared_apex10000") ensureListContains(t, ctx.ModuleVariantsForTests("libfoo.shared_from_rust"), "android_arm64_armv8-a_shared_apex10000") // Ensure that both direct and indirect deps are copied into apex ensureContains(t, copyCmds, "image.apex/lib64/mylib.so") Loading @@ -548,6 +558,7 @@ func TestBasicApex(t *testing.T) { ensureContains(t, copyCmds, "image.apex/lib64/libfoo.dylib.rust.dylib.so") ensureContains(t, copyCmds, "image.apex/lib64/libfoo.ffi.so") ensureContains(t, copyCmds, "image.apex/lib64/libbar.ffi.so") ensureContains(t, copyCmds, "image.apex/lib64/libfoo.shared_from_rust.so") // .. but not for java libs ensureNotContains(t, copyCmds, "image.apex/javalib/myotherjar.jar") ensureNotContains(t, copyCmds, "image.apex/javalib/msharedjar.jar") Loading rust/rust.go +5 −0 Original line number Diff line number Diff line Loading @@ -798,6 +798,11 @@ func IsDylibDepTag(depTag blueprint.DependencyTag) bool { return ok && tag == dylibDepTag } func IsRlibDepTag(depTag blueprint.DependencyTag) bool { tag, ok := depTag.(dependencyTag) return ok && tag == rlibDepTag } type autoDep struct { variation string depTag dependencyTag Loading Loading
apex/apex.go +4 −0 Original line number Diff line number Diff line Loading @@ -1927,6 +1927,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { filesInfo = append(filesInfo, af) return true // track transitive dependencies } } else if rust.IsRlibDepTag(depTag) { // Rlib is statically linked, but it might have shared lib // dependencies. Track them. return true } else if java.IsbootImageContentDepTag(depTag) { // Add the contents of the boot image to the apex. switch child.(type) { Loading
apex/apex_test.go +11 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,15 @@ func TestBasicApex(t *testing.T) { srcs: ["foo.rs"], crate_name: "foo", apex_available: ["myapex"], shared_libs: ["libfoo.shared_from_rust"], } cc_library_shared { name: "libfoo.shared_from_rust", srcs: ["mylib.cpp"], system_shared_libs: [], stl: "none", apex_available: ["myapex"], } rust_library_dylib { Loading Loading @@ -539,6 +548,7 @@ func TestBasicApex(t *testing.T) { ensureListContains(t, ctx.ModuleVariantsForTests("libfoo.rlib.rust"), "android_arm64_armv8-a_rlib_dylib-std_apex10000") ensureListContains(t, ctx.ModuleVariantsForTests("libfoo.dylib.rust"), "android_arm64_armv8-a_dylib_apex10000") ensureListContains(t, ctx.ModuleVariantsForTests("libbar.ffi"), "android_arm64_armv8-a_shared_apex10000") ensureListContains(t, ctx.ModuleVariantsForTests("libfoo.shared_from_rust"), "android_arm64_armv8-a_shared_apex10000") // Ensure that both direct and indirect deps are copied into apex ensureContains(t, copyCmds, "image.apex/lib64/mylib.so") Loading @@ -548,6 +558,7 @@ func TestBasicApex(t *testing.T) { ensureContains(t, copyCmds, "image.apex/lib64/libfoo.dylib.rust.dylib.so") ensureContains(t, copyCmds, "image.apex/lib64/libfoo.ffi.so") ensureContains(t, copyCmds, "image.apex/lib64/libbar.ffi.so") ensureContains(t, copyCmds, "image.apex/lib64/libfoo.shared_from_rust.so") // .. but not for java libs ensureNotContains(t, copyCmds, "image.apex/javalib/myotherjar.jar") ensureNotContains(t, copyCmds, "image.apex/javalib/msharedjar.jar") Loading
rust/rust.go +5 −0 Original line number Diff line number Diff line Loading @@ -798,6 +798,11 @@ func IsDylibDepTag(depTag blueprint.DependencyTag) bool { return ok && tag == dylibDepTag } func IsRlibDepTag(depTag blueprint.DependencyTag) bool { tag, ok := depTag.(dependencyTag) return ok && tag == rlibDepTag } type autoDep struct { variation string depTag dependencyTag Loading