Disable dexpreopt on targets that do not include default ART config.
Dexpreopt build commands should only be generated on targets that include build/make/target/product/runtime_libart.mk, which sets the necessary variables such as PRODUCT_SYSTEM_DEFAULT_PROPERTIES that contain default values passed to dex2oat. This file also sets a variable PRODUCT_USES_DEFAULT_ART_CONFIG that is used in build/make/core/dex_preopt.mk to decide if boot images should be installed. On some targets build/make/target/product/runtime_libart.mk is not included. Prior to this patch, on such targets invalid dexpreopt commands were generated, but not used, so they did not cause any visible build failures. The invalid commands can be grepped as: lunch qemu_trusty_arm64-userdebug && m nothing \ && fgrep -e '-Xms ' $ANDROID_BUILD_TOP/out/soong/build.ninja In this case '-Xms ' is an ill-formed option passed to dex2oat (the option expects one argument, but none is passed). This patch makes the DisablePreopt variable passed from make to soong more strict: it not only requires WITH_DEXPREOPT, but also PRODUCT_USES_DEFAULT_ART_CONFIG. This means that dexpreopt commands will not be generated on targets that do not include build/make/target/product/runtime_libart.mk. Test: lunch aosp_walleye-userdebug && m \ && find $ANDROID_BUILD_TOP/out -name 'boot.art' # expect to find files in /out/target/product/walleye/system/framework/$ARCH/ Test: lunch qemu_trusty_arm64-userdebug && m \ && fgrep -e '-Xms ' $ANDROID_BUILD_TOP/out/soong/build.ninja # expect empty output Change-Id: I3d765ed0dd8b38236b8bdd5c6202bb1d3f45f904
Loading
Please register or sign in to comment