From 982e384a639c623d6bd43af4095ad24dd7062f33 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 29 Apr 2021 09:05:18 +0100 Subject: [PATCH] Fix profileCommand to remove the profile first. This fixes a discrepancy between clean and incremental builds exposed by https://android-review.googlesource.com/1671710 . Test: m Bug: 148067697 Change-Id: I0de078045075417a4123f7c3821c723f1e8e6b68 --- dexpreopt/dexpreopt.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 3848205d8..628197c93 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -134,7 +134,8 @@ func profileCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, glo profileInstalledPath := module.DexLocation + ".prof" if !module.ProfileIsTextListing { - rule.Command().FlagWithOutput("touch ", profilePath) + rule.Command().Text("rm -f").Output(profilePath) + rule.Command().Text("touch").Output(profilePath) } cmd := rule.Command(). @@ -174,7 +175,8 @@ func bootProfileCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, profileInstalledPath := module.DexLocation + ".bprof" if !module.ProfileIsTextListing { - rule.Command().FlagWithOutput("touch ", profilePath) + rule.Command().Text("rm -f").Output(profilePath) + rule.Command().Text("touch").Output(profilePath) } cmd := rule.Command().