Commit graph

1774 commits

Author SHA1 Message Date
Treehugger Robot
0c9c0f045f Merge "Remove unused java_sdk_library_import properties" 2020-01-22 06:03:25 +00:00
Paul Duffin
29f5576357 Remove unused java_sdk_library_import properties
The properties are just passed through to the java_import module that
it creates to import the stubs so could be used if set. However, none
of the current usages of java_sdk_library_import actually set them and
it is not clear why the following would ever be set on
java_sdk_library_import:
* installable
* exclude_files
* exclude_dirs

The above properties look as though they were simply copied from the
ImportProperties struct.

The libs property is also unused but it seems as though it should be
used to improve compatibility with the source module. e.g.
the source module for android.test.runner has android.test.base and
android.test.mock in its libs. However, the prebuilt version of it
does not.

Bug: 148080325
Test: m nothing
Change-Id: I710e3962b2e34b2b0cc81685d07d4948cef4e6ad
2020-01-21 18:37:58 +00:00
Pete Gillin
230e241f58 Revert "Allow codename.fingerprint format for minSdkVersion"
This reverts commit 014a85712d.

Reason for revert: Caused vendor/google/build/build_mainline_modules.sh to fail with `Error: minSdkVersion (10000) is greater than maxSdkVersion (30)`.

Bug: 130541924
Change-Id: Ifa233bf40a674481d21b61ee816c5fdde8201080
2020-01-21 13:44:50 +00:00
Baligh Uddin
014a85712d Allow codename.fingerprint format for minSdkVersion
Use codename.fingerprint format for minSdkVersion if it is unset
in the manifest and
UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true.

Using a utility function in sdk.go to check whether to apply
api.fingerprint.

BUG: 130541924
Change-Id: I748a25c419033bf54b63171d334644fcd0ecc78f
2020-01-20 07:46:12 -08:00
Jaewoong Jung
a929cd52ce Merge "Overwrite test-file-name in test config." 2020-01-17 19:07:12 +00:00
Jaewoong Jung
3998234d8c Overwrite test-file-name in test config.
If the install apk name is different than the module name, use
test_config_fixer to update the test-file-name value in the config.

Test: app_test.go
Fixes: 147375216
Change-Id: I2141eeebbb3552995400b45634712306673fd812
2020-01-17 06:08:12 -08:00
Anton Hansson
91133e6e44 Add framework-sdkextensions to jars to instrument
Required to get code coverage.

Bug: 143937446
Test: verify LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR is set
      for framework-sdkextensions
Change-Id: I2cdb8ce60939a91f8473c2ddd2a8ff198cd7c92e
Merged-In: I2cdb8ce60939a91f8473c2ddd2a8ff198cd7c92e
(cherry picked from commit 9492b09dae)
2020-01-17 09:57:52 +00:00
Treehugger Robot
1be2d48005 Merge "Save compilation units in protobuf format." 2020-01-16 18:55:26 +00:00
Treehugger Robot
a35294889f Merge changes I0668ff5a,Iff2d7063,I6f8b1e2d,I126db49d,Ic6582260
* changes:
  Exclude source->prebuilt deps from visibility enforcement
  Dedup package build components registration
  Support registering hard coded pre arch mutators
  Added java_system_modules_import
  Document java_system_modules
2020-01-16 02:09:36 +00:00
Treehugger Robot
0b3a5781a9 Merge "Add basic test for java_system_modules" 2020-01-16 02:03:44 +00:00
Jaewoong Jung
275eb69d0a Merge "Keep signatures of presigned prebuilt test apps." 2020-01-15 23:17:02 +00:00
Sasha Smundak
6c2d4f91f8 Save compilation units in protobuf format.
Bug: 146224091
Test: manual
Change-Id: I7a856bab13f54c78efa0061421c3fcb9341bc6e7
2020-01-15 12:40:03 -08:00
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
Paul Duffin
a7b9f42587 Add basic test for java_system_modules
Bug: 142940300
Test: m nothing
Change-Id: I8855df0832f93e40d31e457191590458c274bb5c
2020-01-15 11:17:57 +00:00
Paul Duffin
90169baf0e Added java_system_modules_import
A prebuilt version of java_system_modules. It does not import the
generated system module, it generates the system module from imported
java libraries in the same way that java_system_modules does. It just
acts as a prebuilt, i.e. can have the same base name as another module
type and the one to use is selected at runtime.

Bug: 142940300
Test: m nothing
Change-Id: I126db49d18294fcd6e2b7ad0237f83e9c2fdef7a
2020-01-15 11:17:57 +00:00
Paul Duffin
cded5ecfc3 Document java_system_modules
Bug: 142940300
Test: m nothing
Change-Id: Ic658226088615dbeeef15f17dbb095a968e0742d
2020-01-15 11:17:57 +00:00
Treehugger Robot
814bebb8ea Merge "Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"" 2020-01-15 06:12:45 +00:00
Inseob Kim
a46c2b1994 Merge "Allow sdk and core modules to use sysprop_library" 2020-01-15 00:32:00 +00:00
Anton Hansson
ee76fba905 Merge "Make android_test_helper_app support apex_available" 2020-01-14 12:59:17 +00:00
Jiyong Park
83dc74b770 Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 7cb4d378e7.

Test: m
Test: ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist ./art/tools/dist_linux_bionic.sh -j80 com.android.art.host
(in the master-art-host branch)

Change-Id: I9beca73aafdf42f03bfa19cf1634b2641dac417b
2020-01-14 18:40:56 +09:00
Jiyong Park
a7503367cf Merge "Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""" 2020-01-14 08:58:17 +00:00
Jiyong Park
7cb4d378e7 Revert "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX"""
This reverts commit 956305c61c.

Reason for revert: broke master-art-host branch
Exempt-From-Owner-Approval: reverting a bad change

Change-Id: Id7faed4ee85328c7c65847a3543ea9e67a3d50b3
2020-01-14 08:58:02 +00:00
Inseob Kim
c52395135f Allow sdk and core modules to use sysprop_library
This allows javaSdk and javaCore modules to link against Public stub of
Platform owned sysprop_library.

Bug: 141246285
Test: m nothing
Change-Id: Ie11c43cc72ddd0ee13e4163955775c13eb9dbe92
2020-01-14 15:58:59 +09:00
Treehugger Robot
17c51a4ff6 Merge "Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""" 2020-01-14 02:40:42 +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
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
Colin Cross
e734832d25 Merge "Revert "Sandbox soong_build by changing to root directory"" 2020-01-10 22:00:59 +00: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
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
Anton Hansson
3d2b6b452a Make android_test_helper_app support apex_available
Needed in order to enforce apex_available is set for
everything that gets added to apexes.

Bug: 147364041
Test: apex_test.go
Change-Id: I083ec35283c4c7b5101d00139416d0734b97bab4
2020-01-10 15:06:01 +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
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
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
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
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