a449678996
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 |
||
---|---|---|
.. | ||
check_boot_jars | ||
hiddenapi | ||
Android.bp | ||
archive_repack.sh | ||
build-apex-bundle.py | ||
build-ndk-prebuilts.sh | ||
build-rustdocs.sh | ||
build_broken_logs.go | ||
check_do_not_merge.sh | ||
construct_context.py | ||
construct_context_test.py | ||
conv_linker_config.py | ||
conv_linker_config_test.py | ||
diff_build_graphs.sh | ||
freeze-sysprop-api-files.sh | ||
gen-java-current-api-files.sh | ||
gen-kotlin-build-file.py | ||
gen-sysprop-api-files.sh | ||
gen_java_usedby_apex.sh | ||
gen_ndk_backedby_apex.sh | ||
gen_ndk_usedby_apex.sh | ||
get_clang_version.py | ||
get_clang_version_test.py | ||
jar-args.sh | ||
jar-wrapper.sh | ||
jars-to-module-info-java.sh | ||
jsonmodify.py | ||
jsonmodify_test.py | ||
lint_project_xml.py | ||
lint_project_xml_test.py | ||
list_image.sh | ||
manifest.py | ||
manifest_check.py | ||
manifest_check_test.py | ||
manifest_fixer.py | ||
manifest_fixer_test.py | ||
microfactory.bash | ||
mkcratersp.py | ||
modify_permissions_allowlist.py | ||
modify_permissions_allowlist_test.py | ||
ninja_rsp.py | ||
package-check.sh | ||
reverse-deps.sh | ||
run-ckati.sh | ||
rustfmt.toml | ||
setup-android-build.sh | ||
setup_go_workspace_for_soong.sh | ||
strip.sh | ||
system-clang-format | ||
system-clang-format-2 | ||
test_config_fixer.py | ||
test_config_fixer_test.py | ||
toc.sh | ||
transitive-deps.sh | ||
unpack-prebuilt-apex.sh | ||
update_out |