Commit graph

17317 commits

Author SHA1 Message Date
Vic Yang
d92090fb29 Emit LOCAL_CHECK_SAME_VNDK_VARIANTS
If a VNDK library does not require using different core and vendor
variants, emit LOCAL_CHECK_SAME_VNDK_VARIANTS so that the two variants
can be checked for identicalness.

Bug: 145157349
Test: With the corresponding change in build/make, remove libbinder
      from build/soong/cc/config/vndk.go and check a build fails
      even without TARGET_VNDK_USE_CORE_VARIANT set.

Change-Id: I7698edf9a24b0df150c0e4f7d8dd4926f053eee8
2020-01-08 14:44:38 -08: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
Dan Willemsen
5cacfe1e24 Allow EMMA_INSTRUMENT_FRAMEWORK during ninja
This is used by the art apex test.

Bug: 147197813
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true art-check-debug-apex-gen
Change-Id: Id185cd35f16131f2c9a8afeba2e5b87834b0e620
2020-01-06 12:25:40 -08:00
Colin Cross
31a738bda0 Use blueprint's load hooks
Make android.AddLoadHook wrap blueprint.AddLoadHook.  Also pass
the config object to ParseBlueprintsFiles.

Test: all soong tests
Change-Id: I60c988b717d395f52498ec23ef7c9046d9861a6e
2020-01-06 10:57:26 -08:00
Colin Cross
c34d2329b4 Use blueprint.EarlyModuleContext
Make android.EarlyModuleContext wrap blueprint.EarlyModuleContext

Test: m checkbuild
Change-Id: I5e05c4f3dfb177811bc244a5cc2d71f42e47613b
2020-01-06 10:57:24 -08: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
Treehugger Robot
a1af29ae4d Merge "Verify APIs are compatible with last released api by default" 2020-01-06 16:43:29 +00:00
Mathew Inwood
ac65c69913 Merge "Singleton build rule for merged compat config." 2020-01-06 16:32:54 +00:00
Treehugger Robot
30d4876861 Merge "Update rustc version to 1.40.0" 2020-01-06 16:18:39 +00:00
Ulya Trafimovich
3391a1e85f Respect JIT-zygote config when generating boot image location.
Earlier CL Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826 introduced
Soong-generated Make variable 'DEXPREOPT_IMAGE_LOCATIONS'. That CL was
erroneous in that it did not take JIT-zygote config into account and
generated identical location for "boot" and "apex" boot images.

This caused build breakages, because in case of JIT-zygote config the
two variables 'DexPreoptImages' and 'DexPreoptImageLocations' in the
module's dexpreopt.config were out of sync: 'DexPreoptImages' was
for the "apex" image, and 'DexPreoptImageLocations' was for the "boot"
image.

CL I9a91fc48e54d7d43abec2cb2b5a11e3581db380b introduced a workaround
for this problem: incorrect 'DexPreoptImageLocations' from the module
dexpreopt.config was ignored, and instead boot image location was
manually reconstructed from 'DexPreoptImages'. This workaround would
not work when we start using boot image extension and location will
become more complex.

This CL fixes the way 'DexPreoptImageLocations' is generated by
spliting the 'DEXPREOPT_IMAGE_LOCATIONS' variable in two variables
depending on the boot image flavour "boot" of "apex". This is
aligned with the way other similar variables are generated.

Test: aosp_walleye-userdebug boots.
Test: walleye_jitzygote-userdebug builds
  (on git_rvc-release branch with this CL cherry-picked).

Change-Id: I93415227564522bce4250d281d561e708a022101
2020-01-06 16:01:55 +00:00
Paul Duffin
a465e435c2 Verify APIs are compatible with last released api by default
Previously, the checking of the current API for compatibility with the
previously released API was only enabled for a white list of targets
which included api-stubs-docs and system-api-stubs-docs. This change
replaces the white list of targets to check with a black list of targets
not to check so that the checks are performed by default.

The black list currently consists only of android.car-system-stubs-docs.

Bug: 134485888
Bug: 123222452
Test: m checkapi with an incompatible conscrypt API
Change-Id: I3b48b6cfb61e1f39d74fc48d9d2c0415f886d959
2020-01-06 15:19:02 +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
6a8cf5fab4 *RequiredModuleNames functions are available via Module interface
...so that the required module names can be known to other modules

Bug: N/A
Test: m
Change-Id: Ib032b51c4ea4fd77bdebcf09b2d1c2aec1c8eb27
2020-01-06 10:35:58 +09:00
Treehugger Robot
17cf0ab3bc Merge "java_sdk_library: Ensure that stubs library is not installed" 2020-01-05 19:01:10 +00:00
Treehugger Robot
bcb6041b2a Merge "java_sdk_library: Allow creation of impl shared library to be disabled" 2020-01-05 18:26:27 +00:00
Treehugger Robot
7e96dac325 Merge "java_sdk_library: Allow api dir to be specified" 2020-01-05 16:49:27 +00:00
Dan Willemsen
7da042912b Likely fix SANITIZE_HOST=address builds
We're passing in ASAN_OPTIONS=detect_leaks=0 on the command line, and
the build started failing after we limited the environment.

Test: forrest of aosp-master/aosp_x86_64-eng
Change-Id: I42c91897c7677e1a249412e5a8bc7bb1edb2f881
2020-01-04 13:58:54 -08:00
Dan Willemsen
2de4152e61 Merge "Limit environment during ninja" 2020-01-04 17:51:03 +00:00
Colin Cross
1184b647d5 Add EarlyModuleContext for LoadHookContext
Make LoadHookContext embed a new EarlyModuleContext instead of
BaseModuleContext to reduce its API surface in preparation for
moving it to run during parsing instead of mutators.

Test: m checkbuild
Change-Id: I1cd3ff3b636e7e24991a9184d7521903473e505a
2020-01-04 08:40:55 -08:00
Colin Cross
68534a29d6 Don't print critical path parallelism ratio if elapsed time is 0.
Test: m nothing, examine out/soong.log
Change-Id: Ib23902c703d306337b2a5150d6d63b1e3d0f95b3
2020-01-04 07:26:28 +00:00
Treehugger Robot
6e3b471d3d Merge "Remove files that should no longer be installed" 2020-01-04 05:16:24 +00:00
Dan Willemsen
1e775d7619 Remove files that should no longer be installed
Make now exports (partial) lists of what should be installed. Those
lists are incomplete, but if something is removed from the list, we can
remove it from the filesystem so that incremental builds work better.

Test: built-in tests (m blueprint_tools)
Test: remove a module from PRODUCT_PACKAGES, see the print and file removed
Test: change the name of a cts test, see the old one removed from cts
Change-Id: I6bc14c6a5af63383ea265e97ed8b875fa51af0ed
2020-01-03 16:46:15 -08:00
Dan Willemsen
260db53da3 Limit environment during ninja
See the change that added ALLOW_NINJA_ENV for more information.

Test: m nothing; check out/soong.log for small list
Test: ALLOW_NINJA_ENV=true m nothing; check out/soong.log
Change-Id: I7761c6a07a7f8b0acee107e9c27c7739dd4b63ab
2020-01-03 15:36:33 -08:00
Dan Willemsen
e333635983 Add option to limit environment variables given to ninja
Ninja does not track changes in environment variables, so we get
potentially incorrect builds when environment variables change during
incremental builds if some action was using one of them.

Add a variable to limit exposure of these variables to ninja, and thus,
all actions run by ninja. Kati and Soong can still read environment
variables, they explicitly track which ones they read so that we can
re-run them appropriately.

This list is just the beginning, there's no good way to detect which
environment variables are currently being used and to pass them through.
So this initial change won't have a behavioral change, and we'll flip
the switch and see what fails or who complains, flipping it off and on
and adding to the list until we can make this always happen.

Also adds a board-specific `BUILD_BROKEN_NINJA_USES_ENV_VARS := ...`
list so that we can temporarily allow board-specific variables until
they're fixed.

Test: check out/soong.log
Test: ALLOW_NINJA_ENV=false m nothing; check out/soong.log
Test: set BUILD_BROKEN_NINJA_USES_ENV_VARS := OLDPWD
      ALLOW_NINJA_ENV=false m nothing; check out/soong.log
Change-Id: I08e4834ce12100a577ef7d6a9a21b9e9d345cb93
2020-01-03 15:36:29 -08:00
Treehugger Robot
c481607536 Merge "Delete arch hooks" 2020-01-03 18:45:12 +00:00
Dario Freni
f4b13d4103 Merge "Add --include_build_info flag to apexer invocation." 2020-01-03 17:50:47 +00:00
Colin Cross
87f790c509 Delete arch hooks
They are not used anywhere.

Test: m checkbuild
Change-Id: Ice7d68b97ca894c0c4c9efc6dc55c0870a132b9c
2020-01-03 17:21:04 +00:00
Paul Duffin
36809d52ba Merge "java_sdk_library: Remove requirement for api_packages to be specified" 2020-01-03 13:32:54 +00:00
Paul Duffin
14544da609 Merge "java_sdk_library: support system_modules properly" 2020-01-03 13:32:42 +00:00
Nikita Ioffe
414f3a4c86 Merge "Whitelist system/apex/shim/build to use test_only_no_hashtree property" 2020-01-03 11:31:22 +00:00