aboutsummaryrefslogtreecommitdiff
path: root/dexpreopt
Commit message (Collapse)AuthorAgeFilesLines
* Determine GC type based on BUILT_KERNEL_VERSION_FILE.Jiakai Zhang2024-02-024-16/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How it works: 1. build/make/core/Makefile generates a txt file with the kernel version, which is taken from an explicit BOARD_KERNEL_VERSION value, or extracted from the kernel image on the source tree, or extracted from the kernel image extracted from the prebuilt boot.img. The file is saved at $ANDROID_PRODUCT_OUT/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt. 2. If PRODUCT_ENABLE_UFFD_GC is "default", meaning the GC type needs to be determined by the kernel version, build/make/core/Makefile copies kernel_version.txt to out/soong/dexpreopt/kernel_version_for_uffd_gc.txt. 3. build/soong/dexpreopt/config.go writes the the UFFD GC flag to out/soong/dexpreopt/uffd_gc_flag.txt. The flag is determined by an explicit PRODUCT_ENABLE_UFFD_GC value or by contruct_uffd_gc_flag.py, which reads kernel_version_for_uffd_gc.txt and determines the flag accordingly. 4. dex2oat takes the UFFD GC flag from uffd_gc_flag.txt. 5. post_process_props.py mangles ro.dalvik.vm.enable_uffd_gc based on the same logic. Bug: 321751629 Bug: 319554951 Bug: 318763448 Bug: 319648491 Test: m --no-skip-soong-tests nothing Test: atest uffd_gc_utils_test Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with no UFFD support - 1. Check the existence of `-Xgc:CMC` in out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.invocation (dex2oat invocation for a boot image) 2. Check the existence of `-Xgc:CMC` in out/soong/.intermediates/packages/apps/Settings/Settings/android_common/dexpreopt/Settings/oat/arm64/package.invocation (dex2oat invocation for an app defined in .bp) 3. Check the existence of `-Xgc:CMC` in $ANDROID_PRODUCT_OUT/obj/APPS/Dialer_intermediates/oat/arm64/package.invocation (dex2oat invocation for an app defined in .mk) 4. Check the value of ro.dalvik.vm.enable_uffd_gc in $ANDROID_PRODUCT_OUT/product/etc/build.prop Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with UFFD support, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=true m`, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=false m`, and do the steps above. Change-Id: I035ad32233e49e2a30ce11f6c7c318a648511ef8
* Revert "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars"Spandan Das2024-01-251-24/+13
| | | | | | | | This reverts commit 0b7089f13420061c8f1732fe6e2e56f1e9cdb21e. Reason for revert: Breaks auto builds https://groups.google.com/a/google.com/g/android-build-police/c/DfXeyxkyfYk/m/4SvZa-jkAAAJ Change-Id: Ia6ebdf64d03284d2318978c35cb87fd4f0b79531
* Ensure sscp jars get copied to $OUT/soong/system_server_dexjarsSpandan Das2024-01-241-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This was missed in aosp/2876756, which copied only the bcp jars) This hardcoded location is used by dex2oat to compile the dexpreopt artifacts. The copy rules are currently generated by java_(sdk)_library for source builds, and their prebuilt counterparts in prebuilt builds. After this change, the copy rule will be bifurcated between source and prebuilt builds 1. For source builds, it will come from java_(sdk)_library 2. For prebuilt builds, it will come from the top-level prebuilt apex. Since there can be multiple prebuilt apexes in trunk stable, HideFromMake will be used to determine which deapexed jar to copy. The bifurfaction is expected to be temporary. It is needed for now since the `apex_contributions` which will be used for source vs prebuilt selection have not been populated completely. Test: Added a unit test Test: Presubmits Test: git_master-art-host: art-gtest (https://android-build.corp.google.com/builds/abtd/run/L40800030001459791) Test: git_main:art_standalone_tests (https://android-build.corp.google.com/builds/abtd/run/L09000030001463855) Bug: 308790457 Change-Id: I3105d3b3a7e5c41cb601d07806f4ea483a61b50a
* "master" was renamed "main".Elliott Hughes2024-01-091-19/+19
| | | | | Test: N/A Change-Id: I86d5578eaac260e55a9583db7ab49812b4ba1f5d
* Remove PreoptExtractedApk.Jiakai Zhang2023-11-283-4/+1
| | | | | | | | | | | This was added by r.android.com/513843 to force dexpreopt some GMS core modules even if dexpreopt is disabled, to avoid some memory usage regression. We no longer need it because dexpreopt is never disabled on production builds. Bug: 313505540 Test: m Change-Id: I605b7569c17ee715cd4df167768e25aaf51bcd37
* Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage.Jiakai Zhang2023-11-092-46/+41
| | | | | | | | | OnlyPreoptBootImageAndSystemServer was for making the eng build faster. This change makes it even faster. Bug: 309011617 Test: Presubmit Change-Id: If9001e99593b57deafa7b56f0ca6b3d4d80f56d3
* Add a Make variable to determine ART boot image jars for testing.Jiakai Zhang2023-07-142-1/+10
| | | | | | Bug: 290583827 Test: m nothing Change-Id: I6eb0c83dd14682905ebaf3af55171856300eb2e3
* Merge "Fix FirstUniqueStrings after conversion to generics"Treehugger Robot2023-06-291-2/+0
|\
| * Fix FirstUniqueStrings after conversion to genericsColin Cross2023-06-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The conversion of FirstUniqueStrings to be implemented on top of the generic firstUnique accidentally used a different threshold to switch from the list implementation to the map implementation. Modify the threshold of firstUnique to match the old value from FirstUniqueStrings now that it doesn't have the reflection overhead. While we're at it, also make firstUnique make a copy of the list, and make FirstUniqueStrings a pure wrapper around firstUnique. Test: BenchmarkFirstUniqueStrings Change-Id: Icc2febea663142c508ff2e4be65a8a68121631d5
* | Use per-app package list to avoid unnecessary dexpreopt.Jiakai Zhang2023-06-283-21/+30
|/ | | | | | | | | | | | | | | | Starting from aosp/2594905, dexpreopt depends on `$PRODUCT_OUT/product_packages.txt`. When PRODUCT_PACKAGES changes, dexpreopt has to rerun for all apps. This is not ideal. After this change, dexpreopt uses a per-app product_packages.txt that is filtered by the app's dependencies, and it uses `rsync --checksum` to prevent the file's mtime from being changed if the contents don't change. This avoids unnecessary dexpreopt reruns. Bug: 288218403 Test: m Test: Change PRODUCT_PACKAGES and see no dexpreopt reruns. Change-Id: I5788a9ee987dfd0abfd7d91cbcef748452290004
* Use generics for DepSetsColin Cross2023-06-221-1/+1
| | | | | | | | Use Go's generics for DepSets so they don't require a type-specific wrapper and reflection. Test: depsets_test.go Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
* Merge "Move CLC construction to Ninja phase."Jiakai Zhang2023-05-305-147/+82
|\
| * Move CLC construction to Ninja phase.Jiakai Zhang2023-05-305-147/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, dexpreopt was often broken with optional libraries. This was because the CLC construction was done in Soong at an early stage, where we don't have sufficient information to determine whether an optional library is installed or not. For example, the "Settings" package uses an optional library called "androidx.window.extensions". On some devices, the library is installed, but on some other devices, it's not. Soong always adds the library to the CLC, meaning the CLC is wrong for devices which don't have the library. This change fixes the problem. See the tests below. After this change, the CLC construction is done by a Python script invoked at a very late stage. It uses product_packages.txt, which is generated by Make, to determine whether an optional library is installed or not, and filter out libraries that are not installed. Note that optional libraries are still added as dependencies by Soong. This is because dependencies have to be added at an early stage. This means what dex2oat eventually uses will be a subset of the dependencies, which is fine. Bug: 282877248 Test: m Test: atest construct_context_test Test: - 1. lunch aosp_cf_x86_64_phone-userdebug && m 2. Check the .invocation file of the "Settings" package (defined in .bp file) 3. See androidx.window.extensions Test: - 1. lunch aosp_redfin-userdebug && m 2. Check the .invocation file of the "Settings" package (defined in .bp file) 3. Don't see androidx.window.extensions Test: Check the .invocation file of the "Dialer" package (defined in .mk file) Test: - 1. Build a Pixel 5 system image and flash it to a Pixel 5 device. 2. adb shell pm art dump 3. See "reason=prebuilt" instead of "reason=vdex". (https://diff.googleplex.com/#key=fB6Ls9q2QGSN, before: left, after: right) Change-Id: Ia112bd7c2328373e68db6bffb74bf34030f683d8
* | Parallelize singleton executionLaMont Jones2023-05-191-1/+1
|/ | | | | | Bug: 281536768 Test: manual, presubmits Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
* Revert^2 "Generate app profiles even if dexpreopt is disabled."Jiakai Zhang2023-05-082-0/+15
| | | | | | | | | | | | | Revert submission 2580631-revert-2574032-XXTWCJDTDQ Reason for revert: Fixed build breakages Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ Bug: 280440941 Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist Test: Disable dex2oat on host (to simulate macOS) and build Change-Id: I6090b4b74cedb6d129fcbeef58d075c8ccdcc4e2
* Revert^2 "Generate boot image profiles even if dexpreopt is disabled."Jiakai Zhang2023-05-082-0/+16
| | | | | | | | | | | | | Revert submission 2580631-revert-2574032-XXTWCJDTDQ Reason for revert: Fixed build breakages Reverted changes: /q/submissionid:2580631-revert-2574032-XXTWCJDTDQ Bug: 280440941 Test: lunch aosp_cf_riscv64_minidroid-userdebug && m UNSAFE_DISABLE_HIDDENAPI_FLAGS=true dist Test: Disable dex2oat on host (to simulate macOS) and build Change-Id: I5f7f746ca1d4da660fe0c40115e6c71750dfdccc
* Revert "Generate boot image profiles even if dexpreopt is disabled."Qiao Yang2023-05-051-7/+0
| | | | | | | | | | | Revert submission 2574032 Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279> Reverted changes: /q/submissionid:2574032 Change-Id: I8e99f8231639198b149ea8d822ee7f9a5b391a89 BUG: <280902279>
* Revert "Generate app profiles even if dexpreopt is disabled."Qiao Yang2023-05-052-15/+0
| | | | | | | | | | | Revert submission 2574032 Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279> Reverted changes: /q/submissionid:2574032 Change-Id: Ia9d05f3b7439604eb4a4b4100f46879fe11f5820 BUG: <280902279>
* Generate app profiles even if dexpreopt is disabled.Jiakai Zhang2023-05-042-0/+15
| | | | | | | | | | | | | Bug: 280440941 Test: - 1. Patch ag/22302622 to disable dexpreopt. 2. lunch aosp_cf_x86_64_phone-userdebug && m 3. See app profiles still generated. Test: - 1. Patch ag/20592051 to enable profile for service-art. 2. banchan com.android.art x86_64 && m 3. See the profile for service-art generated. Change-Id: I4e721b475b84a2f667bbccc030a8947078f26bb0
* Generate boot image profiles even if dexpreopt is disabled.Jiakai Zhang2023-05-031-0/+7
| | | | | | | | Bug: 280440941 Test: - 1. Patch ag/22302622 to disable dexpreopt. 2. See boot image profiles still generated. Change-Id: I1bf05ade53fa83f3dba46f28a8f9246ba1fdf664
* Remove OWNERS access for non-build team people to core build systemJoe Onorato2023-02-281-1/+0
| | | | | Test: treehugger Change-Id: I0c318ddd7d78110327bbd849ed9aa3973c86de5d
* Install system server jar profiles into the APEX.Jiakai Zhang2023-02-081-0/+4
| | | | | | | | | | | | | | | After this change, if profile-guided compilation is enabled for an APEX system server jar, the profile will be installed next to the jar with the ".prof" suffix, ("javalib/<name>.jar.prof"). This file will later be used by odrefresh and dexpreopt from prebuilt APEX. Bug: 241823638 Test: m nothing Test: - 1. Patch ag/20581649 PS2. 2. banchan com.android.btservices x86_64 && m 3. Check that "javalib/service-bluetooth.jar.prof" exists in the APEX. Change-Id: Ibcfc6257dade92bd40a6d4b7368148717d0863b9
* Pass "-Xgc:CMC" to dex2oat when userfaultfd GC is enabled.Jiakai Zhang2022-11-162-0/+6
| | | | | | | | | | | | | This change is a no-op change. It doesn't enable userfaultfd GC by default. ENABLE_UFFD_GC=true can be passed to the build system to enable userfaultfd GC for testing purposes. Bug: 242553398 Test: - 1. lunch aosp_oriole-userdebug 2. ENABLE_UFFD_GC=true m 3. See "--runtime-arg -Xgc:CMC" in .invocation files. Change-Id: I789b49a71b9604fd41bf1ef77d0ac5bac4cbdf25
* support system server jars install in system_extliulvping2022-09-162-0/+37
| | | | | | | | | | | | | | | | | | | | | | Bug: 245383870 Bug: 155630745 Test:m nothing Test:- 1.Add a jar installed in the system_ext partition toSYSTEMSERVERJARS (e.g.b/245383870 PRODUCT_SYSTEM_SERVER_JARS_EXTRA += system_ext:oem-services) 2.Build a ROM 3.See the odex and vdex files generated in $ANDROID_PRODUCT_OUT/system_ext/framework/oat/ 4.Flash the ROM to a device 5.Check the maps information of the system_server , the newly added odex has the r-xp flags 6.Run `adb shell am restart;adb root;adb shell setprop dalvik.vm.extra-opts -verbose:deopt,heap,jit,oat,image,dex,verifier;` 7.Check ClassLoaderContext classpath size matching information 8.Run `atest art_standalone_odrefresh_tests` `atest art_standalone_dexpreopt_tests` `atest CtsSdkExtensionsTestCases` Change-Id: Ib1083ee130b5fef9c23d56523868fa1e29be879a Signed-off-by: liulvping <liulvping@xiaomi.com>
* Reformat build/soong for go 1.19Colin Cross2022-08-171-17/+15
| | | | | Test: none Change-Id: I132368f0fcbdb5ea088b5b84dbe4ccfdd9e94cad
* Use aapt2Saeid Farivar Asanjan2022-08-081-2/+2
| | | | | | | | Replace usage of `aapt` with `aapt2`. Bug: 236602069 Test: m nothing Change-Id: I0c3b224351aff82fa251fbe83447fd262ab520b1
* Merge "Dexpreopt: use "speed-profile" if a system server jar has a profile."Jiakai Zhang2022-07-071-1/+5
|\
| * Dexpreopt: use "speed-profile" if a system server jar has a profile.Ulya Trafimovich2022-07-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation is to reduce file size and in-process memory footprint for "services" (which is currently the only system server jar that has a profile). For other system server jars that have no profile keep using "speed", as enabling "speed-profile" for them would completely disable AOT-compiled code. Compare .odex file size: - before: 44360 services.odex - after: 24968 services.odex Bug: b/237399630 Test: lunch aosp_sargo-userdebug && m Change-Id: I844b9607c496d3d6e7048dc6bb8cd958ecbaa441
* | Deterministically report path errors to all callers of dexpreopt.GetGlobalConfigColin Cross2022-05-171-7/+37
|/ | | | | | | | | | | | | dexpreopt.GetGlobalConfig uses a OncePer to only parse the config once. If the config contains missing paths, which can happen in partial manifest branches, the missing path errors will only be reported on the first caller to GetGlobalConfig. Fix the nondeterminism by wrapping the PathContext and capturing any path errors and reporting them to all callers to GetGlobalConfig. Bug: 207813628 Test: tradefed branch builds Change-Id: I869c3ae49a819b1251b94b73e0487aa594cd5e22
* Revert "Don't add `uses_libs`/`optional_uses_libs` to the manifest_fixer."Ulya Trafimovich2022-05-042-77/+44
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0b1c70efbcbb0c8408f44964923f5b156d025936. The reverted commit was based on the idea that uses-libraries that are explicitly specified in build files should not be implicitly added to the manifest, as that would mean that anything added to the build files will flow to the manifest. Although this logic is correct, it prevents propagation of uses-libraries from dependencies, which is wrong: if a library has an explicit uses-library property in Android.bp, this property is expected to be propagated to the library's dependencies. Failing to do so would mean that every user of that library has to add uses-library property to their build files, which doesn't scale (see b/214255490 for example). Bug: 214255490 Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \ && adb wait-for-device && adb root \ && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch' # empty output, no errors at boot Change-Id: I6f420e76a89aa2f37be99f877711736640f2c361
* Correctly serialize class loader context for "any" SDK version to JSON.Ulya Trafimovich2022-04-282-0/+35
| | | | | | | | | | | | | Previously "any" was serialized as its numeric value, 10000. But other code in makefiles and scripts expects string "any", and dexpreopt.config files generated by Make (for Android.mk modules) have "any" not 10000. Bug: 214255490 Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \ && adb wait-for-device && adb root \ && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch' # empty output, no errors at boot Change-Id: Id5e80eb8a90d9786b5cb999c172aaecb44952f76
* Remove obsolete dexpreopt config option `UseArtImage`.Ulya Trafimovich2022-04-271-2/+0
| | | | | | Bug: 170935728 Test: lunch aosp_cf_x86_64_phone-userdebug && m && lunch_cvd Change-Id: Id83b9085794fd2ec338077ca909f84e04ccad041
* Add markdown docs for dexpreopt.Ulya Trafimovich2022-03-031-0/+258
| | | | | Bug: 219442893 Change-Id: I61b6fbd6d1b9d62f87b98a8eb8cea7fd7ccfa77c
* Add support for excluding libraries from class loader contextsPaul Duffin2022-02-072-0/+194
| | | | | | | | | | | | | | | | A number of tests in the cts/tests/signature/api-check check for the accessibility of classes from the android.test.base, android.test.runner and android.test.mock libraries. Some tests expect to find the classes other do not. Unfortunately, the tests use libraries, specifically compatibility-device-util-axt, that depend on the android.test... libraries which causes Soong to implicitly add <uses-library> entries to the manifest so that they will be accessible at runtime. That causes the tests that do not expect to find the classes to fail. Bug: 209607558 Test: m nothing Change-Id: I54c194ab23d5a70df790ece3fe98f2b3d6a1c1f6
* Annotate more java dependencies for licensingColin Cross2022-01-281-0/+1
| | | | | | | | Annotate more dependencies as runtime linked or toolchain. Bug: 207445310 Test: m checkbuild Change-Id: Ia5dc3321a1e476b16058eee94d6dc494fe1e933e
* Merge changes I8f4eaed1,I358a62d3Jiakai Zhang2021-12-203-22/+124
|\ | | | | | | | | | | * changes: Dexpreopt standalone system server jars from prebuilts. Dexpreopt standalone system server jars.
| * Dexpreopt standalone system server jars.Jiakai Zhang2021-12-203-22/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standalone system server jars are dynamically loaded by system server using a `PathClassLoader` whose parent is `SYSTEMSERVERCLASSPATH`. They are listed in `PRODUCT_STANDALONE_SYSTEM_SERVER_JARS` and `PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS` in Makefile. We need to dexpreopt them to achieve better performance. Bug: 203198541 Test: m nothing Test: - 1. Add a standalone system server jar (e.g., by patching aosp/1906158) 2. Build a system image. 3. See the odex and vdex files generated in $ANDROID_PRODUCT_OUT/system/framework/oat/ 4. Flash the image to a device. 5. Run `atest art_standalone_dexpreopt_tests`. Change-Id: I358a62d34989c5c8eba12e18fe6167e0b72ff69d
* | Test that `DisableGenerateProfile` takes effects for APEXes.Jiakai Zhang2021-12-141-0/+7
|/ | | | | | Bug: 209630530 Test: m nothing Change-Id: I5953f36e219ba63f8a01fa5dc60456db35eef5ac
* Add ART boot image profile to the ART APEX.Jiakai Zhang2021-12-031-11/+18
| | | | | | | | | | | | | | | | | We will need the profile when we generate the primary boot image on device. Bug: 203492478 Test: Run `banchan com.android.art x86_64 && m` and see `$ANDROID_PRODUCT_OUT/apex/com.android.art/etc/boot-image.prof`. Test: Run `lunch aosp_cf_x86_64_phone-userdebug && m` and see both `$ANDROID_PRODUCT_OUT/apex/com.android.art/etc/boot-image.prof` and `$ANDROID_PRODUCT_OUT/system/etc/boot-image.prof`, in different sizes. Test: Start Cuttlefish with the built image and see both `/apex/com.android.art/etc/boot-image.prof` and `/system/etc/boot-image.prof` on device. Change-Id: Id879dc49b234133dfbb9563814328661a1f4a6c0
* Add entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pbJiakai Zhang2021-11-302-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL updates platform_systemserverclasspath, systemserverclasspath_fragment, and prebuilt_systemserverclasspath_fragment to write entries for STANDALONE_SYSTEMSERVER_JARS to systemserverclasspath.pb. A new property `standalone_contents` is aded to `systemserverclasspath_fragment` and `prebuilt_systemserverclasspath_fragment` to list the standalone system server jars in the APEX, and entries will be written to systemserverclasspath.pb accordingly at build time. To add more context, these entries will be consumed by derive_classpath in order to generate an environment variable PRODUCT_STANDALONE_SYSTEM_SERVER_JARS. The environment variable will then be comsumed by odrefresh to determine what jars to preopt on early boot. Note that the variable should not end with "CLASSPATH" because the list is not used by runtime as a classpath. It is just a colon-separated list of jars. System server loads the jars separately with paths hardcoded in the code. Bug: 203198541 Test: manual - 1. Add some jars to PRODUCT_STANDALONE_SYSTEM_SERVER_JARS 2. Add some other jars to PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS and standalone_contents. 3. Build an image. 4. Flash the image to a device. 5. adb shell echo \$STANDALONE_SYSTEMSERVER_JARS 6. See the correct list of jars. Change-Id: I09a6fd1d3db85c194330da9b751702a9bf069e26
* Fix OutDir vs SoongOutDir in testsColin Cross2021-11-091-15/+15
| | | | | | | | Tests were using the same value for OutDir and SoongOutDir, separate them to allow a test that needs to distinguish between them. Test: all soong tests Change-Id: Ibd78758c133a7f07bead3f51b699052676f92fbd
* Add a build-time check for dexpreopting system server jars.Jiakai Zhang2021-10-291-16/+12
| | | | | | | | | | | | | | | | | | | | This change adds a Soong module that stores the paths to the compilation artifacts of system server jars in a variable, which will then be consumed by Make to check if the artifacts are installed. When the check fails, it means that dexpreopting is not working for some system server jars and needs to be fixed. Bug: 201371822 Test: m nothing Test: manual - 1. Add "service-permission" to DEXPREOPT_DISABLED_MODULES (https://cs.android.com/android/platform/superproject/+/master:build/make/core/product_config.mk?q=DEXPREOPT_DISABLED_MODULES) 2. m nothing 3. See the error: Missing compilation artifacts. Dexpreopting is not working for some system server jars Offending entries: system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.odex system/framework/oat/x86_64/apex@com.android.permission@javalib@service-permission.jar@classes.vdex Change-Id: I4816f19668f1dae180a34adafdbfa448c97aa0db
* Defer dexpreopt failure with missing implementation jarPaul Duffin2021-10-071-1/+8
| | | | | | | | | | | | | | Previously, if an implementation jar (Host) was not available to the build it would panic when trying to generate the JSON representation of the CLC. That prevents builds with missing implementation jars from working even if those jars are never actually built. This change defers the build failure until it is actually built. Test: TARGET_PRODUCT=armv8 TARGET_BUILD_VARIANT=eng ./art/test/testrunner/run_build_test_target.py -j80 art-no-prebuild - run above in master-art before and after this change. Bug: 202366925 Change-Id: I60a78a8bf6c13b83a9dceb5c43019a9e21f0b637
* Move copy rule for system server jars from dexpreopt_gen to makefiles.Ulya Trafimovich2021-09-211-4/+12
| | | | | | | | | | | | | | | | | | | This is necessary in order to expose the copy rule to Ninja. Otherwise Ninja has a build rule that depends on the copied jar (namely, dexpreopt commands for all subsequent system server jars that have the current one in class loader context), but no rule that creates it, so Ninja fails with a "no rule to make ..." error. The change only affects system server ed in Android.mk Previously the problem existed, but was hidden by the fact that the only system server jar defined in Android.mk was the last one on the list, so no other jar depended on it. Now that updatable apex jars are also dexpreopted (https://r.android.com/1828115) the problem was uncovered. Bug: 200297762 Test: lunch bertha_x86_64-userdebug && m Change-Id: Idbf2eacdf7ae89847aa9d755ef688eda3720ce89
* Revert^2 "Preopt APEX system server jars."Jiakai Zhang2021-09-162-25/+78
| | | | | | | | | | | | | | | This reverts commit 92346c483249726164f4bd140413d60391121763. Reason for revert: Fixed build error. The build error is fixed by ag/15841934. This CL remains unchanged. This CL will be submitted AFTER ag/15841934 is submitted. Bug: 200024131 Test: 1. Patch this CL and ag/15841934 into internal master. 2. sudo vendor/google/build/build_test.bash Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
* Revert "Preopt APEX system server jars."Adrian Roos2021-09-152-78/+25
| | | | | | | | | This reverts commit ca9bc98e0cfe9a519cfdd13450a68f1ed7ad5b02. Reason for revert: breaks build Bug: 200024131 Change-Id: Ide07b4c4d267370ae31107b1598b2f878c701282
* Preopt APEX system server jars.Jiakai Zhang2021-09-152-25/+78
| | | | | | | | | | | | | | | The path to the artifacts will in the form of /system/framework/oat/<arch>/<encoded-jar-path>@classes.{odex,vdex,art}, where <encoded-jar-path> is the path to the jar file with "/" replaced by "@". For example, /system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex There will be a follow-up CL to update ART runtime to recognize artifacts in that path. Test: m com.android.art Bug: 194150908 Change-Id: Ic89fd63c4b1cd565684cead83fc91dae3bc97a4c
* Make OutDir() and SoongOutDir() be consistent.Lukacs T. Berki2021-09-021-1/+3
| | | | | | | | | They both used to return out/soong. Unfortunately, the tests seem to assume the old behavior, so I had to keep tests inconsistent and I was scared of dexpreopt, too. Test: Presubmits. Change-Id: Ib00c7956fd2cdb28cc11d481c17e5a3ff5ad563a
* Rename BuildDir and NinjaBuildDir.Lukacs T. Berki2021-08-271-1/+1
| | | | | | | | | | These are just out/ and out/soong/ and the old names were quite confusing. Test: Presubmits. Merged-In: I999ca62162062f27e449f83ffb00fa580d4065b8 Merged-In: I2fcd80a9e376a6842a06aa104a9f6f5c5e16f8c7 Change-Id: Ib481d2aac40df8da1b74174dc8ec576c1cb48be0
* Merge "eng builds: dexpreopt: stop explicitly removing minidebuginfo"Treehugger Robot2021-08-241-5/+0
|\