From dd622951a431eb7eb1e01ffa6c8a878dbb0f75f8 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Thu, 25 Mar 2021 12:52:49 +0000 Subject: [PATCH] Fix AAPT path in dexpreopt. Dexpreopt uses AAPT to parse `targetSdkVersion` from the manifest, so it the generated dexpreopt.sh script that calls AAPT must depend on it, otherwise AAPT might not be built by the time it is used. Tool dependencies are handled via the global Soong config and the DEXPREOPT_GEN_DEPS variable that Soong generates for Make. This config always uses Soong tool paths, like out/soong/host/linux-x86/bin/aapt rather than out/host/linux-x86/bin/aapt. This CL fixes a mistake in dexpreopt rule that used context-dependent AAPT path (so, when called from Make, the dependency was on Soong tool, but a Make tool was actually used, so it failed sometimes). Bug: 132357300 Test: lunch aosp_cf_x86_64_phone-userdebug && m Change-Id: I1f0ab4afac98e6239f324e7f3571d670fd7a36cd --- dexpreopt/dexpreopt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 216e205ad..81a63b061 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -295,7 +295,7 @@ func dexpreoptCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, g Tool(globalSoong.ManifestCheck). Flag("--extract-target-sdk-version"). Input(manifestOrApk). - FlagWithInput("--aapt ", ctx.Config().HostToolPath(ctx, "aapt")). + FlagWithInput("--aapt ", globalSoong.Aapt). Text(`)"`) }