platform_build_soong/scripts
Jiakai Zhang a449678996 Move CLC construction to Ninja phase.
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
2023-05-30 15:46:38 +01:00
..
check_boot_jars Add jdk.internal.access to the allowed package list. 2023-05-03 07:21:27 +00:00
hiddenapi Allow obfuscated classes on bootclasspath 2023-01-18 12:59:23 +00:00
Android.bp Add script for modifying privapp permission allowlists 2023-05-02 15:10:16 -04:00
archive_repack.sh
build-apex-bundle.py Add a host tool to create an APEX bundle 2022-09-21 13:27:49 +09:00
build-ndk-prebuilts.sh build-ndk-prebuilts.sh: disable bazel. 2023-03-21 00:42:35 +00:00
build-rustdocs.sh rust: doc: Zip up docs when done 2021-08-20 13:08:16 -07:00
build_broken_logs.go Reformat build/soong for go 1.19 2022-08-17 10:43:13 -07:00
check_do_not_merge.sh Disallow using error-prone merge strategies 2021-02-19 13:05:54 +00:00
construct_context.py Move CLC construction to Ninja phase. 2023-05-30 15:46:38 +01:00
construct_context_test.py Move CLC construction to Ninja phase. 2023-05-30 15:46:38 +01:00
conv_linker_config.py Fix conv_linker_config with multiple input json files 2023-03-09 07:46:00 +00:00
conv_linker_config_test.py Add tests for conv_linker_config 2023-03-09 07:46:25 +00:00
diff_build_graphs.sh Fix location of host tools 2021-11-05 14:10:01 -07:00
freeze-sysprop-api-files.sh
gen-java-current-api-files.sh
gen-kotlin-build-file.py Move gen-kotlin-build-file.sh to python 2020-06-26 22:41:34 -07:00
gen-sysprop-api-files.sh
gen_java_usedby_apex.sh Java used-by API list generation 2021-12-14 14:52:58 -08:00
gen_ndk_backedby_apex.sh Save all the detected native shared library backing by mainline modules. 2021-10-19 14:33:57 -07:00
gen_ndk_usedby_apex.sh bazel apex: clean up gen_ndk_usedby_apex.sh to work in bazel sandbox. 2022-11-07 08:38:01 +00:00
get_clang_version.py [get_clang_version] Make the version regex permissive 2021-10-06 09:44:15 -07:00
get_clang_version_test.py [scripts] Add script to print clang prebuilts version 2021-06-25 11:57:16 -07:00
jar-args.sh
jar-wrapper.sh
jars-to-module-info-java.sh
jsonmodify.py Merge changes Ibcf908d9,I786ab152 2022-07-12 13:07:28 +00:00
jsonmodify_test.py Adding support to conditionally replace a value 2022-07-12 11:53:07 +01:00
lint_project_xml.py Fix minor issues in updatability lint CLs. 2021-04-22 13:40:41 -07:00
lint_project_xml_test.py Add lint_project_xml_test.py 2021-04-20 11:04:51 -07:00
list_image.sh Recursively list Android image contents. 2022-04-20 20:02:11 -07:00
manifest.py Convert soong scripts to python 3 2021-11-10 13:49:27 -08:00
manifest_check.py Revert "manifest_check.py: add uses-libraries propagaged via dex..." 2022-06-13 09:06:44 +00:00
manifest_check_test.py Apply pylint to scripts/manifest_check*.py 2021-09-08 03:59:40 +00:00
manifest_fixer.py Overriding placeholder version in updatable apks 2022-08-03 12:05:14 +01:00
manifest_fixer_test.py Overriding placeholder version in updatable apks 2022-08-03 12:05:14 +01:00
microfactory.bash Add prebuilts/ to microfactory includes 2022-10-19 11:11:45 -04:00
mkcratersp.py Split Rust crate builds into compile and link phases. 2023-04-12 15:51:41 -07:00
modify_permissions_allowlist.py Add script for modifying privapp permission allowlists 2023-05-02 15:10:16 -04:00
modify_permissions_allowlist_test.py Add script for modifying privapp permission allowlists 2023-05-02 15:10:16 -04:00
ninja_rsp.py Move gen-kotlin-build-file.sh to python 2020-06-26 22:41:34 -07:00
package-check.sh Fix script for package check to work on macOS 2021-10-04 15:29:06 +00:00
reverse-deps.sh Account for "validations:" 2021-11-23 12:12:06 -08:00
run-ckati.sh Run ckati step of the Android build tracing given variables 2023-01-04 10:08:43 -08:00
rustfmt.toml Update rustfmt.toml to 2021 edition 2022-02-10 16:55:01 +11:00
setup-android-build.sh
setup_go_workspace_for_soong.sh Upgrade to golang protobuf api v2 2021-07-23 11:12:05 -07:00
strip.sh Use create_minidebuginfo tool instead of bash script. 2021-05-01 00:06:07 +01:00
system-clang-format
system-clang-format-2
test_config_fixer.py Allow android tests to specify a mainline package name 2023-02-08 12:38:50 -08:00
test_config_fixer_test.py Allow android tests to specify a mainline package name 2023-02-08 12:38:50 -08:00
toc.sh Fix toc.sh, llvm-nm does not recognise '-f P' option 2021-04-03 03:21:24 +08:00
transitive-deps.sh Account for "validations:" 2021-11-23 12:12:06 -08:00
unpack-prebuilt-apex.sh Fix deapexer usage in prebuilt_apex/apex_set 2022-12-12 17:40:26 +00:00
update_out A script to update the file contents with the command output. 2021-11-18 15:15:45 -08:00