From 4032635a21b711ca37bbbcb80a50523761c18b96 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 6 Nov 2023 17:14:56 -0500 Subject: [PATCH] encapsulate: Sort components In some testing, this was defeating bitwise reproducibility. --- lib/src/container/encapsulate.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/container/encapsulate.rs b/lib/src/container/encapsulate.rs index 14f6ec9a..75758eb8 100644 --- a/lib/src/container/encapsulate.rs +++ b/lib/src/container/encapsulate.rs @@ -157,8 +157,9 @@ fn export_chunked( // Add the component/content layers let mut buf = [0; 8]; let sep = COMPONENT_SEPARATOR.encode_utf8(&mut buf); - for (layer, name, packages) in layers { + for (layer, name, mut packages) in layers { let mut annotation_component_layer = HashMap::new(); + packages.sort(); annotation_component_layer.insert(CONTENT_ANNOTATION.to_string(), packages.join(sep)); ociw.push_layer( manifest,