From 1bdf650bb18df19011fa4eb80d3741cf7979086e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 11 Apr 2019 14:07:04 -0700 Subject: [PATCH] Make makevars deterministic Sort map keys before iterating over them to produce makevars. Bug: 130411407 Test: m checkbuild Change-Id: I4153977705da05a5c73e641f93d02f408209c897 Merged-In: I4153977705da05a5c73e641f93d02f408209c897 (cherry picked from commit 91268c668ce952baee0d5ddb922b7b4c8ddd5b1d) --- java/dexpreopt_bootjars.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index a23b477ab..4d87b2f77 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -447,7 +447,14 @@ func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) { var imageNames []string for _, current := range append(d.otherImages, image) { imageNames = append(imageNames, current.name) + var arches []android.ArchType for arch, _ := range current.images { + arches = append(arches, arch) + } + + sort.Slice(arches, func(i, j int) bool { return arches[i].String() < arches[j].String() }) + + for _, arch := range arches { ctx.Strict("DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.vdexInstalls[arch].String()) ctx.Strict("DEXPREOPT_IMAGE_"+current.name+"_"+arch.String(), current.images[arch].String()) ctx.Strict("DEXPREOPT_IMAGE_BUILT_INSTALLED_"+current.name+"_"+arch.String(), current.installs[arch].String())