summaryrefslogtreecommitdiff
path: root/sdk/update.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2022-07-18 13:18:23 +0000
committer Paul Duffin <paulduffin@google.com> 2022-07-18 15:35:50 +0000
commit74f1dcd1abf7c3eb49585fa7a989482ecbc405bb (patch)
tree2a232c9e52824e92f5c3310be6797ab842c36c3b /sdk/update.go
parente3048505c079fb6c665981b0cbabe07515553457 (diff)
Sort files in sdk snapshot zip to ensure consistent behavior
The order of the files in the sdk snapshot was stable but depended on how the sdk was built. If the snapshot was created directly then the files have one order, if it was created by merging in files from other zips then it has a different order. This change ensures files are in alphabetical order no matter how the snapshot zip is constructed. Bug: 232401814 Test: m media-module-sdk # Check the contents of the following zips to ensure that they are sorted # after this change. # out/soong/.intermediates/packages/modules/Media/apex/media-module-sdk/common_os/media-module-sdk-current.unmerged.zip # out/soong/mainline-sdks/media-module-sdk-current.zip Change-Id: Ie97e0119c07a1f34a2b1d3ea6895f0e76cd195a8
Diffstat (limited to 'sdk/update.go')
-rw-r--r--sdk/update.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/sdk/update.go b/sdk/update.go
index 995da741c..c555ddc7a 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -108,7 +108,7 @@ var (
mergeZips = pctx.AndroidStaticRule("SnapshotMergeZips",
blueprint.RuleParams{
- Command: `${config.MergeZipsCmd} $out $in`,
+ Command: `${config.MergeZipsCmd} -s $out $in`,
CommandDeps: []string{
"${config.MergeZipsCmd}",
},
@@ -481,7 +481,7 @@ be unnecessary as every module in the sdk already has its own licenses property.
// Copy the build number file into the snapshot.
builder.CopyToSnapshot(ctx.Config().BuildNumberFile(ctx), BUILD_NUMBER_FILE)
- filesToZip := builder.filesToZip
+ filesToZip := android.SortedUniquePaths(builder.filesToZip)
// zip them all
zipPath := fmt.Sprintf("%s%s.zip", ctx.ModuleName(), snapshotFileSuffix)
@@ -517,7 +517,7 @@ be unnecessary as every module in the sdk already has its own licenses property.
Description: outputDesc,
Rule: mergeZips,
Input: zipFile,
- Inputs: builder.zipsToMerge,
+ Inputs: android.SortedUniquePaths(builder.zipsToMerge),
Output: outputZipFile,
})
}