Skip to content

Commit

Permalink
Make stored META data reproducible in CURI
Browse files Browse the repository at this point in the history
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 5069981
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/CompUnit/Repository/Installation.pm6
Expand Up @@ -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');
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 5069981

Please sign in to comment.