Commit graph

1791 commits

Author SHA1 Message Date
Treehugger Robot
057dd35669 Merge "Abstract sdk_version string using sdkSpec type" 2020-01-28 00:07:37 +00:00
Martin Stjernholm
699cf17f53 Merge changes from topic "revert-1211982-dex2oat-soong-dep-LLLKNULXYJ"
* changes:
  Revert "Separate dexpreopt.GlobalSoongConfig to allow independen..."
  Revert "Move the Once cache for dexpreopt.GlobalConfig into the ..."
  Revert "Get the dex2oat host tool path from module dependency on..."
2020-01-27 13:47:31 +00:00
Hans Boehm
e4b5342d43 Revert "Separate dexpreopt.GlobalSoongConfig to allow independen..."
Revert submission 1211982-dex2oat-soong-dep

Reason for revert: Build failures. See b/148312086.

Reverted Changes:
Ibc427a9a8: Make dex2oat(d) visible for use as implicit dexpre...
I71df11c1e: Move the Once cache for dexpreopt.GlobalConfig int...
I38317f2d5: Get the dex2oat host tool path from module depende...
I440a09dba: Separate dexpreopt.GlobalSoongConfig to allow inde...

Bug: 148312086
Bug: 145934348
Exempt-From-Owner-Approval: Plain revert
Change-Id: Ice3990225635a737e49e9aed7373f06516fccea3
2020-01-27 13:44:24 +00:00
Hans Boehm
453bf09853 Revert "Move the Once cache for dexpreopt.GlobalConfig into the ..."
Revert submission 1211982-dex2oat-soong-dep

Reason for revert: Build failures. See b/148312086.

Reverted Changes:
Ibc427a9a8: Make dex2oat(d) visible for use as implicit dexpre...
I71df11c1e: Move the Once cache for dexpreopt.GlobalConfig int...
I38317f2d5: Get the dex2oat host tool path from module depende...
I440a09dba: Separate dexpreopt.GlobalSoongConfig to allow inde...

Bug: 148312086
Bug: 145934348
Exempt-From-Owner-Approval: Plain revert
Change-Id: I6b656afb5feaad70d958b9d38b6c6eab7b03fba1
2020-01-27 13:44:03 +00:00
Hans Boehm
7b2e6f3ed7 Revert "Get the dex2oat host tool path from module dependency on..."
Revert submission 1211982-dex2oat-soong-dep

Reason for revert: Build failures. See b/148312086.

Reverted Changes:
Ibc427a9a8: Make dex2oat(d) visible for use as implicit dexpre...
I71df11c1e: Move the Once cache for dexpreopt.GlobalConfig int...
I38317f2d5: Get the dex2oat host tool path from module depende...
I440a09dba: Separate dexpreopt.GlobalSoongConfig to allow inde...

Bug: 148312086
Bug: 145934348
Exempt-From-Owner-Approval: Plain revert
Change-Id: I0cf6fef04434fd3c0b7957ee9abdcaabeb20b9d8
2020-01-27 13:01:16 +00:00
Jiyong Park
6a927c4e6a Abstract sdk_version string using sdkSpec type
The value format that sdk_version (and min_sdk_version, etc.) can have
has consistently evolved and is quite complicated. Furthermore, with the
Mainline module effort, we are expected to have more sdk_versions like
'module-app-current', 'module-lib-current', etc.

The goal of this change is to abstract the various sdk versions, which
are currently represented in string and is parsed in various places,
into a type called sdkSpec, so that adding new sdk veresions becomes
easier than before.

The sdk_version string is now parsed in only one place 'SdkSpecFrom', in
which it is converted into the sdkSpec struct. The struct type provides
several methods that again converts sdkSpec into context-specific
information such as the effective version number, etc.

Bug: 146757305
Bug: 147879031
Test: m
Change-Id: I252f3706544f00ea71c61c23460f07561dd28ab0
2020-01-25 21:56:43 +09:00
Baligh Uddin
cf0bba7a30 Merge "Revert "Revert "Allow codename.fingerprint format for minSdkVersion""" 2020-01-25 04:12:30 +00:00
Treehugger Robot
6cc0515e82 Merge "Create a highmem pool and put metalava into it" 2020-01-25 01:09:43 +00:00
Baligh Uddin
f62013736a Revert "Revert "Allow codename.fingerprint format for minSdkVersion""
This reverts commit 230e241f58.

Reason for revert: This is a revert of a revert.  Downstream problem has been fixed and have been validated locally and via Forrest build.

Change-Id: I89c51d25b3adb818ea44a983d0ac681a88790d8c
2020-01-24 23:15:44 +00:00
Martin Stjernholm
335d596384 Get the dex2oat host tool path from module dependency on the binary
module.

This uses the Once cache for GlobalSoongConfig to propagate the dex2oat
path from a module dependency to the singletons (both the one that
writes out dexpreopt_soong.config and the one that creates the
dexpreopted boot images). Unless dexpreopting is disabled altogether
through DisablePreopt in dexpreopt.config, that means:

- We must ensure at least one module registers a dex2oat tool
  dependency and resolves a GlobalSoongConfig using it, or else the
  singletons fail. That means we litter dex2oat dependencies in java
  modules even when they won't get dexpreopted and hence don't really
  need them.

- We still assume there's at least one java_library or android_app in
  the build.

Bug: 145934348
Test: m
  (check that out/soong/dexpreopt_soong.config points to dex2oatd64)
Test: env USE_DEX2OAT_DEBUG=false m
  (check that out/soong/dexpreopt_soong.config points to dex2oat)
Test: env OUT_DIR=out-tools prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Change-Id: I38317f2d5e5cf6822f87daae25745767c8a3656c
2020-01-24 22:18:42 +00:00
Martin Stjernholm
dae8a80426 Move the Once cache for dexpreopt.GlobalConfig into the dexpreopt
package.

Preparation for a future CL that will need to get the make-written
GlobalConfig from within dexpreopt.

Also rename the Load*Config functions to Parse*Config, since they don't
actually load the config files anymore.

Bug: 145934348
Test: m
Change-Id: I71df11c1e042ca8135d273a7263e9539ea3cd68f
2020-01-24 22:18:42 +00:00
Martin Stjernholm
be9d0d21d1 Separate dexpreopt.GlobalSoongConfig to allow independent caching of
it.

Introduce a Once cache for GlobalSoongConfig to allow it to get binary
tool paths from ordinary module dependencies (coming in a future CL)
that are then reused in singletons.

Bug: 145934348
Test: m
Change-Id: I440a09dba7d337965a196527566b0966a18e3653
2020-01-24 22:09:54 +00:00
Colin Cross
8b8bec3b3a Create a highmem pool and put metalava into it
Create a highmem pool based on the total RAM and the number of CPUs,
with an override via the NINJA_HIGHMEM_NUM_JOBS variable.  Put
metalava into the highmem pool.

Ninja does not support nested pools, and when goma or RBE is enabled
the maximum ninja parallelism is set very high with local jobs in a
local pool.  When both the local pool and highmem pool are enabled,
the total number of local jobs will be as high as the sum of the sizes
of the two pools.  Keep the highmem pool limited to 1/16th of the
local pool when remote builds are enabled to try to minimize the
effect while still limiting highmem jobs.

Fixes: 142644983
Test: m nothing, examine pools
Test: m USE_GOMA=true nothing, examine pools
Change-Id: Id79f11f44948992960ac34ecf831dacbe21bd332
2020-01-24 11:44:23 -08:00
Jaewoong Jung
f0f747c949 Do not remove RRO resources
Resource configs should not be deduped when building RROs since it
would be impossible to override some resource configs with the same
value as the default config. Also, aapt2 removes resources that do not
have default configurations. If an overlay attempts to overlay a
non-default configuration without overlaying the default, the resource
will be removed and the value will not be overlaid at all.

Bug: 146227008
Fixes: 119811120
Test: app_test.go
Change-Id: I834a58b18d1e74a0f6b3de3d0523009788787e42
2020-01-24 10:35:52 -08:00
Treehugger Robot
84f71af41c Merge "Add runtime_resource_overlay." 2020-01-24 00:23:42 +00:00
Jaewoong Jung
9befb0c326 Add runtime_resource_overlay.
Fixes: 119811120
Test: app_test.go
Test: Converted and built IconPackFilledSystemUIOverlay
Change-Id: I71841148c25f820ba829f751a201d2c771c8bd20
2020-01-23 14:24:41 -08:00
Ulya Trafimovich
7eebb4f4e8 For JIT-zygote config, add "apex" boot image files to the ART apex.
JIT-zygote boot image was split into primary and framework extension
in CL I5493e575ebf90bad1d5ad2850004d54590bbc079, but that CL forgot to
add JIT-zygote boot image files to the ART apex. Add them now.

Test: Steps 1-3:

  1. Temporarily enable Jit zygote in the product device config (in
    this 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. Build and flash:
    $ lunch aosp_walleye-userdebug && m \
    && adb reboot bootloader && fastboot flashall -w

  3. Ensure that apex.art and apex-framework.art are mapped in the
    JIT-zygote address space:

    $ adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex.art
    6ffde000-70102000 rw-p 00000000 00:00 0                                  [anon:dalvik-/apex/com.android.art/javalib/apex.art]
    701e5000-70262000 rw-p 00000000 00:00 0                                  [anon:dalvik-/apex/com.android.art/javalib/apex.art]
    72715cf000-72715d4000 r--p 000ba000 07:98 93                             /apex/com.android.art/javalib/arm64/apex.art

    $ adb shell cat /proc/`adb shell ps | grep zygote64 | awk {'print $2'}`/maps | grep apex-framework.art
    7084b000-70cc2000 rw-p 00000000 00:00 0                                  [anon:dalvik-/system/framework/apex-framework.art]
    70fd8000-71109000 rw-p 00000000 00:00 0                                  [anon:dalvik-/system/framework/apex-framework.art]
    7271517000-7271526000 r--p 00295000 fc:00 1268                           /system/framework/arm64/apex-framework.art

Change-Id: I985e15de9f38f345ba3e99451c6d9b8e2cb5d698
2020-01-22 15:27:08 +00:00
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