Commit graph

17143 commits

Author SHA1 Message Date
Jaewoong Jung
7c5bd835d0 Keep signatures of presigned prebuilt test apps.
Skip the JNI uncompress step for presigned prebuilt test apps. They
don't need it, and they can invalidate the signature. Also, fix the
install partition of prebuilt test apps.

Fixes: 143472191
Test: app_test.go
Test: Converted CtsShimPrivUpgradePrebuilt to bp and checked the
final output apk signature.

Change-Id: Ied7d3576b5db4de40a9ca9e388336229d07212f5
2020-01-15 14:33:32 +00:00
Elliott Hughes
5ce6dfbd36 Merge "Switch to toybox gzip." 2020-01-13 17:21:02 +00:00
Treehugger Robot
40ef4b926d Merge "use symlink for bundled APEX" 2020-01-13 16:05:45 +00:00
Ulyana Trafimovich
4d9c97bd77 Merge "Use boot image extension in the JIT-zygote experiment." 2020-01-13 10:38:01 +00:00
Ulyana Trafimovich
289bd28f17 Merge "Do not add jacocoagent to framework libraries in static coverage builds." 2020-01-13 10:25:16 +00:00
Yo Chiang
72d009e1ec Merge "Don't dexpreopt APEX variant modules" 2020-01-13 03:15:50 +00:00
Treehugger Robot
eecf99ce66 Merge "A test cc module is installable even if it's not available for platform" 2020-01-13 00:31:58 +00:00
Treehugger Robot
ae7cddd5ad Merge "Sandbox soong_build by changing to root directory" 2020-01-11 06:00:21 +00:00
Colin Cross
988414c2cf Sandbox soong_build by changing to root directory
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.

Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
2020-01-11 01:11:46 +00:00
Treehugger Robot
5fa3a1f743 Merge "Rename OverridableModuleBase.properties." 2020-01-10 23:59:34 +00:00
Colin Cross
e734832d25 Merge "Revert "Sandbox soong_build by changing to root directory"" 2020-01-10 22:00:59 +00:00
Jaewoong Jung
b64dd002b3 Rename OverridableModuleBase.properties.
The generic name causes confusion, even to the IDE.

Test: TreeHugger
Change-Id: I0cb4959ab41b4732e7ee7a5d1d818ef771674023
2020-01-10 13:26:00 -08:00
Colin Cross
47e4f9e1e8 Revert "Sandbox soong_build by changing to root directory"
This reverts commit 05c25ccb4a.

Reason for revert: broke absolute OUT_DIR
Bug: 146437378

Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
2020-01-10 18:51:04 +00:00
Colin Cross
e35e961aa9 Merge "Sandbox soong_build by changing to root directory" 2020-01-10 17:35:22 +00:00
Treehugger Robot
2827ccc126 Merge "Add FLAG_compare to whitelisted environment variables" 2020-01-10 16:49:22 +00:00
Matthew Maurer
9155b298fd Merge "Remove libterm from implicit crates" 2020-01-10 16:23:32 +00:00
Ulya Trafimovich
57547452cf Use boot image extension in the JIT-zygote experiment.
Test: temporarily enable JIT-zygote configuration, build, boot the
  device and ensure that the JIT-zygote specific boot image
  apex-framework.art is mapped in the zygote address space:

  1. enable Jit zygote in the product device config (in my case
    device/google/muskie/aosp_walleye.mk):

    +# System server should not contain compiled code.
    +PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := verify
    +
    +# Use the apex image for preopting.
    +DEXPREOPT_USE_APEX_IMAGE := true
    +
    +# Have the runtime pick up the apex image.
    +PRODUCT_PROPERTY_OVERRIDES += \
    +    dalvik.vm.boot-image=/apex/com.android.art/javalib/apex.art:/system/framework/apex-framework.art

  2. lunch aosp_walleye-userdebug \
    && m \
    && adb reboot bootloader \
    && fastboot flashall -w

  3. adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex-framework.art
  6fe44000-7025c000 rw-p 00000000 fc:02 1179718                            /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art
  70571000-70696000 rw-p 0072d000 fc:02 1179718                            /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art
  75a339f000-75a33ac000 r--p 00852000 fc:02 1179718                        /data/dalvik-cache/arm64/apex@com.android.art@javalib@apex-framework.art

Change-Id: I5493e575ebf90bad1d5ad2850004d54590bbc079
2020-01-10 15:29:25 +00:00
Colin Cross
05c25ccb4a Sandbox soong_build by changing to root directory
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
2020-01-09 14:19:46 -08:00
Matthew Maurer
e7d7b6d924 Remove libterm from implicit crates
This is no longer shipped by rustc, and wasn't really intended to be
implicitly available in the first place.

Bug: 147432625
Test: Built a sample rust device binary
Change-Id: I3c33ac3726c788debe14ed39a9ecbae7a7449351
2020-01-09 12:24:58 -08:00
Kousik Kumar
ade12e744a Add FLAG_compare to whitelisted environment variables
Bug: b/147419757
Test: Ran a compare build and tested that compare mode works again

Change-Id: I743d5070673f3ec9d0c2b099019f88935f3894fc
2020-01-09 08:53:01 -08:00
Ulyana Trafimovich
a773c39bfc Merge "Revert^2 "Use boot image extension for framework libraries."" 2020-01-09 13:20:36 +00:00
Yo Chiang
dbdf8f9c2e Don't dexpreopt APEX variant modules
Java modules that are APEX variant won't be dexpreopted.

After applying this CL,
- $(ANDROID_PRODUCT_OUT)/apex/com.android.appsearch/javalib/service-appsearch.jar
- $(ANDROID_PRODUCT_OUT)/apex/com.android.cronet/javalib/org.chromium.net.cronet.jar
- $(ANDROID_PRODUCT_OUT)/apex/com.android.os.statsd/javalib/service-statsd.jar
- $(ANDROID_PRODUCT_OUT)/apex/com.android.telephony/app/StkLib/StkLib.apk

above four files are not preopted, thus the dex files aren't uncompressed.

FIle size of JAR/APK is (before / after):
- service-appsearch.jar:        697594 / 273354
- org.chromium.net.cronet.jar:  607206 / 239990
- service-statsd.jar:           90806 / 41857
- StkLib.apk:                   6424332 / 2942719
File size of APEX is (before / after):
- com.android.appsearch.apex:   854851 / 432963
- com.android.cronet.apex:      4982739 / 4618195
- com.android.os.statsd.apex:   322319 / 322319
- com.android.telephony.apex:   6596717 / 3111021

Bug: 146984232
Test: lunch aosp_cf_x86_phone-userdebug; m
Test: Build aosp_cf_x86_phone with and w/o this CL and compare artifacts.
      After applying this CL, javalibs and apps embedded inside APEX
      were not preopted, thus dex file are not uncompressed.

Change-Id: I296173bc29d0df0c4d5cc59e4b070e5c4d3b50d5
2020-01-09 20:08:15 +08:00
Ulya Trafimovich
38dfa0fa18 Do not add jacocoagent to framework libraries in static coverage builds.
Framework libraries need special handling in static coverage builds:
they should not have static dependency on jacoco, otherwise there
would be multiple conflicting definitions of the same jacoco classes
coming from different bootclasspath jars.

This CL does two things:

- Move the code that enables instrumentation of framework libraries
  from AndroidGenerateBuildActions phase to the earlier DepsMutator
  phase. This is necessary because DepsMutator phase already does some
  things that depend on the instrumentation flag.

- Explicitely exclude framework libraries from those libraries
  which have static dependency on jacoco.

This CL does not fix any apparent build problems: prior to it the
framework libraries were not excluded properly, but this was masked by
wrong order of checking / setting instrumentation flag.

Note that static coverage builds without framework coverage fail to
boot, namely this build command:

  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_STATIC=true \
    NATIVE_COVERAGE=true

..causes the following boot-time errors in logcat:

    01-08 12:31:48.670  1252  1252 E System  : java.lang.StackOverflowError: stack size 8192KB
    01-08 12:31:48.670  1252  1252 E System  :      at org.jacoco.agent.rt.internal.Offline.$jacocoInit(Unknown Source:13)
    01-08 12:31:48.670  1252  1252 E System  :      at org.jacoco.agent.rt.internal.Offline.getProbes(Unknown Source:0)

Also note that static coverage with framework coverage failed to build
prior to CL Iaa198b8505aaff36e6685559642ff721637ce55f (dex2oat failed
to create boot image due to missing classes).

Test: non-static coverage without framework coverage boots:
  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    NATIVE_COVERAGE=true

Test: non-static coverage with framework coverage boots:
  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    NATIVE_COVERAGE=true

Test: static coverage with framework coverage boots:
  $ build/soong/soong_ui.bash --make-mode \
    SKIP_ABI_CHECKS=true \
    TARGET_PRODUCT=aosp_walleye TARGET_BUILD_VARIANT=userdebug droid \
    EMMA_INSTRUMENT=true \
    EMMA_INSTRUMENT_FRAMEWORK=true \
    EMMA_INSTRUMENT_STATIC=true \
    NATIVE_COVERAGE=true

Change-Id: I700f979a5d638ce632f5e8b920b9d0adb3c80248
2020-01-09 10:39:13 +00:00
Jooyung Han
ccfffda2ec Merge "Add compat symlinks for prebuilt_apex" 2020-01-09 08:56:13 +00:00
Jiyong Park
fe9a43002e A test cc module is installable even if it's not available for platform
This change fixes a bug that test modules (cc_test or its sub types) are
unconditionally considered as non-installable if they are configured to
not available for platform. The rationale behind the decision was that
an APEX variant of a module doesn't need to be installed to the device
because the variant will anyway be included in the APEX. However, it's
wrong for test modules. They are not included in the APEX, but should be
installed to /data/nativetest*.

One might think that we need to make the tests available for the
platform (i.e. apex_available: ["//apex_available:platform"]). This
however doesn't work if the libraries that the tests should link against
are configured to be not available for the platform, which currently is
the case for the ART tests.

Bug: 146995717
Test: m
Change-Id: I51843f5b4ea0a418c64c63784347231590cd3c35
2020-01-09 13:20:34 +09: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
Treehugger Robot
62c085d7fe Merge "Define a make variable for merged compat config." 2020-01-08 21:26:23 +00:00
Ulyana Trafimovich
5a4ccd1816 Revert^2 "Use boot image extension for framework libraries."
This reverts commit 3fae7662ee
Reason: re-applying the change after resolving the problem with
coverage builds (in a related CL).

Use boot image extension for framework libraries.
This patch splits the system boot image in two parts:

  - The ART boot image. This is the primary boot image that is
    included in the ART apex and contains dexpreopted Core Libraries.

  - The framwework boot image extension. It depends on the ART boot
    image and contains framework libraries.

The third "apex" boot image (used in the JIT-zygote experiment)
remains unchanged; it is a monolithic primary boot image that
contains both libcore and framework libraries.

Dexpreopting of APKs now uses the framework boot image extension
(which in turn pulls in the ART boot image as a dependency).

Bug: 146462581
Bug: 119800099

Test: aosp_walleye-userdebug boots.

Change-Id: I06c5ac5fca011fa639ed208735462ab32451df3a
2020-01-08 15:56:52 +00:00
Mathew Inwood
653c78a909 Define a make variable for merged compat config.
This allows it to be added to the dist target.

Test: m dist
Change-Id: I1d913577f43a2ba3cb134ed35a7c98be76da2bd1
2020-01-08 11:24:58 +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
Martin Stjernholm
46f60291f3 Merge "Move generation of the dexpreopt tool paths into Soong." 2020-01-08 10:40:28 +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
Steven Moreland
4b662e4d3b Merge "vibrator: use package as name" 2020-01-07 22:43:01 +00:00
Yi Kong
563e3a4f95 Merge "Support sampling PGO profiles" 2020-01-07 22:18:12 +00:00
Colin Cross
07c8856904 Delay invalid sdk_version error for AllowMissingDependencies
Unbundled builds set AllowMissingDependencies and attempt to use
prebuilts for some jars.  Delay the errors for missing jars for
modules with invalid sdk_version values in unbundled builds so
that they only block the build if those modules are built.

Also fix some error messages to show the original sdk_version
value.

Bug: 146513037
Test: m TARGET_BUILD_APPS=Camera2
Change-Id: I1812ef6dc80895f7a2162a8bdbf2c5067755e9a0
2020-01-07 20:14:14 +00: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
Martin Stjernholm
c52aaf11d0 Move generation of the dexpreopt tool paths into Soong.
The dexpreopt global config is now split into the part that is generated
from make (in build/make/core/dex_preopt_config.mk) and the part that is
generated from Soong. Since the goal is to generate the dex2oat path from
Soong dependencies, the old GlobalConfig.Tools struct is simply repurposed
for the Soong generated config, although the intention is to allow more
settings to migrate from make to Soong, and hence from GlobalConfig to
GlobalSoongConfig.

Since the new dexpreopt_soong.config is written from a Soong-created ninja
rule, it doesn't need to be rewritten to out/soong/<device>/ like the old
make-created config file.

Test: m
Test: env USE_DEX2OAT_DEBUG=false m
  (check that out/soong/dexpreopt_soong.config points to dex2oat instead of dex2oatd)
Bug: 145934348

Change-Id: Ifd45c4a08e2ec55b86f4a93f0d85bd39cf2cf189
2020-01-07 14:15:42 +00:00
Ulyana Trafimovich
99d522b5df Merge "Respect JIT-zygote config when generating boot image location." 2020-01-07 10:48:45 +00:00
Jiyong Park
58ab941c6c use symlink for bundled APEX
For bundled APEXes, files that are included in the APEX due to
transitive dependencies are replaced with symlinks to the same files in
the system partition. For example, /apex/com.android.art/lib/libbase.so
is a symlink to /system/lib/libbase.so. This is to reduce the
storage/ram overhead of APEXes.

Note that this optimization is done only for bundled APEXes (i.e. APEXes
that are built "WITH" the platform and pre-installed). Unbundled APEXes
(i.e., APEXes for Mainline modules built/signed by Google) are not
affected.

Bug: 144533348
Test: m (test amended)
Change-Id: I1ed21b1d47d93d2b8c296f8f227105031b29afed
2020-01-07 16:03:48 +09:00
Dan Shi
13f30ae38c Merge "Pass auto_gen_config setting in Android.bp to makefile" 2020-01-07 06:23:04 +00:00
Treehugger Robot
64d5ccef7a Merge changes from topic "carry_required"
* changes:
  APEX carries required properties of its dependencies
  *RequiredModuleNames functions are available via Module interface
2020-01-07 03:51:29 +00:00
Treehugger Robot
9a3f61cd43 Merge "Remove unused system_modules" 2020-01-07 03:51:09 +00:00
Dan Shi
2468d015fe Pass auto_gen_config setting in Android.bp to makefile
Bug: none
Test: local test with fuzzy_fastboot
Change-Id: I2c62f6fb58737538ef9e1e9fcbe63e03dfa7ee91
2020-01-06 16:21:10 -08:00
Colin Cross
e35ff4aeb3 Merge changes from topic "blueprint_scoped_module_factories"
* changes:
  Use blueprint's load hooks
  Use blueprint.EarlyModuleContext
2020-01-06 22:45:44 +00:00
Steven Moreland
9dbe4035ef vibrator: use package as name
In order to provide a more descriptive name, and to be consistent
with HIDL, the stable AIDL package names are switching from
vintf-vibrator format to the package format
(android.hardware.vibrator).

Bug: N/A
Test: all build time
Change-Id: Ie6580714c3d09c1f99808ca9f8dc7875487f1049
Merged-In: Ie6580714c3d09c1f99808ca9f8dc7875487f1049
2020-01-06 14:08:00 -08:00
Treehugger Robot
a62862bd08 Merge "Allow EMMA_INSTRUMENT_FRAMEWORK during ninja" 2020-01-06 21:59:31 +00:00
Treehugger Robot
7d20c4407c Merge "Add EarlyModuleContext for LoadHookContext" 2020-01-06 21:43:03 +00:00