Commit graph

13698 commits

Author SHA1 Message Date
Mathieu Chartier
55eabd5511 Add product property for preopting extracted APKs
The property is PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK. If specified,
this preopts the APK with the default compile filter (quicken).

This will be used to quicken preopt of gmscore dynamite modules when
preopting is disabled. This fixes a possible RAM regression caused
by running out of the APK.

Bug: 65601274
Test: make and flash

(cherry picked from commit 0fbb836cf6)

Merged-In: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
Change-Id: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
2017-10-17 15:57:45 -07:00
Colin Cross
58cd98dc47 Merge "Use system modules generated by soong when using javac -target 1.9" 2017-10-17 18:37:35 +00:00
Treehugger Robot
51e7a0cca4 Merge "Make SOONG_JAVAC_WRAPPER use JAVAC_WRAPPER to call javac." 2017-10-17 05:08:10 +00:00
Colin Cross
f960257c14 Use system modules generated by soong when using javac -target 1.9
Soong has support for building system modules.  Use the directories
produced by Soong with --system to replace -bootclasspath arguments
when using javac -target 1.9.

Since soong can't generate current SDK stubs yet, and no existing
SDK stubs need -target, only use -target 1.9 for modules that are
not compiling against the SDK.  That means in practice the only
system modules that will be used for now is the default one,
core-system-modules.

Bug: 63986449
Test: m -j EXPERIMENTAL_USE_OPENJDK9=true makes some progress
Change-Id: I350ef50aedf36fdd72458c23d4fe8a2edf1a9a02
2017-10-16 17:55:24 -07:00
Dan Willemsen
a0d0ea3b5c Merge "Switch to $(file) instead of a rule to create soong.variables" 2017-10-13 23:22:01 +00:00
Treehugger Robot
cf2da22a2a Merge "Re-apply ndk-docs rule." 2017-10-13 21:04:26 +00:00
Dan Albert
303e603fd2 Re-apply ndk-docs rule.
This time wrapped with a check for the docs directory for unbundled
branches.

Test: make checkbuild
Bug: None
Change-Id: If80f0a03850d6cad3eab6d759af02ff2a7870974
2017-10-13 11:56:17 -07:00
Dan Willemsen
7ad03056dd Switch to $(file) instead of a rule to create soong.variables
Kati seems to have some problems updating this file, and the echo
syntax gets a bit messy. So define some macros and write out the file at
eval time using $(file).

Test: multiproduct_kati -only-config, check soong.variables (on AOSP and internal)
Change-Id: I74279b962918ca1f70fb1d0d25cbb30bd5675041
2017-10-12 21:10:39 -07:00
Treehugger Robot
5f958ccad5 Merge "Adding Android verified boot 1.0 metadata into ENG builds" 2017-10-13 03:39:21 +00:00
Mathieu Chartier
9e89b22ae7 Merge "Re-add missing log filter" 2017-10-13 02:25:08 +00:00
Treehugger Robot
bd4239a1e1 Merge "Use CALLED_FROM_SETUP instead of KATI" 2017-10-13 01:46:11 +00:00
Treehugger Robot
60e1f8ee27 Merge "Support java compilation sharding for target side." 2017-10-13 00:40:37 +00:00
Dan Willemsen
20f99a60ea Use CALLED_FROM_SETUP instead of KATI
So that we can use kati instead of make for the initial config loading.

Test: m clean; m nothing
Test: USE_GOMA=true m nothing
Test: m PRODUCT-aosp_x86-sdk
Test: m APP-Calculator
Test: multiproduct_kati -only-config  (on AOSP and internal master)
Change-Id: I5d3af847607fa48868c2045401977eca37dc6ae1
2017-10-12 15:35:42 -07:00
Mathieu Chartier
f834eccd52 Allow system server jars for WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY
Renamed WITH_DEXPREOPT_BOOT_IMG_ONLY to
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY and changed the
behavior accordingly.

Preopt system server jars since selinux prevents system server from
loading anything from /data. If we don't do this they will need to
be extracted which is not favorable for RAM usage or performance.

Test: make and flash and look at system server maps
Bug: 65122284
Bug: 62356545

(cherry picked from commit 418258cee9)

Merged-In: I2e70c80a86327b455450b95144f21020e7bf0c6f
Change-Id: I316e79c7c6d45e2ccbfff4065137cc3ef9d2738e
2017-10-12 20:40:41 +00:00
Nan Zhang
ad818dcbea Support java compilation sharding for target side.
Add "LOCAL_JAVAC_SHARD_SIZE" to represent the number of java
source path entries in each shard.

Sharding is not allowed when "LOCAL_JAVAC_SHARD_SIZE" and
"LOCAL_JAR_PROCESSORS" are both enabled.

Limitation:
1. 0 <= LOCAL_JAVAC_SHARD_SIZE <= 8192
1. 0 < NUM(java_sources) <= 8192
2. 0 <= NUM(shards) <= 100

Performance Compare:
<Unsharded Build------------------------------------------------>
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	1m2.720s user	5m26.604s sys	0m39.552s

2. Incremental build
m out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar &&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java && time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	0m37.586s user	5m47.804s sys	0m50.388s

<Sharded Build-------------------------------------------------->
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50----real	1m10.163s user	25m59.008s sys	1m58.460s
Javac Shard Size: 100---real	1m2.115s user	21m3.600s sys	1m15.964s
Javac Shard Size: 150---real	0m59.520s user	18m10.544s sys	1m12.628s
Javac Shard Size: 200---real	0m56.894s user	15m39.244s sys	1m11.608s
Javac Shard Size: 250---real	0m55.991s user	14m38.716s sys	1m2.292s
Javac Shard Size: 300---real	0m55.114s user	13m6.568s sys	1m8.200s
Javac Shard Size: 350---real	0m53.144s user	12m7.740s sys	1m3.836s
Javac Shard Size: 400---real	0m54.929s user	12m9.324s sys	1m4.340s
Javac Shard Size: 450---real	1m30.194s user	25m31.468s sys	1m52.416s
Javac Shard Size: 500---real	0m53.976s user	10m35.500s sys	0m55.160s

2. Incremental build
m out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar &&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java && time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50-----real	0m16.322s user	1m8.648s sys	0m31.700s
Javac Shard Size: 100----real	0m16.163s user	1m22.932s sys	0m29.440s
Javac Shard Size: 150----real	0m16.611s user	1m37.828s sys	0m21.168s
Javac Shard Size: 200----real	0m16.936s user	1m49.248s sys	0m28.636s
Javac Shard Size: 250----real	0m17.509s user	1m54.944s sys	0m32.768s
Javac Shard Size: 300----real	0m18.868s user	1m54.088s sys	0m28.824s
Javac Shard Size: 350----real	0m17.629s user	1m54.108s sys	0m31.056s
Javac Shard Size: 400----real	0m18.658s user	2m7.712s sys	0m30.636s
Javac Shard Size: 450----real	0m18.874s user	2m8.808s sys	0m33.540s
Javac Shard Size: 500----real	0m19.432s user	2m24.400s sys	0m30.368s

time m nothing:
real 0m5.799s user 0m7.236s sys 0m3.068s

Test: m clean && m -j checkbuild
Bug: b/67424047
Change-Id: Id0766d2b7de7c4546d29bbc7f8a0dd0e4b9ad45b
2017-10-12 13:23:06 -07:00
Yoshisato Yanagisawa
42b808b18e Make SOONG_JAVAC_WRAPPER use JAVAC_WRAPPER to call javac.
JAVAC_WRAPPER seems not be used when SOONG_JAVAC_WRAPPER is used.
Since JAVAC_WRAPPER just wraps actual javac call, the result must
be the same.

Bug: 67723445
Change-Id: I944f9534587c00ffd1bc79806c534432467ba4a5
2017-10-12 16:04:20 +09:00
Bowgo Tsai
6ceeb1a8bf Adding Android verified boot 1.0 metadata into ENG builds
Adding verified boot metadata with a "disable magic". The resulting
metadata at the end of each image (e.g., system.img, vendor.img) will
be the same as triggering an "adb disable-verity" on an USERDEBUG image.

This can help simplify the code on fs_mgr, which won't have to check if
current image is an ENG build or not.

Bug: 63056044
Test: boot sailfish eng/userdebug builds
Change-Id: I95d23ac7b76c04d6d4483c9c4dc1de16bf0d9c3a
2017-10-12 10:08:44 +08:00
Mathieu Chartier
a996337658 Re-add missing log filter
Was accidentally deleted in a61acf62c9

Test: make
Change-Id: Ib25b5c5b54bfbfa1ec80dfc4a0ee5134c8be2631
2017-10-11 17:10:25 -07:00
Courtney Goeltzenleuchter
d0047d922e Move include in prep of Android.bp support
Test: make
Merged-In: I1d1a240b2557db3d9d0a0b2227f84eff09f8d4ca
Change-Id: I1d1a240b2557db3d9d0a0b2227f84eff09f8d4ca
(cherry picked from commit dd35495a77)
2017-10-11 03:29:53 +00:00
Treehugger Robot
492f67c0ac Merge "Prevent vendor libs from depending on private VNDK libraries" 2017-10-11 01:45:36 +00:00
Colin Cross
9f588bcd15 Merge "Add hostdex support for soong" 2017-10-10 21:52:17 +00:00
Jiyong Park
a3fb1588f4 Prevent vendor libs from depending on private VNDK libraries
For module installed to /vendor partition, direct linking to the libs
marked as `vendor_available: false` is not allowed. The

Bug: 64730695
Test: Add vendor_available: false to libft2 and
libcompiler_rt. Add the two libs into LOCAL_SHARED_LIBRARIES of a vendor
lib (e.g. libdrm). Build fails with the link_type check error message.

Change-Id: Iaf23574ceddb0c087111e1d95997e9ddd60cdf87
2017-10-10 19:38:06 +09:00
Dan Willemsen
2d081b35d4 Fix broken foreach loop
This wasn't initializing the STATS.MODULE_TYPE.* variables, leading to
106kB of stack usage in ckati for sdk_x86_64-eng. With this fixed, the
next highest stack usage is 35kB.

Bug: 36182021
Test: Run $(flavor) over all the variables
Test: Check stack usage with custom ckati patches
Test: build-sdk_x86_64.ninja is identical before/after this change
Change-Id: Id1d8ffb8415ad6613d0093d31be5472d42d300fd
2017-10-10 03:36:42 +00:00
Dan Willemsen
44fd0f6b8e Reduce stack usage in ckati
When limiting ckati to 768kB of stack, it would crash with a segfault
when processing this recursive expanded variable. So always use := to
turn this into a simple variable.

I measured this using 772kB of stack in ckati on sdk_x86_64-eng. With
this change, the next highest stack user is 106kB.

Bug: 36182021
Test: ulimit -s 768; lunch sdk_x86_64-eng; m nothing
Test: build-sdk_x86_64.ninja is identical before/after this change
Change-Id: I20a6396db173decf178107e3aac6cf089e541e36
2017-10-10 03:36:21 +00:00
Colin Cross
abfa40776f Add hostdex support for soong
When LOCAL_IS_HOST_MODULE is set LOCAL_BUILT_MODULE is the same
as common_javalib.jar, and dexpreopting shouldn't be enabled.

Bug: 67600882
Test: m -j checkbuild
Change-Id: I7397fa430ebc18d5cb6ba71b06e343180f09ae08
2017-10-09 17:37:49 -07:00
Alan Leung
ba985e6efe Revert "Enable D8 by default."
Breaks EmulatorSmokeTests

Bug: 67569208

This reverts commit 4c1a09823c.

Change-Id: I85b28b9b59226f4ce6fda0ea2445933eade07d89
2017-10-09 21:24:52 +00:00
Alan Leung
4c1a09823c Enable D8 by default.
Bug: 67569208
Test: m -j32

Change-Id: Ie80ce7ca0e6955ef6c1fbae1fa5b169374068cf4
2017-10-09 07:41:35 +00:00
Colin Cross
f229de4a4b Enable dexpreopt and dex stripping in soong jars
Dexpreopt jars from soong, which also strips classes.dex from
javalib.jar.

Test: m -j checkbuild
Test: unzip -l $OUT/system/framework/core-oj.jar
Change-Id: I06b8efa8993f6c44f0ad8c988e57a3cba08e17ad
2017-10-06 14:36:38 -07:00
Colin Cross
ea1629e788 Refactor removing classes.dex for dexpreopt
Combining $(call dexpreopt-remove-classes.dex) into a
$(call copy-one-file) rule is hacky and error prone.  Make a helper
dexpreopt-copy-jar function that takes LOCAL_DEX_PREOPT and copies
the jar, removing the dex files if necessary.

Test: only description message changes to out/build-${TARGET_PRODUCT}.ninja
Change-Id: Id2fa2d18571ca01bc81302c912b8de25f3dde7a1
2017-10-06 14:26:25 -07:00
Tobias Thierer
c6465f5d17 Merge "Cap LOCAL_JAVA_LANGUAGE_VERSION <= 1.8 for API versions <= 26." 2017-10-06 19:42:57 +00:00
Treehugger Robot
dd68a6cb74 Merge "Don't reserve size for bad blocks when checking image size" 2017-10-06 19:40:29 +00:00
Tobias Thierer
745c6a55d3 Cap LOCAL_JAVA_LANGUAGE_VERSION <= 1.8 for API versions <= 26.
The default LOCAL_JAVA_LANGUAGE_VERSION is normally 1.8, or 1.9
when EXPERIMENTAL_USE_OPENJDK9 is explicitly set to the
nondefault value of "true".

Since old Android API levels do not support later versions,
LOCAL_JAVA_LANGUAGE_VERSIONs is already capped at 1.7 for
APIs <= 23.

This CL further caps it at 1.8 for all released APIs (currently
<= 26) even when EXPERIMENTAL_USE_OPENJDK9=true.
This may need to be updated in future.

This CL only affects builds where EXPERIMENTAL_USE_OPENJDK9 is
set; it does not affect the default build.

Bug: 67454477
Test: Treehugger

Change-Id: I54ca72bdb09aeb4184d5bb3c51d881dcfc943839
2017-10-06 15:57:33 +01:00
Treehugger Robot
0c0e2b0779 Merge "Use prebuilts/jdk/jdk9 if EXPERIMENTAL_USE_OPENJDK9 is set" 2017-10-06 04:34:52 +00:00
Colin Cross
d7b99409ce Use prebuilts/jdk/jdk9 if EXPERIMENTAL_USE_OPENJDK9 is set
Bug: 62123342
Test: m -j EXPRIMENTAL_USE_OPENJDK9=1.8 checkbuild
Change-Id: I8be331c422412d6416d92184a2eba093f27fc0fb
2017-10-05 16:47:54 -07:00
Dan Willemsen
e3c99016f9 Always pass --auto-add-overlay to aapt2 for aar prebuilts
Bug: 64723465
Test: Build all aar prebuilts in our internal tree
Change-Id: I82ef8d59d4f710b755226b2801dc65c2ccffe40c
2017-10-05 14:55:11 -07:00
Jiyong Park
03eb06150b Don't reserve size for bad blocks when checking image size
When checking *.img size with the partition size, the build system
reserves additional bits for spare bits and spare bad blocks.

However, for emmc and ufs, the space bits and blocks are entirely
managed by the underlying controller and thus not visible from outside
of the controller. In fact the check routine was made for legacy MTD
storages where raw flash blocks are directly exposed.

This makes the size checking a little bit conservative in modern devices.
Builds were failed even though the *.img can actually fit into the
partition. To handle this problem, the additional size is no longer
reserved when checking *.img size with the partition size.

This change also removes following build flags that are meaningful
only for devices having MTD storages:
BOARD_NAND_PAGE_SIZE
BOARD_NAND_SPARE_SIZE
Further use of them breaks the build

Bug: 35790399
Bug: 66399382
Test: build

Merged-In: I954bf261441b53844e75d05788866f1692a2ad43
Change-Id: I954bf261441b53844e75d05788866f1692a2ad43
2017-10-04 21:25:08 +09:00
Alan Leung
013a37b760 Add USE_D8_BY_DEFAULT in makefile.
Bug: 65854021
Test: m USE_D8=true  showcommands out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/with-local/classes.dex
Change-Id: Iec1a05bf6f03cf856faf2e013fa169e1a0beaf7a
2017-10-03 17:15:01 -07:00
Colin Cross
b33250278b Merge "Revert "Generate the NDK docs with the ndk-docs target."" 2017-10-04 00:13:54 +00:00
Colin Cross
c294f55489 Revert "Generate the NDK docs with the ndk-docs target."
This reverts commit d51b6d0d75.

Reason for revert: Broke all unbundled builds

Change-Id: Id6722a076ee91ca150b1a53935632579c6f6f6dd
2017-10-04 00:13:00 +00:00
Treehugger Robot
0f47dd4c13 Merge "Generate the NDK docs with the ndk-docs target." 2017-10-03 22:11:17 +00:00
Dan Albert
d51b6d0d75 Generate the NDK docs with the ndk-docs target.
Test: make ndk-docs
Bug: None
Change-Id: I846f18c2d466d18603bb3ba59aaed7a9c938b1e3
2017-10-03 13:08:25 -07:00
Treehugger Robot
b039cf792f Merge "Delete jack support" 2017-10-03 01:17:25 +00:00
Dan Willemsen
f439c334da Fix incremental aapt builds
If a resource was moved / removed without any other timestamp updates,
ninja would not re-run aapt. To fix this, add a list of resource files
into the same command as aapt (echo ... >/dev/null). That way if the
list changes, ninja will recognize the command line changing and rerun
aapt.

Bug: 67315436
Test: mmma cts/tests/autofillservice
Test: mv cts/tests/autofillservice/res/layout/welcome_activity.xml \
      cts/tests/autofillservice/res/layout/welcome_activity_test.xml
Test: mmma cts/tests/autofillservice

Change-Id: Ia93ac4ff48910fed74a1f1539ce4e1f5a9db023f
2017-10-02 14:22:02 -07:00
Colin Cross
e673deb280 Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 11:15:19 -07:00
Dan Willemsen
4d99527dcd Move generated aidl/logtags java classes to a subfolder
So that they can't be generated into src/, which would be added to the
source list automatically.

Bug: 36698184
Test: m telephony-common without this change, pass
Test: m telephony-common without the cleanspec, fail with dup class
Test: m telephony-common with the cleanspec, pass
Change-Id: I7b2fc1847d52ff4a9ba8c69e76123fe152629ef8
2017-09-29 20:36:50 -07:00
Dan Willemsen
ba9b0fbc05 Fix multiple output file generation for AAPT2
Make R.stamp actually part of the same rule that creates R.java.
Otherwise if the generated sources directory is removed, we don't
regenerate R.java / Manifest.java.

Also move the package-export.apk and proguard options file into the same
rule.

Test: m telephony-common; rm out/target/common/obj/*/*_intermediates/src; m telephony-common
Change-Id: I71f6fcaf20593ca23271d52d15537aaa9ef4cc77
2017-09-29 20:35:32 -07:00
Colin Cross
9deb331f20 Respect LOCAL_MIN_SDK_VERSION for dx
Follow Jack's behavior for now and pass LOCAL_MIN_SDK_VERSION to
dx.  Don't pass it to desugar for now, desugar with low
--min_sdk_version numbers enables features we haven't verified
yet, and existing apps won't be using the new language features
that require extra desugaring.

Test: examine classes.dex from an app with LOCAL_MIN_SDK_VERSION
Change-Id: Ic7d679b1b11fba98a33418a4f79d4762a91f1f9c
2017-09-28 21:40:35 -07:00
Treehugger Robot
480ee2e58c Merge "Disable jack completely" 2017-09-28 00:34:50 +00:00
Colin Cross
6684528a6d Disable jack completely
Always set ANDROID_COMPILE_WITH_JACK=false.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I98dfdca27b4338048d50e016a79fbf4e3d86a020
2017-09-27 13:17:59 -07:00
Treehugger Robot
5118763940 Merge "Add -lm to the default libs for Linux & Darwin" 2017-09-27 07:08:57 +00:00