Commit graph

469 commits

Author SHA1 Message Date
Paul Duffin
7d74e7bea3 Copy white listed apex available settings into snapshot
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.

Bug: 142935992
Test: m nothing
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
2020-03-11 18:31:45 +00:00
Treehugger Robot
f53737fadc Merge "Remove special handling of test_ apexes" 2020-03-11 17:52:56 +00:00
Nikita Ioffe
643953d170 Merge "Always use "${codename}.${sha}" if UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true" 2020-03-11 17:45:34 +00:00
Treehugger Robot
de77904484 Merge "Remove special handling of com.android.art.debug/release" 2020-03-11 16:46:21 +00:00
Paul Duffin
57380a902e Remove special handling of test_ apexes
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.

Bug: 142935992
Test: m nothing
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
2020-03-11 15:17:04 +00:00
Paul Duffin
50cbefd5e8 Remove special handling of com.android.art.debug/release
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.

Bug: 142935992
Test: m nothing
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
2020-03-11 15:16:47 +00:00
Jooyung Han
35155c4f96 Fix path in apex when native_bridge_supported: true
NativeBridgeRelativePath should be appended after /bin or /lib and
before subdir.

Bug: N/A
Test: m (add a soong test)
Change-Id: Id0c44c66b4900caa291e816cf3361fdec8ff9421
2020-03-11 20:07:34 +09:00
Jooyung Han
4c8e3509ee Merge "Fix apex_available" 2020-03-10 23:53:41 +00:00
Jooyung Han
5e9013be22 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.

Bug: 151071238
Test: build/boot
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-10 23:52:01 +00:00
Treehugger Robot
04c93a40f1 Merge "DO NOT MERGE: Remove AppSearch from Android R." 2020-03-10 08:19:05 +00:00
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
Alexander Dorokhine
466d39a18c DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538
Merged-In: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
(cherry picked from commit c9c7116721)
Change-Id: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
2020-03-09 15:14:42 +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
Nikita Ioffe
1f4f345156 Always use "${codename}.${sha}" if UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true
Test: m checkbuild
Bug: 149733822
Change-Id: I3e1beeb721f7e87bc6adda61861fa962ec892360
Merged-In: I3e1beeb721f7e87bc6adda61861fa962ec892360
(cherry picked from commit 934c4f2acc)
2020-03-04 22:05:11 +00: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