Skip to content
Permalink
Browse files

Make stored META data reproducible in CURI

Sort the hash keys to ensure we generate the same JSON dump from the
same source every time. Helps making rakudo and module builds
100 % reproducible.
  • Loading branch information...
niner committed Apr 26, 2019
1 parent a855b9c commit 50699817b5d0166ffc598c792414150674e963b1
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/CompUnit/Repository/Installation.pm6
@@ -141,7 +141,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
if $resources-dir.add($files{$file}).e
and not $.prefix.add($file).e; # bin/ is already included in the path
}
$dist-file.spurt: Rakudo::Internals::JSON.to-json(%meta);
$dist-file.spurt: Rakudo::Internals::JSON.to-json(%meta, :sorted-keys);
}
}
$.prefix.add('version').spurt('2');
@@ -247,7 +247,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
%meta<files> = %links; # add our new name-path => content-id mapping
%meta<provides> = %provides; # new meta data added to provides
%!dist-metas{$dist-id} = %meta;
$dist-dir.add($dist-id).spurt: Rakudo::Internals::JSON.to-json(%meta);
$dist-dir.add($dist-id).spurt: Rakudo::Internals::JSON.to-json(%meta, :sorted-keys);

# reset cached id so it's generated again on next access.
# identity changes with every installation of a dist.

0 comments on commit 5069981

Please sign in to comment.
You can’t perform that action at this time.