Commit graph

287 commits

Author SHA1 Message Date
atrost
6e12625c0f Add support for compat config in APEX.
apex module accepts PlatformCompatConfigIntf as prebuilt,
and places it in the etc folder of the apex.

Test: m
Test: flash device with dummy config in mediaprovider APEX -
the config is present
Change-Id: Ifc62cd262f6c6571c1bf6c2943879aa20877ecad
2020-02-05 13:33:50 +00:00
Colin Cross
503c1d06e8 Set LOCAL_CERTIFICATE for flattened apex APKs
Leaving out LOCAL_CERTIFICATE for flattened apex APKs causes
the apkcerts.txt to have empty keys for those APKs, which
confuses the signing tools.  Set LOCAL_CERTIFICATE for them.

Also refactor the Certificate support to avoid introducing
duplicated handling for presigned certificates.

Bug: 147765187
Test: m apkcerts-list
Change-Id: Ife07661761cd5a89c9f009b8ce041db4dff9ec54
2020-01-28 14:03:08 -08:00
Jiyong Park
19972c7935 License info for APEXes are correctly gathered
This change fixes a bug that license info for non-flattened APEXes are
not captured in /system/etc/NOTICE.xml.gz file. For non-flatted APEXes,
we have been creating NOTICE.html.gz file by concatenating all the
license infos of the modules that contributes to the APEX and embedding
the file into the asset directory of the APEX. Then at runtime, the info
is shown through the "Google Play System Update Licenses" UI. However,
this was problematic because the UI only shows license info for the
Google-signed APEXes, leaving OEM-signed APEXes (a.k.a. optional
modules).

The problem is now fixed by associating a merged license file with each
APEX and exporting them to Make, so that the merged license files are
included in the partition level /system/etc/NOTICE.xml.gz file
regardless of whether the APEX is a Google-signed one or not.

This also fixes a bug that license info entries are created for the
runtime paths /apex/<apex_name>/<path_to_a_file>, which is not necessary
as they are already included in the license info of the containing APEX.

Bug: N/A
Test: Go to Settings->About Phone->Legal information and check
that a) /system/apex/*.apex files are shown and b) /apex/<apex_name>/*
files are not shown

Change-Id: I2c25c803b6a4c39b24bb3f724502699382fab50c
2020-01-28 17:20:45 +00:00
Jooyung Han
a57af4adc0 Revert "Revert "apex_vndk uses vendor variants only""
This reverts commit 5df3b11f78.

Reason for revert: re-land with a fix

Fix a broken soong test
Add implicit dependency (libprofile-clang-extra) to make a test pass.

Bug: n/a
Test: m
Change-Id: I0b179199bc032501354f8e24782837453781bd8c
2020-01-23 14:48:29 +09:00
Jooyung Han
7dfb229936 Merge "Revert "apex_vndk uses vendor variants only"" 2020-01-23 05:34:42 +00:00
Jooyung Han
5df3b11f78 Revert "apex_vndk uses vendor variants only"
This reverts commit 559ad01db9.

Reason for revert: broken builds

Change-Id: Ia8a09a2bdbdc8e76f2d4b9eb54e36ccc544e9397
Bug: b/148181875
2020-01-23 05:31:05 +00:00
Treehugger Robot
e4226c4d67 Merge "apex_vndk uses vendor variants only" 2020-01-23 04:47:05 +00:00
Jooyung Han
559ad01db9 apex_vndk uses vendor variants only
VNDK APEX is supposed to contain "vendor" variants of VNDK libraries.
This is different from normal APEXes which have "apex" variants.

Bug: 146758869
Test: build / flash / boot
Change-Id: I5e035678c337334092616b58d2e0e404788a6639
Exempt-From-Owner-Approval: Got ORV, but rebased with resolving merge conflicts.
2020-01-23 04:46:53 +00:00
Oliver Nguyen
b6aeb14150 Merge "Add coverage flags for Clang coverage builds." 2020-01-22 22:34:35 +00:00
Jiyong Park
7cd10e3908 Reland "use symlink for bundled APEX"
This reverts commit 31c65d4fe4.

Bug: 144533348

Test: checkout master-art-host and run
ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist /art/tools/dist_linux_bionic.sh -j80 com.android.art.host
the result is successful

Change-Id: Ica11eec9b64867088b16720a41c6d83905976ec5
2020-01-20 15:13:31 +09:00
Anton Hansson
eec79ebe03 Default apex_available to //apex_available:platform
This means everything that goes into apexes need to be
explicitly labeled to be available for apex.

Whitelist the current offenders. This list should be
trimmed down.

Bug: 147364041
Test: m
Test: multiproduct_kati -only-soong
Exempt-From-Owner-Approval: cherry-pick from internal
Change-Id: I837299c6a15d46f8a5ba544b613776b1cc27d7b8
Merged-In: I837299c6a15d46f8a5ba544b613776b1cc27d7b8
(cherry picked from commit 93488cbb10d4882845abb732f8e53714f0982031)
2020-01-16 09:14:03 +00:00
Jiyong Park
3a1602e7f2 List of installed files for each APEX is dist'ed
For each APEX, <apexname>-installed-files.txt is dist'ed to show the
list of files and their sizes that are included in the APEX.

Bug: 147605944
Test: m dist and examine the txt files

Change-Id: I565479523e51280fc88d5fbf8ea3f48ac0ae9fee
2020-01-14 15:20:57 +09:00
Jiyong Park
956305c61c Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""
This reverts commit 4513f703f9.

Bug: 1190898
Test: m
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true NATIVE_COVERAGE=true  m dist

Change-Id: I50fdccabb43e4751694db83ee451d388657257e0
2020-01-09 18:42:27 +09:00
Jooyung Han
ccfffda2ec Merge "Add compat symlinks for prebuilt_apex" 2020-01-09 08:56:13 +00:00
Jiyong Park
8ea6bc4a05 Merge "Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"" 2020-01-09 02:20:42 +00:00
Jiyong Park
4513f703f9 Revert "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 114ff53f5e.

Reason for revert: broke cf_x86_phone-userdebug_coverage 

Change-Id: I7221fd0b0baee5407a7322240c170aef8e549e4d
2020-01-09 02:05:18 +00:00
Treehugger Robot
36746d21a3 Merge "jacoco correctly gathers info from APK-in-APEX" 2020-01-09 00:45:11 +00:00
Treehugger Robot
573326a8ce Merge "m <apex_name>-deps-info prints the internal/external deps of the APEX" 2020-01-09 00:44:13 +00:00
Ulyana Trafimovich
11e1ae025f Merge "Include jacoco in the ART boot image if EMMA_INSTRUMENT_FRAMEWORK=true." 2020-01-08 10:58:24 +00:00
Jiyong Park
618922e510 jacoco correctly gathers info from APK-in-APEX
This change fixes a bug that jacoco-report-classes-all.jar does not
include info for APK-in-APEX such as the MediaProvider apk in
com.android.mediaprovider APEX.

Firstly, LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR is correctly set also for
the APKs included in APEXes. Secondly, the Make modules for the embedded
APKs are now built with soong_app_prebuilt.mk to correctly import the
jacoco file into the Make world.

Bug: 147296855
Test: execute the following command in internal master.
$ choosecombo cf_x86_phone userdebug
$ NINJA_ARGS="-t path out/target/product/vsoc_x86/jacoco-report-classes-all.jar out/target/common/obj/ETC/MediaProvider.com.android.mediaprovider_intermediates/jacoco-report-classes.jar" EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m
The result shows that there is a path as follows:
out/target/product/vsoc_x86/jacoco-report-classes-all.jar
out/target/product/vsoc_x86/apex/com.android.mediaprovider/priv-app/MediaProvider/MediaProvider.apk
out/target/product/vsoc_x86/obj/ETC/MediaProvider.com.android.mediaprovider_intermediates/package.apk
out/target/common/obj/ETC/MediaProvider.com.android.mediaprovider_intermediates/jacoco-report-classes.jar

Change-Id: I52d11534a34eb35219bfafca4453e75a1b701c0e
2020-01-08 14:49:31 +09:00
Jooyung Han
002ab687ac Add compat symlinks for prebuilt_apex
When prebuilt_apex overrides/replaces other apex, the same symlinks need
to be created as well.

Bug: 143192278
Test: 1. add prebuilt_apex with vndk apex
         with overrides set as ["com.android.vndk.current"]
      2. m <prebuilt apex>
      3. check if vndk symlinks are created

Change-Id: I8ee9c981ea9c7202ccf5143b3f43e6848773cd63
2020-01-08 01:57:58 +09:00
Ulya Trafimovich
4456188939 Include jacoco in the ART boot image if EMMA_INSTRUMENT_FRAMEWORK=true.
Test: aosp_walleye-userdebug boots.

Test: Coverage build boots:
  $ lunch aosp_walleye-userdebug
  $ cd $ANDROID_BUILD_TOP
  $ build/soong/soong_ui.bash --make-mode droid \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye \
    TARGET_BUILD_VARIANT=userdebug \
    EMMA_INSTRUMENT=true \
    NATIVE_COVERAGE=true
  $ adb reboot bootloader && fastboot flashall -w

Test: Coverage build with framework coverage boots:
  $ lunch aosp_walleye-userdebug
  $ cd $ANDROID_BUILD_TOP
  $ build/soong/soong_ui.bash --make-mode droid \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye \
    TARGET_BUILD_VARIANT=userdebug \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    NATIVE_COVERAGE=true
  $ adb reboot bootloader && fastboot flashall -w

Test: Static coverage build with framework coverage boots:
  $ lunch aosp_walleye-userdebug
  $ cd $ANDROID_BUILD_TOP
  $ build/soong/soong_ui.bash --make-mode droid \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye \
    TARGET_BUILD_VARIANT=userdebug \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    EMMA_INSTRUMENT_STATIC=true \
    NATIVE_COVERAGE=true
  $ adb reboot bootloader && fastboot flashall -w

Change-Id: Iaa198b8505aaff36e6685559642ff721637ce55f
2020-01-06 16:52:56 +00:00
Jiyong Park
7afd1077b8 APEX carries required properties of its dependencies
When a module is included in an APEX and the module is not directly
installed to the system partition, the 'required' property of the module
is lost. The APEX containing the module now carries the property from
its dependencies.

Bug: 146549048
Test: m
Change-Id: Ie21cc7b8420c6126c855e66c2363644de4a7ef42
2020-01-06 10:41:46 +09:00
Jiyong Park
114ff53f5e m <apex_name>-deps-info prints the internal/external deps of the APEX
We need to have a way to see the list of modules that directly or
indirectly contribute to an APEX. People find it difficult to determine
whether a module is included in which APEXes because APEX tracks
indirect dependencies as well as direct dependencies. Therefore, just
looking at Android.bp for the APEX itself doesn't give the answer.

This change adds a new make target <apex_name>-deps-info, which
generates out/soong/<apex_name>-deps-info.txt file that shows the
internal and external dependencies of the said APEX.
Here, internal means the dependencies are actually part of the
APEX, while external means the dependencies are still external to the
APEX.

Bug: 146323213
Test: m (apex_test amended)
Change-Id: I33d1ccf5d1ca335d71cd6ced0f5f66b8c3886d13
2020-01-02 09:41:30 +09:00
Treehugger Robot
e9391f8bab Merge "Create APEX variation only when needed" 2019-12-28 04:18:59 +00:00
Jiyong Park
3ff1699683 Create APEX variation only when needed
Create an APEX variation of a module only when it is either directly
included in an APEX or the dependency to the module demands that the
module should be included. For example, a non-static dependency to a
java library no longer creates an APEX variant of the library.

Bug: 146907857
Test: m (apex_test amended)
Test: cat out/soong/build.ninja | grep "Module:" | wc -l
reduced from 47132 to 45881

Change-Id: Icd79fb4b60668d852b9f018343b934b5e42a8eda
2019-12-27 14:11:47 +09:00
Jooyung Han
624058e6a5 Dedup generating xml file for java_sdk_library
Permission XML file for java_sdk_library is generated by
java_sdk_library itself now.

And, build rule is switched to android.WriteFile since "echo -e" is
not supported from build server. (-e is printed to output)

Bug: 145474221
Test: m com.android.cronet and check its permissions xml file
     also, m org.chromium.net.cronet.xml (created dynamically)
Change-Id: Iffb119151c49bc4fe6c4386fa267cca193f37dbc
2019-12-26 12:20:24 +00:00
Jooyung Han
5a80d9f352 apex: drop java_import support
java_import doesn't support dex jar which is necessary to be packaged in
an APEX. Supporting this would require non-trivial work. By the way
java_import is not used and there is a workaround.(defining java_library
and static-linking with it)

We drop the support for `java_import` in APEX.

Bug: 139175488
Test: m (soong tests amended)
Change-Id: I924386571079090c701276d87f665ce7fbb6f074
2019-12-23 06:46:39 +00:00
Dario Freni
6f3937cb29 Add support for java_test_helper_app.
Bug: 142712057
Bug: 138429615
Test: apex_test passes, tried building an apex with a test app.
Change-Id: Ib75bd48042d8b1fe102038bef08cd1be708e996d
2019-12-21 08:50:12 +00:00
Jaewoong Jung
dcee89cad6 Merge "Make apex.overrides overridable by override_apex." 2019-12-20 18:20:50 +00:00
Jaewoong Jung
7abcf8ead8 Make apex.overrides overridable by override_apex.
Test: apex_test.go
Change-Id: Id47e5e5bec45ec1ada68f9d2d806585c5141a2f9
2019-12-19 17:32:06 -08:00
Jooyung Han
58f26aba4e Support java_sdk_library as java_libs of apex
When a java_sdk_library module is added, both impl jar and permission
xml files are packaged together.

For example, when a java_sdk_library "foo" is listed, following two
entries will be in an APEX package.

/javalibs/foo.jar
/etc/permissions/foo.xml

Bug: 145474221
Test: m com.android.cronet
      deapexer list com.android.cronet.apex

Change-Id: If5883c02255e9309f20810b1532d3fbe73bf4e95
2019-12-20 08:50:34 +09:00
Jooyung Han
405c7ab959 Merge "Override package name for VNDK APEX" 2019-12-18 01:10:36 +00:00
Jooyung Han
70415ceb9e Merge changes Icbdf4979,I1a6f135d
* changes:
  Fix apex to override certificate
  Fix apex to follow deps of modules with stubs.
2019-12-18 01:04:53 +00:00
Jooyung Han
27151d93b6 Override package name for VNDK APEX
com.android.vndk.v<VER> is overridden with
com.google.android.vndk.v<VERE>.

Test: m com.android.vndk.current
    && aapt2 dump badging ../system/apex/com.android.vndk.current.apex
Change-Id: I623d7a144418d7198f0bbf09c5dc983ed1a631c6
Merged-In: I623d7a144418d7198f0bbf09c5dc983ed1a631c6
(cherry picked from commit 0ed1b1b169)
2019-12-17 15:22:21 +00:00
Jooyung Han
671f1ce75e Fix apex to follow deps of modules with stubs.
In case that an apex module depends on a module with stubs directly
*and* indirectly, the build system should follow the deps graph further.

Note that WalkDeps() visits deps in DFS and it won't visit again visited
modules.

Bug: n/a
Test: m (apex_test.go amended)
Change-Id: I1a6f135dbda6d1eb641575a3fbbc9bbee0622076
2019-12-17 15:18:54 +09:00
Treehugger Robot
1d1a920794 Merge "Support apps attribute in apex_defaults" 2019-12-17 05:44:42 +00:00
Jooyung Han
f21c797f38 Support apps attribute in apex_defaults
Adding overridableProperties to apex_defaults as well.

Bug: 146217017
Test: m
Change-Id: I51182fec25ee589fea4006164c4dd69acc5ba67d
2019-12-16 13:36:34 +00:00
Treehugger Robot
c829ff371e Merge "java libs that isn't installable is gracefully rejected" 2019-12-16 09:56:13 +00:00
Jiyong Park
479321dc34 java libs that isn't installable is gracefully rejected
... rather than causing soong panic.

Bug: 146197571
Test: m (apex_test amended)
Change-Id: I3679a4e3041527533c1c05d54f3aa514abd6095b
2019-12-16 15:59:54 +09:00
Jiyong Park
1833ceff09 fix: LOCAL_PATH for modules included in APEX is wrong
This change fixes a bug that LOCAL_PATH for modules included in an APEX
is set to the path of the APEX bundle, not to the path of the embedded
module. For example, LOCAL_PATH of libconscrypt included in
com.android.adbd was set to /system/core/adb instead of
/external/boringssl. This caused a problem that NOTICE file in
/external/boringssl is not tagged to libconscrypt, but the NOTICE file
for adbd is.

Fixing the problem by recording the module directories of the included
modules and emitting it in LOCAL_PATH.

Bug: 145347092
Test: Settings -> About Phone -> Legal Information -> Third-party
license. The license for /apex/com.android.adbd/lib64/libconscrypt.so is
OpenSSL.

Change-Id: I76f1830d5a10af63fa74dcc2a42730ffabb8c4ed
2019-12-16 10:53:44 +09:00
Treehugger Robot
ac68248051 Merge "Add "legacy_android10_support" to "apex"" 2019-12-14 02:07:16 +00:00
Treehugger Robot
e676810de5 Merge "Install flattened/unflattend apexes for GSI" 2019-12-13 21:10:56 +00:00
Jooyung Han
214bf37311 Add "legacy_android10_support" to "apex"
APEXes with "legacy_android10_support" will have apex_manifest.json for
compatibility as well as apex_manifest.pb.

Bug: 143951586
Test: m (soong tests)
Change-Id: I019252aee5a9423f4b180ba1026e6e99c9961437
2019-12-13 08:47:16 +09:00
Nikita Ioffe
c72b5dd10a Add property to apex soong modules to generate an APEX without hashtree
This will help testing on-device hashtree generation.

Test: see other CL in topic
Bug: 145670581
Change-Id: I96b1b2392302aed8a6e80ed52de2d057a532a288
2019-12-10 11:24:53 +00:00
Oliver Nguyen
1382ab6d31 Add coverage flags for Clang coverage builds.
Bug: 143977934
Test: m CLANG_COVERAGE=true
Test: m NATIVE_COVERAGE=true
Change-Id: I5d07d336e241856961eb0bc9678fdc9d5a076802
2019-12-09 16:35:15 -08:00
Treehugger Robot
cea93afe76 Merge "apex_available is defaultable" 2019-12-06 04:23:37 +00:00
Jooyung Han
3ab2c3e68c Install flattened/unflattend apexes for GSI
GSI targets are supposed to have both 'flattened' and 'unflattened'
APEXes. By adding 'flattened' APEX as REQUIRED moduled for 'unflattened'
APEX, both will be installed togetther.

This is done by a new variable PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES,
which is set only for GSI targets.

Bug: 137802149
Test: lunch aosp_arm64-userdebug && m
  resulting apex images under /system/apex
  and flattened apexes under /system/system_ext/apex

Change-Id: I336e2674e427b358542e0045b2a49dfa3d84095b
2019-12-06 09:52:19 +09:00
Jiyong Park
3814f4df2b apex_available is defaultable
Previously, it was defaultable only for cc_library. Now, it is
defaultable for all module types.

Bug: 128708192
Test: m
Change-Id: If248f593da6f4b724bf889ccd7f2e077d48069b5
2019-12-02 13:48:33 +09:00
Jiyong Park
f653b05d55 Refactor the routine for creating apexFile
This change is to make it easier to add new fields to the struct.
transitiveDep field is added to distinguish apexFiles coming from
transitive dependencies of the APEX. We will later use the info to
reduce the size of bundled APEXes by replacing the transitive deps with
symlinks to the corresponding files in the system partition outside of
the APEX.

Bug: 144533348
Test: m

Change-Id: I283859f2f2f1b5cfb3025569f168ba8569b22bb9
2019-11-30 14:49:13 +09:00