Commit graph

361 commits

Author SHA1 Message Date
Jiyong Park
79505fbf22 Merge "Remove libselinux from the apex_available whitelist" into rvc-dev 2020-03-17 08:29:46 +00:00
Jiyong Park
7e5576a7b1 Remove libselinux from the apex_available whitelist
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.

Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.

Bug: 151053366
Bug: 150999716
Test: m

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

Merged-In: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
(cherry picked from commit 1731f6ae3f)
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
2020-03-17 05:25:31 +00:00
Baligh Uddin
cb6aa122d8 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Merged-In: If49042a7acbf9f0dcb505664863d97805902e459
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 16:41:11 -07:00
Jooyung Han
23b0adf4ce apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Merged-In: Iad90a239898f59456900ae7816b90379b1b43406
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
(cherry picked from commit 5417f775e5)

Exempt-From-Owner-Approval: cp from aosp
2020-03-16 10:57:51 +00:00
Jooyung Han
0c4e016428 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)
Merged-In: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
(cherry picked from commit 03b5185b88)

Exempt-From-Owner-Approval: got ORV already.
2020-03-12 14:07:05 +00:00
Jooyung Han
b8fa86ad6f Fix apex_available
Checking apex_available was missing some corner cases.
For example, the deps of share deps of cc_library modules are missed
while those from cc_library_shared are correctly tracked.

This was due to..

* calling DepIsInSameApex in WalkDeps: both work fine separately, but
when they are used together, it fails to work. It's due to how WalkDeps
works. (We might fix this bug too risky since it is used very widely)
* incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver
is supposed to be parent, but child was used before. Interestingly lots
of deps are within the same group of module types(cc to cc, java to
java), it has worked. (note that receiver's DepIsInSameApex
implementation can be different).

This change fixes them by..

* walkPayloadDeps is now relying on ApexVariation, which is calculated
correctly by TopDown apex_deps mutator.
* use correct receiver for DepIsInSameApex in apex_deps mutator, which
requires for java.SdkLibrary to override the method and for
java.Library/Import to use passed dep instead of receiver to check its
membership of sdk.

Exempt-From-Owner-Approval: cherry-pick from aosp/master

Bug: 151071238
Test: build/boot
Merged-In: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
(cherry picked from commit 5e9013be22)
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-11 16:38:21 +09:00
Jiyong Park
7bd9444b0f 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
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
2020-03-09 14:29:18 +09:00
TreeHugger Robot
bc4df10016 Merge "DO NOT MERGE: Remove AppSearch from Android R." into rvc-dev 2020-03-05 21:09:00 +00:00
Colin Cross
7365eaafd5 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
Merged-In: I923773c90fe15becbffae3986791aa9edde8f8f6
Change-Id: I923773c90fe15becbffae3986791aa9edde8f8f6
(cherry picked from commit 50317874ff)
2020-03-05 14:40:28 +09:00
Jiyong Park
af8998cba6 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.

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

Bug: 148002117
Test: m

Merged-In: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
(cherry picked from commit cfaa1643e8)
Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-03-01 03:59:11 +00:00
Jiyong Park
73fa54e7a4 Merge "No symlink for host APEXes" into rvc-dev 2020-02-27 03:22:01 +00:00
Jiyong Park
9b96418dfe 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.

Change-Id: I28492dfaaef471117a430be05255fbef76e557b0
2020-02-26 18:27:19 +09:00
Jooyung Han
650417966c 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

Merged-In: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
Change-Id: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
(cherry picked from commit b7bebe2616)
2020-02-26 14:10:23 +09:00
Alexander Dorokhine
c9c7116721 DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538
Change-Id: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
2020-02-25 17:16:41 -08:00
Automerger Merge Worker
f9c738d084 Allow for setting a logging_parent for an Apex. am: 004d717158 am: f4fa3fe81e am: 833162725c
Change-Id: Ifa85d785453e5e363b4b374ce0ea1d12963cafbb
2020-02-21 18:05:12 +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
Automerger Merge Worker
7094cbc872 Merge "have a per-module switch to turn the symlinking optimizaiton off" am: eb9b9f23ec am: 67a0970d4f am: 279f6f1c80
Change-Id: Iae286618eb0206d7d9b0c40369048e5f38fb6084
2020-02-20 02:22:14 +00:00
Jiyong Park
eb9b9f23ec Merge "have a per-module switch to turn the symlinking optimizaiton off" 2020-02-20 01:47:57 +00:00
Automerger Merge Worker
ddf8057250 Merge "Permissions XML file for java_sdk_library is mutated for APEX" am: 2d6d5d8995 am: dcf5cfaea5 am: ba87e454cb
Change-Id: If143ba1b41e7374d2c92e91c5a5906370ce1f6c4
2020-02-20 00:50:53 +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
Automerger Merge Worker
e81fff6889 Merge "Statically link the unwinder into binaries packaged into an unbundled APEX with legacy_android10_support: true." am: d8b80bc683 am: 4b20d12832 am: 7fe957e171
Change-Id: Ic27432ee08f3acd6052ceeacb56249077a5edf65
2020-02-18 21:48:42 +00: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
946f7d4600 Merge "Remove liblog from whitelist" am: 7d8ecd0bc1 am: e7f62e9019 am: 7fc4e23f00
Change-Id: Ib57efd0d3f3e36059edd92a5f9722c4b4623e5fd
2020-02-14 01:30:42 +00:00
Jeffrey Huang
7d8ecd0bc1 Merge "Remove liblog from whitelist" 2020-02-14 00:45:22 +00:00
Treehugger Robot
cf56a70cd2 Merge "apexDepsMutator is a top-down mutator" am: 680afd7bc7 am: 933fb89a3f am: c798bcde06
Change-Id: I4695d3aa1231ff40d4a6570a0973360ebd9bf01d
2020-02-13 22:59:40 +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
Automerger Merge Worker
2bd5ffa8d4 Update apex.go to remove libutils am: 9401b187f8 am: 8aac3e3c0d am: 762abb8e1c
Change-Id: Ib964dc1b1dbc1e3c724c6174bc1e36763fe777b4
2020-02-13 06:48:23 +00: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
Automerger Merge Worker
8014e606dd Merge "Update apex dependency even for test and non-installable APEXes" am: 4e29184a4e am: ee239878f4 am: 088d5cf1cb
Change-Id: I68fe4bcf81ccc2cd9b16857c59cc1d484a006547
2020-02-12 08:11:23 +00: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
Automerger Merge Worker
db7d85cc51 Merge "<apex_name>-deps-info correctly tracks dependencies" am: 2bb26d3fad am: 39b51a899f am: 5a14677e31
Change-Id: I54d0ececcb8e0a6c92ce13666f922a42cc80efbd
2020-02-12 01:18:44 +00:00
Jiyong Park
2bb26d3fad Merge "<apex_name>-deps-info correctly tracks dependencies" 2020-02-12 00:47:21 +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
Automerger Merge Worker
cc5564d707 Merge "rm libbinderthreadstate" am: 7072100760 am: 897d8b2612 am: b115ea1d5f
Change-Id: I82b9cb9c16840796cd6e2485189de57f17360873
2020-02-11 19:07:00 +00:00
Steven Moreland
7072100760 Merge "rm libbinderthreadstate" 2020-02-11 18:45:39 +00:00
Automerger Merge Worker
e7184139f6 Merge "Document apex and apex_test" am: a871ee2067 am: e0d6f7d9d3 am: d27a333182
Change-Id: Iabbff9fe6d65618de71347ead245fc43136454c9
2020-02-11 03:39:25 +00:00
Jiyong Park
fce0b4209f Document apex and apex_test
Bug: 149082647
Test: m
Change-Id: I39e72eecda1d0e2984a3dde4987c4928f58d2afc
2020-02-11 03:56:06 +09:00
Automerger Merge Worker
0ec2b81ee5 Merge "add walkPayloadDeps" am: 58b5030e30 am: 1cf0db8136 am: 230eceddce
Change-Id: Id9b071d99aa88fcfad5af8500836e0971f694647
2020-02-10 06:16:59 +00:00
Jiyong Park
58b5030e30 Merge "add walkPayloadDeps" 2020-02-10 05:20:59 +00: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
Automerger Merge Worker
b9580d46fd Merge "java_sdk_library - Allow it to be replaced by prebuilt" am: 9be2556d90 am: e1c279f889 am: d690690d63
Change-Id: I4f276ce93edf7a92963f71f8f2e1542ea81c2ca9
2020-02-07 11:57:38 +00:00
Treehugger Robot
9be2556d90 Merge "java_sdk_library - Allow it to be replaced by prebuilt" 2020-02-07 11:16:41 +00:00
Jiyong Park
678c881a4f <apex_name>-deps-info correctly tracks dependencies
The APEX dependency is more correctly tracked. Previously, the
dependency was tracked while we gather modules that will be installed to
an APEX. This actually was incorrect because we skipped many dependency
types that we don't need to follow to gather the modules list, such as
the headers dependency.

Now, the dependency is tracked directly when a module is mutated for an
APEX. In other words, if a module is mutated for an apex X, then the
module will appear in the X-deps-into.txt file.

This change also changes the format of the txt file. It now clearly
shows why a module is included in the APEX by showing the list of
modules that depend on the module.

Bug: 146323213
Test: m
Change-Id: I0a70cf9cce56e36565f9d55683fdaace8748a081
2020-02-07 18:53:12 +09:00
Jiyong Park
201cedd608 add walkPayloadDeps
The function visits dependencies of an APEX that contribute to the
payload. checkApexAvailability is rewritten using the generic function.
There is no change in behavior.

Bug: N/A
Test: m

Change-Id: I1a8b4eb0a60a432f667a61b4f6f457c3b8f1cd3d
2020-02-07 18:48:26 +09:00
Automerger Merge Worker
b86c8583bf Merge "Do not add bootstrap libs as providing from apex" am: 570147469f am: 40f770951d am: 557b3d228a
Change-Id: I076542ad1f1c42ea01cf6fb46515764d17d1ab19
2020-02-07 08:20:49 +00:00
Treehugger Robot
570147469f Merge "Do not add bootstrap libs as providing from apex" 2020-02-07 07:23:14 +00:00