From 94e22fd35e368f5362c3c78bec2054de23d9ac1f Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 8 Apr 2021 18:19:15 +0900 Subject: Shared lib dependencies from rlib are included in APEX This change fixes a bug that shared lib dependencies of an rlib is not installed to the APEX even when the rlib is part of the APEX. Bug: N/A Test: m Change-Id: I88fe461584499839d8018d6b4292374592e7562b --- apex/apex_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apex/apex_test.go') diff --git a/apex/apex_test.go b/apex/apex_test.go index bdff41e6d..c85ea962f 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -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 { @@ -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") @@ -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") -- cgit v1.2.3-59-g8ed1b