Commit Graph

81 Commits

Author SHA1 Message Date
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
Lingfeng Yang 54191fae42 Revert "Consistently use either "boot" or "apex" boot image as the default."
This reverts commit 48b3b3c71f.

Reason for revert: breaks emulator

BUG: 146558375

Change-Id: I2af3d11ad9a014b0d73a73540bc814f245bc6418
2019-12-19 16:41:40 +00:00
Ulya Trafimovich 48b3b3c71f Consistently use either "boot" or "apex" boot image as the default.
Previous CL Ia9b34aa92ebb1b4de96ea0f8f290d798be19b2cf introduced
asymmetry in handling "boot" and "apex" boot images: in JIT-zygote
experiment, though the "apex" boot image was installed, the "boot"
boot image was still used for generating dexpreopt configs.

It is unclear why this asymmetry was needed at that point; it seems
incorrect to use different boot images for dexpreopting and for
installing on device. After recent changes the asymmetry started
breaking walleye_jitzygote-userdebug on git_rvc-release, because APK
dexpreopt commands refer to inexistent boot image files.

Test: lunch aosp_walleye-userdebug && m
Test: cherry-pick CL in internal, walleye_jitzygote-userdebug boots

Change-Id: Id877c10269cf79caf6ae74b1dc169a31e6a2211b
2019-12-18 16:09:39 +00:00
Ulyana Trafimovich 3fae7662ee Revert "Use boot image extension for framework libraries."
This reverts commit 4d2eeed0da.

Reason for revert: breaks avd/avd_boot_health_check test
  on cf_x86_phone-userdebug_coverage on branch rvc-release
  (the device fails to boot).

Test: m
Test: aosp_walleye-userdebug boots

Bug: 145749668

Exempt-From-Owner-Approval: revert

Change-Id: Ie1d93a200222e26461c1bcd384fdb69b7351e259
2019-12-11 18:29:19 +00:00
Colin Cross 31bf00dac3 Export art dexpreopt image zip file
Test: m  out/target/product/generic_arm64/boot.zip
Bug: 144491400
Change-Id: I84342703ac614e072b0cde8c6f5597dc8cffbc65
2019-12-04 16:50:52 -08:00
Ulya Trafimovich 4d2eeed0da 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 framweork 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).

Test: m
Test: phone boots:
    lunch aosp_walleye-userdebug && m \
        && adb reboot bootloader && fastboot flashall -w

Bug: b/119800099

Exempt-From-Owner-Approval: rebased after getting approval.

Change-Id: Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826
2019-12-03 13:59:25 +00:00
Roshan Pius ccc26ef316 soong: Align update boot jar variable with system_server jar
Use apex:jar pair values for updatable boot jars to align with
updatable system_server values.

Test: Compiles & flashed device. Ensured that the bootclasspath & system_server class
paths remain the same.

Change-Id: I1d6dfe3325d9091b7c724458be4e6471f9086666
2019-12-02 08:37:57 -08:00
Ulyana Trafimovich f2cb7e959b Revert^2 "Do not dexpreopt system server jars from updatable modules."
This reverts commit 01f6b0a656.

Reason for revert: Build failure is not reproducible.
Forrest build on the same build ID 6033773 and same target
cf_x86_phone-userdebug_coverage finished successfully.

Change-Id: I5077f8332aa0b8037e324b89d41f35b86b8cf216
2019-11-27 12:29:50 +00:00
Ulyana Trafimovich 01f6b0a656 Revert "Do not dexpreopt system server jars from updatable modules."
This reverts commit 61c325ebcc.

Reason for revert: broken build git_master/cf_x86_phone-userdebug_coverage (likely caused by these changes).

Exempt-From-Owner-Approval: revert.

Change-Id: I88ddd3af3a6c4ffdaa1fbb881d965356c5c75ad3
2019-11-26 13:06:38 +00:00
Ulya Trafimovich 61c325ebcc Do not dexpreopt system server jars from updatable modules.
Test: m

Test: The list of updatable system server jars is empty now,
  so I tested that the filer works with a manual experiment:
  - temporarily add ethernet-service to PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS
  - m nothing
  - fgrep -e 'ethernet-service' $ANDROID_BUILD_TOP/out/soong/build.ninja | grep dexpreopt
  - expect empty output (no dexpreopt command is generated)

Change-Id: I0b231e823d5a5a97632daa2b5eb7be3e06782004
2019-11-25 16:36:57 +00:00
Roshan Pius 9b51a4078a soong: Support system_server jars from apexes
Allow system_server jars delivered via apex. Regular system_server
jars are located in /system/framework folder. But, jars delivered via
apex are mounted at /apex/<module_name>/javalib.

Bug: 144722612
Bug: 141785760
Test: Compiles
Change-Id: Ia40bb91d2e05b2601a52eac28a985fe2d8da3481
2019-11-22 12:47:11 -08:00
Ulyana Trafimovich de534414b3 Revert^4 "Package dexpreopt artifacts for libcore jars in the ART apex."
This reverts commit bf0e47648a.

Reason for revert: coverage build with EMMA_INSTRUMENT_FRAMEWORK=true
is fixed by inspecting the environment variable and not generating
boot image in case it is set.

Dexpreopt artifacts for the libcore part of the boot class path are
now packaged in the ART apex. The system image still contains
dexpreopt artifacts for the full set of boot class path libraries
(both libcore and framework); the libcore part will be removed and
boot image extension will be used in a follow-up CL.

Since this is specific to the ART apex and makes no sense for other
apexes, the implementation adds a boolean flag "is ART apex" rather
than a new apex module property.

Build rules for the new set of dexpreopt artifacts are created using
a new variant of the global boot image config. Previously we had two
variants: "default" (for the system image) and "apex" (for the
JIT-zygote experiment). This patch adds a third "art" variant.

Test: m
Test: m art/build/apex/runtests.sh

Bug: 144091989
Change-Id: I113c0d39222d6d697cb62cd09d5010607872fc2b
2019-11-08 12:48:53 +00:00
Ulyana Trafimovich bf0e47648a Revert^3 "Package dexpreopt artifacts for libcore jars in the ART apex."
Reason for revert: breaks the coverage build.
Exempt-From-Owner-Approval: revert

Change-Id: I4c3db7b085b101738813a7f3da6f0078bbaa587b
2019-11-07 16:23:47 +00:00
Ulyana Trafimovich 66b3e99649 Revert^2 "Package dexpreopt artifacts for libcore jars in the ART apex."
This reverts commit 24babe3a66.

Build failures are fixed after reworking the patch:

  - 'missing dependencies' on aosp-master-art branch is fixed by
    disabling profile generation in case default profile is not
    found (it is part of framework absent in aosp-master-art)

  - invalid dex2oat invocation should no longer happen after
    disabling dexpreopt on targets that do not use default ART config
    (fixed in CL If2d4fe2cdcb6a81c7c6d730d18c2b681a74fb0b7)

Dexpreopt artifacts for the libcore part of the boot class path are
now packaged in the ART apex. The system image still contains
dexpreopt artifacts for the full set of boot class path libraries
(both libcore and framework); the libcore part will be removed and
boot image extension will be used in a follow-up CL.

Since this is specific to the ART apex and makes no sense for other
apexes, the implementation adds a boolean flag "is ART apex" rather
than a new apex module property.

Build rules for the new set of dexpreopt artifacts are created using
a new variant of the global boot image config. Previously we had two
variants: "default" (for the system image) and "apex" (for the
JIT-zygote experiment). This patch adds a third "art" variant.

Bug: 143594594
Bug: 143593500

Test: m
Test: m com.android.art deapexer \
    && find $ANDROID_BUILD_TOP -type f -name 'com.android.art.*.apex \
        | xargs deapexer | grep boot \
    Expect to find javalib/$ARCH/boot*.{art,oat,vdex} files.
Test: m art/build/apex/runtests.sh

Change-Id: Ib37acaec8401bd23c8d547dadf773565406ef448
2019-11-07 10:34:45 +00:00
Jiyong Park 0b2387551b stem property of java modules are propagated to Make
62c7829595c0df53e96addcd347c11ac01012eee introduced the new stem
property to java modules, but it wasn't propagated to Make. Fixing the
problem.

This change also fixes a problem that (module name) == (file name) is
assumed in dexpreopt_config.go, which no longer is the case. A mutator
runs to build a map from module name to its stem. The map is then used
when filling up the file paths in the bootImageConfig struct.

Bug: 139391334
Bug: 143494499
Test: m
Test: BootImageProfileTest
Change-Id: Idbc894f877692401471130de6cbfe5e0dd129da9
2019-10-31 22:13:05 +09:00
Nicolas Geoffray 24babe3a66 Revert "Package dexpreopt artifacts for libcore jars in the ART apex."
This reverts commit d5df949385.

Bug: 143594594
Bug: 143593500
Reason for revert: Some builds are failing.

Change-Id: I69986b472bce39266095e526fcd7ef5f48ece85e
Exempt-From-Owner-Approval: Going back to green.
2019-10-30 11:27:58 +00:00
Ulya Trafimovich d5df949385 Package dexpreopt artifacts for libcore jars in the ART apex.
This patch adds dexpreopt files for the libore part of the
bootclasspath to the ART apex.

Since this is specific to the ART apex and makes not sense for other
apexes, the patch does not add a new module property, but only a
boolean flag denoting that this is an ART apex.

Dexpreopt artifacts packaged into the ART apex differ from those that
are packaged in the system image: it inludes only the libcore part of
bootclasspath jars, but not the framework part. When the boot image
extension is implementd, dexpreopt artifacts for the libcore jars will
be removed from the system image (but for now they are both in the
apex and in the system image).

Build rules for the new set of dexpreopt artifacts are created using
a new variant of the global boot image config. Previously we had two
variants: "default" (for the system image) and "apex" (for the
JIT-zygote experiment). This patch adds the third "libcore" variant.

Test: m
Test: m com.android.art deapexer \
    && find $ANDROID_BUILD_TOP -type f -name 'com.android.art.*.apex \
        | xargs deapexer | grep boot \
    Expect to find dexpreopt/$ARCH/boot-art*.{art,oat,vdex} files.
Test: m art/build/apex/runtests.sh

Change-Id: I353ef90304bc5e18c3055ea379b3b223e5c38948
2019-10-28 14:03:08 +00:00
Ulya Trafimovich 18263381ed Deduplicate config generation for boot images.
Both default and apex configs are used for dexpreopting bootclasspath
jars. The difference between the two configs is in the naming (default
paths contain "boot", and apex paths contain "apex"). Another
difference is that apex config does not have a zip archive.

Test: m
Test: `find $ANDROID_BUILD_TOP/out -name '*.art' | sort`
    returns the same list of files before and after the patch

Change-Id: I5b2e8d83ab94fd0b1b3d4dc3f0db243ef70bfb08
2019-10-23 17:19:17 +01:00
Colin Cross 3b19f5d71d Remove old-style support for translated second architectures
Translated second architectures now go in NativeBridgeArch instead
of DeviceSecondaryArch.

This reapplies I568046330abc002d4eed582cb999b62a5eaba790 with
ctx.Config().HasMulitlibConflict() added to fix the NDK build,
which has arm64, arm, x86_64, and x86 architectures enabled.

Test: m checkbuild
Test: OUT_DIR=out_ndk build/soong/scripts/build-ndk-prebuilts.sh
Test: no change to build.ninja or Android-aosp_cf_x86_phone.mk
Change-Id: Iadcafbd64bfb9579ae7c86914927c43a062b0c8e
2019-09-19 12:54:32 -07:00
Martin Stjernholm cc4b0ad706 Update dexpreopt for the ART APEX name change.
Test: Build & boot
Bug: 135753770
Exempt-From-Owner-Approval: Approved internally
Change-Id: I3aac9112b022cce3ef8cfdf4bdbbed8bb0c8f4c7
Merged-In: I3aac9112b022cce3ef8cfdf4bdbbed8bb0c8f4c7
2019-08-30 17:47:30 +01:00
Mathieu Chartier 6adeee1131 Revert "Revert "Remove option to create boot image based on preloaded classes""
Test: make
Test: build/soong/scripts/build-ndk-prebuilts.sh

This reverts commit d3f688b521.

Change-Id: Ia8898d11d67e5f0c4d8886f13d29f5dbd5f8609b
2019-06-26 14:54:47 -07:00
Dan Willemsen 0f41678d00 Expand the dexpreopt image dependencies to entire image
Instead of just depending on the main .art file (boot.art, etc), also
expose the dependencies to the .oat/.vdex files (boot.oat/boot.vdex),
and all of the module files that get implicitly loading (boot-ext.*,
boot-framework.*, etc)

This is necessary for RBE, where the rule only gets the files that it
depends upon.

Test: treehugger
Test: build a system image with RBE
Change-Id: I0c7051f18582f1891d3398b46763b1521e4326c8
2019-06-18 06:40:38 +00:00
Colin Cross 2d00f0dcae Write dexpreopt.config again during the build
Writing $OUT/dexpreopt.config during build setup and then using
it during the build causes bad incremental builds if a cleanspec
removes $OUT/dexpreopt.config.  Create a rule in Soong to write
out a copy so that it is a normal build artifact.

Bug: 132379813
Test: m checkbuild
Change-Id: I7755a7f8c1d6561fc83022a7f4cf7e4a64e989c9
2019-05-10 07:07:21 -07:00
Colin Cross c11e0c5a39 Fix dangling rules on aosp_cf_x86_phone
aosp_cf_x86_phone uses SecondArchIsTranslated, which was leaving
a dangling rule from the oatdump rules to
out/soong/vsoc_x86/dex_bootjars/system/framework/arm/boot.art.
Consolidate the code to select targets for dexpreopting and use it
in more places to prevent references to boot images that were not
generated.

Test: m checkbuild
Change-Id: Ia4945a99ff5e575e759299106559c85f38489acc
2019-05-08 22:26:14 +00:00
Nicolas Geoffray feef2ef4d7 Pass other boot classpath locations to the apex image.
In order to evaluate the impact of framework classes being in an image.

Test: m
Bug: 119800099
Exempt-From-Owner-Approval: this is only for an experimental config, which we would like to see
the performance before build snap.
Change-Id: Ib0d3acf8d2718ee443b3bffe8122a54f92257691
2019-04-30 13:33:10 +00:00
Colin Cross df8eebecaa Zip boot image
Create a zip file containing the zipped boot image files.

Test: m out/soong/sailfish/dex_bootjars/boot.zip
Change-Id: I1b08c9aca962a5999585cbe9e665693ef4558524
2019-04-11 23:03:23 +00:00
Colin Cross 2cdd5df7cc Fix Rel() after ReplaceExtension or InSameDir
Copying p.rel doesn't work, as rel needs to match the end of the
value in path.  Apply the same transformation to p.rel as p.path.

Test: paths_test.go
Change-Id: I42d676c6c4fc18d9852c1a73f25e5a791d7553d0
2019-02-27 20:23:25 +00:00
Nicolas Geoffray 07b4007f1d Add a DEX2OAT_BOOTCLASSPATH variable.
Bug: 119800099
Test: m
Change-Id: If4b49b1bed33564b9237f8ae2ac35ef0d631703c
2019-02-26 12:55:37 +00:00
Nicolas Geoffray 72892f1035 Support for install multiple boot images.
Bug: 119800099
Test: m && /system/framework/arm/apex*.art files exist
Change-Id: I8b708a0c495193e5455e03eaa575ce55a482a95d
2019-02-22 15:37:48 +00:00
Colin Cross 9be4152c21 Pass DEXPREOPT_BOOT_JARS_MODULES to Make
Make is not setting PreoptBootJars, pass the value computed in
Soong back to Make.

Test: m checkbuild
Change-Id: Ie3db926df9c5d6bf18db1003b95823c7566800a9
2019-02-20 22:06:30 -08:00
Colin Cross 44df581457 Refactor dexpreopt_bootjars.go to prepare for multiple boot images
Refactor dexpreopt_bootjars.go so that buildBootImage can be called
with a bootImageConfig to create rules to build the boot image in
preparation for building multiple boot images.

Test: m checkbuild
Change-Id: I7ba40a0988c8acbd6c1ee4e36f4bbb34fb4e2d24
2019-02-20 22:06:29 -08:00