Commit graph

457 commits

Author SHA1 Message Date
Jiyong Park
65cc4f7777 Apex_available check failure reveals dependency
When the check for apex_available has failed, the build system now shows
the module that brought the unavailable module into the APEX.

Bug: 151051671
Test: m
Merged-In: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
(cherry picked from commit 7bd9444b0f)
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
2020-03-09 18:56:54 +09:00
Jooyung Han
03b5185b88 apex: choose stub according to min_sdk_version
Native modules within APEX should be linked with proper stub version
according to its min_sdk_version.

For example, when min_sdk_version is set to "29", libfoo in the apex
would be linked to libbar of version 29 from platform, even if it has
a newer version like 30.

Bug: 145796956
Test: m nothing (soong tests)
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
2020-03-07 03:12:45 +09:00
Jiyong Park
20bacabe0b PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES is applicable to override_apex
apex { name: "foo" }
override_apex { name: "override_foo", base:"foo" }

PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := foo:com.android.foo

Previously, the override was done only for the overridden package "foo",
but not for "override_foo". Fixing this issue by using ctx.ModuleName()
when finding the package name to use.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 150645663
Test: m
Merged-In: I2947e5c75369216a4bbce8749503236be86771c3
(cherry picked from commit a519c54dd3)
Change-Id: I2947e5c75369216a4bbce8749503236be86771c3
2020-03-04 12:03:59 +09:00
Jooyung Han
c87a059c88 Make __ANDROID_APEX_<NAME>__ macro optional
This is rarely used feature but cost alot for the local build and build
inra.

Bug: 150506627
Test: m
Change-Id: Iec3ada4a97c7b228f2818563fa0e81b407f2715a
2020-03-02 17:44:33 +09:00
Jiyong Park
323a4c3ab3 Runtime deps to a stubs lib crosses APEX boundary
When there is a runtime depedency (via runtime_libs property) to a
library providing stable C APIs, the dependency is considered as
crossing APEX boundary. Therefore, the requested lib doesn't need to be
made available to the APEX where the requesting lib is in.

Bug: 147813447
Test: m
Change-Id: I9cf8a5877850fb85b92c851e15fac921b8b7641b
2020-03-01 17:29:06 +09:00
Jiyong Park
cfaa1643e8 bundle config contains (path,manifest) pairs of embedded APKs
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

Bug: 148002117
Test: m

Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-02-29 09:07:46 +09:00
Jiyong Park
bd15961043 bundle config for apexes are auto-generated
bundle config file for apexes are auto-generated. It is included in the
<apex>-base.zip file, which is expected to be extracted and then fed
into the bundletool.

This change is in preparation for the upcoming change to include
information about embedded apks in the bundle confir file.

Bug: 148002117
Test: m

Change-Id: If25d75e0f62036dc777faf8593ed8eb9a74950b0
2020-02-29 09:07:08 +09:00
Jooyung Han
c6e538406c Merge "Add "jni_libs" property to apex module" 2020-02-28 17:12:53 +00:00
Jooyung Han
6e147e4f54 Merge changes I789b526c,Ie15c811f
* changes:
  apex: refactor apex properties
  apex: fix a test util (ensureExactContent)
2020-02-28 17:08:45 +00:00
Jiyong Park
0ffa3aba78 Merge "No symlink for host APEXes" 2020-02-27 23:56:24 +00:00
Jooyung Han
643adc4896 Add "jni_libs" property to apex module
Which is the list of JNI libraries that are embeded inside the apex.
jni_libs is handled just like native_shared_libs except that it is
stored in apex_manifest.

When linkerconfig finds an apex with JNI libs, it exposes the namespace
for the apex as visible so that libnativeloader can link the namespace
to the corresponding classloader-namespace.

Bug: 149363889
Test: m nothing(runs soong test)
Change-Id: I52ebe38b44545e6e8853e34a3404a235c858112a
2020-02-27 13:50:06 +09:00
Jooyung Han
01a868d096 apex: refactor apex properties
Embed common properties (apexNativeDependencies) so that the logic for
adding dependencies for native modules can be reused.

Bug: N/A
Test: m

Change-Id: I789b526c09eea14213ab1544590ed2238ed8c625
2020-02-27 13:45:14 +09:00
Jooyung Han
e6436d7bf0 apex: fix a test util (ensureExactContent)
ensureExactContent shouldn't return immediately when it finds a match
from expected list of files.

Bug: N/A
Test: m nothing
Change-Id: Ie15c811f9cfcae7ede28dee0fcf203cee24659a0
2020-02-27 13:31:56 +09:00
Jiyong Park
638d30ed21 No symlink for host APEXes
Symlinking doesn't make sense for host APEXes.

Bug: 150255435
Test: m com.android.art.host and inspect the built APEX; there is
no symlink.

Merged-In: I28492dfaaef471117a430be05255fbef76e557b0
(cherry picked from commit 9b96418dfe)
Change-Id: I28492dfaaef471117a430be05255fbef76e557b0
2020-02-27 12:09:33 +09:00
Colin Cross
1c85e8e019 Only dist apex sizes for checkbuild
Using $(call dist-for-goals,droidcore,...) for every apex
installed-files.txt causes every apex to be built for all builds,
causing a signficiant regression in build time.  For now only
dist them in checkbuilds, which were going to build all of them
anyways.

Ideally we would like to dist the installed-files.txt only if
the apex was already built, but there is not currently a way to
express that.

Test: treehugger
Bug: 149979076
Change-Id: I21edbc90980f94ad6d497cb86ee80223dd782fe1
2020-02-27 00:58:50 +00:00
Bob Badour
40017be1c3 Merge "Unless overridden include LICENSE files in notices." 2020-02-26 20:37:22 +00:00
Jooyung Han
077f9a44f9 Merge "apex: do not follow jni_libs from android_app" 2020-02-26 02:35:10 +00:00
Colin Cross
414d50c35d Merge "Add min_sdk_version property to apexes" 2020-02-25 15:34:26 +00:00
Jooyung Han
b7bebe2616 apex: do not follow jni_libs from android_app
Because APK-in-APEX embeds its jni_libs in it. We don't have to follow
deps of jni_libs.

Bug: 146992436
Test: m com.android.tethering
      deapexer extract com.android.tethering.apex apex
      ls apex # there should be no /lib dir

Change-Id: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
2020-02-25 20:47:04 +09:00
Colin Cross
48c2f294a6 Merge "Require apps built against the SDK to use JNI built against the NDK" 2020-02-25 00:21:07 +00:00
Nikita Ioffe
5d600c9169 For legacy10 APEXes default target_sdk_version and min_sdk_version to 29
Test: m com.android.conscrypt
Bug: 149733822
Change-Id: Ia863b5701716ef4022b470ee758368ea4fffb1d4
Merged-In: Ia863b5701716ef4022b470ee758368ea4fffb1d4
(cherry picked from commit db10c13bdf)
2020-02-22 17:33:28 +00:00
Colin Cross
50317874ff Add min_sdk_version property to apexes
Add a min_sdk_version property apexes.  Currently a noop, but will
be used to enforce that dependencies are compatible with the
specified version.

Test: m checkbuild
Bug: 149591522
Change-Id: I923773c90fe15becbffae3986791aa9edde8f8f6
2020-02-21 14:54:31 -08:00
Colin Cross
094cde4430 Require apps built against the SDK to use JNI built against the NDK
Apps that expect to run on older platforms should use JNI libraries
that will also run on older platforms.  Require that apps that set
sdk_version have jni_libs modules that also set sdk_version, or
set jni_uses_platform_apis: true to bypass the check.

Fixes: 149591057
Test: app_test.go
Change-Id: I76b9b45fb5773bc4dfc10520108f4f3578723909
2020-02-21 14:54:31 -08:00
Bob Badour
a75b057e17 Unless overridden include LICENSE files in notices.
As a second step to removing the go/android3p instructions to copy or
to link NOTICE to LICENSE, include LICENSE files in the notices, which
will allow deleting all of the copied/linked NOTICE files.

The change causes a few additions to the system image notice files.

Test: manually built and compared before and after notices
Change-Id: Ia7bc58e2eba7bed5e63934881b5298201a93bc3e
2020-02-21 20:40:43 +00:00
Baligh Uddin
004d717158 Allow for setting a logging_parent for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Change-Id: Ib3749e59f5e31903f2dbe75f86534738147a55ec
2020-02-21 16:59:26 +00:00
Colin Cross
f9aabd719a Make apex use cc.GatherRequiredDepsForTests
Remove the duplicated native modules from apex_test.go.

Test: all soong tests
Change-Id: Ib88af058d23cf37446d7a4bb571edfb1e0880854
2020-02-19 19:07:11 -08:00
Jiyong Park
eb9b9f23ec Merge "have a per-module switch to turn the symlinking optimizaiton off" 2020-02-20 01:47:57 +00:00
Jiyong Park
2d6d5d8995 Merge "Permissions XML file for java_sdk_library is mutated for APEX" 2020-02-19 23:57:14 +00:00
Jiyong Park
9d677206d1 have a per-module switch to turn the symlinking optimizaiton off
The optimization is confusing syshealth because the modules will use
more memory when they are switched to the prebuilt (unbundled) or
updated via Play.

Let's have a per-module switch to control the behavior and turn it on
only for non-updatable modules like ART.

Bug: 149805758
Test: m
Change-Id: Ieb842c47f31f3b06e403b1e1f9e463c3e5524107
2020-02-19 20:16:25 +09:00
Jiyong Park
e383388f98 Permissions XML file for java_sdk_library is mutated for APEX
This change fixes a regression that was introduced with
I597bccbb177b6b6320c3a3edeff467243230d384. With the change, the content
of the permissions XML file for a java_sdk_library was determined before
the java_sdk_library is mutated for an APEX. As a result, the file path
to the implementation jar library was always set to
/system/framework/*.jar regardless of whether the java_sdk_library is
part of an APEX or not.

This change fixes the problem, by creating the permissions XML file via
a new module type. The content of the xml file is determined after the
xml file is mutated for APEXes.

Bug: 149600642
Test: m

Change-Id: Id21f8d8285df49b0b3be1daf0f101f2bc978eeb0
2020-02-19 09:47:37 +09:00
Peter Collingbourne
dc4f986b2a Statically link the unwinder into binaries packaged into an unbundled APEX with legacy_android10_support: true.
Bug: 149075752
Test: tapas com.android.conscrypt com.android.tethering arm64
Test: m out/target/product/generic_arm64/{,symbols/}apex/com.android.{tethering,conscrypt}/lib64/libc++.so
Test: Verified that unwinder was dynamically linked to tethering's
Test: libc++ and statically linked to conscrypt's.
Test: lunch flame-userdebug && m
Test: Verified that unwinder was dynamically linked to /system/lib64/libc++.so
Change-Id: I98eed7cb4316962b19b5c12e150c224c25d0e91d
2020-02-13 22:29:44 -08:00
Jeffrey Huang
7d8ecd0bc1 Merge "Remove liblog from whitelist" 2020-02-14 00:45:22 +00:00
Treehugger Robot
680afd7bc7 Merge "apexDepsMutator is a top-down mutator" 2020-02-13 22:29:23 +00:00
Jeffrey Huang
f0ae6ccaa7 Remove liblog from whitelist
Bug: 145923087
Test: m -j
Change-Id: Ib1b711c01262ce9466cdd49daa3cc7142376004c
2020-02-13 12:33:39 -08:00
Jeffrey Huang
9401b187f8 Update apex.go to remove libutils
Bug: 145922701
Test: m -j
Change-Id: I13078f43129a7a9478b9bb97bb94c2c70fdb148c
2020-02-12 17:35:59 -08:00
Jiyong Park
f760cae41b apexDepsMutator is a top-down mutator
apex { name: ["myapex"], native_shared_libs: ["libX", "libY"] }
cc_library { name: "libX", shared_libs: ["libY"] }
cc_library { name: "libY", shared_libs: ["libZ"], stubs: {...} }

apexDepsMutator was a bottom up mutator and it uses WalkDeps to traverse
the dependency tree rooted at myapex in a depth-first order. While
traversing the tree, if calls BuildForApex for a module that will be
part of the APEX.

libY is visited twice. Once via libX and once via myapex. If the visit
from libX was before the visit from myapex (since this is a depth-first
traversing), BuildForApex is not called for libY and its dependency
libZ, because libY provides a stub. And then when libY is again visited
via myapex, BuildForApex is correctly called for the module, but not for
its dependencies libZ because the paths from libY to libZ was already
visited.

As a result, the apex variant of libY has a dependency to the non-apex
variant of libZ.

Fixing the problem by changing the mutator a top-down one.

Bug: 148645937
Test: m
Change-Id: Ib2cb28852087c63a568b3fd036504e9261cf0782
2020-02-12 17:01:26 +09:00
Treehugger Robot
4e29184a4e Merge "Update apex dependency even for test and non-installable APEXes" 2020-02-12 07:45:47 +00:00
Treehugger Robot
6655756230 Merge "Automatically set compile_dex:true and hostdex:true for APEX variants" 2020-02-12 05:35:25 +00:00
Jiyong Park
6b21c7d2ab Automatically set compile_dex:true and hostdex:true for APEX variants
... unless they are turned off explicitly.

Bug: 147221965
Test: m
Change-Id: I6b91d6409d9cf06ad09467c53d5d51a9c693256e
2020-02-12 10:47:36 +09:00
Jiyong Park
2bb26d3fad Merge "<apex_name>-deps-info correctly tracks dependencies" 2020-02-12 00:47:21 +00:00
Treehugger Robot
45f3c9b6a6 Merge "m <module_name> builds <module_name>.<apex_name>" 2020-02-12 00:35:55 +00:00
Jiyong Park
ab872e0295 Update apex dependency even for test and non-installable APEXes
The apex dependency map wasn't updated for test or non-installable
APEXes to work around the problem that a module being in such APEX
prevented the module from being installed in the system partition.

Since that problem is not happening any more, removing the unnecessary
work-around.

Bug: 123892969
Test: m
Change-Id: I43e07a9611a3e08ff39b9a64454b1c67949d35bc
2020-02-12 07:45:16 +09:00
Steven Moreland
7072100760 Merge "rm libbinderthreadstate" 2020-02-11 18:45:39 +00:00
Jiyong Park
31af2678fe m <module_name> builds <module_name>.<apex_name>
When a module is not available for platform (i.e.
//apex_available:platform is missing in the apex_available property), m
<module_name> previously just didn't work because there is no platform
variant of the module.

This change fixes the behavior; regardless of whether the platform
variant is available or not, m <module_name> builds all the apex
variants of the module along with the platform variant if it exists.

Bug: 147728094
Test: m conscrypt
Change-Id: Iedd3fa6fc0ed779c5f7c5d65f23d86f799ac0cbe
2020-02-11 09:44:06 +09:00
Jiyong Park
fce0b4209f Document apex and apex_test
Bug: 149082647
Test: m
Change-Id: I39e72eecda1d0e2984a3dde4987c4928f58d2afc
2020-02-11 03:56:06 +09:00
Jiyong Park
58b5030e30 Merge "add walkPayloadDeps" 2020-02-10 05:20:59 +00:00
Jiyong Park
22f3ce1ea7 Merge "<apexname>-installed-file.txt shows symlinks" 2020-02-10 03:44:00 +00:00
Jiyong Park
bd63a108a0 <apexname>-installed-file.txt shows symlinks
Bug: 147605944
Test: m and inspect the generated txt files
Change-Id: I26ecaf66a531478d22fb4611bb4ea19e92ef132e
2020-02-08 17:18:03 +09:00
Steven Moreland
14850a5139 rm libbinderthreadstate
This library is empty, and its functionality has moved
into libbinder/libhwbinder.

Bug: 148692216
Test: N/A
Change-Id: I5874efda9ab43fc00cf90395a1aabde45cf49579
2020-02-07 16:22:28 -08:00
Treehugger Robot
9be2556d90 Merge "java_sdk_library - Allow it to be replaced by prebuilt" 2020-02-07 11:16:41 +00:00