From eac7fc1665ef07c4a8b009521034043ce6b422e7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 21 Jan 2023 11:57:13 +0000 Subject: [PATCH] kaios/manifest.pl: canonicalise the JSON output. The default behaviour of JSON::PP's encode_json output is to write the keys of a hash in Perl's natural hash order, which isn't consistent between runs of the same script due to hash function randomisation. This causes my build system to complain when successive builds from the same source revision don't produce the same output. Easily fixed: JSON::PP already has a switch to ensure consistent ordering, it's just a matter of finding it and turning it on. --- kaios/manifest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kaios/manifest.pl b/kaios/manifest.pl index 510f535..8380683 100755 --- a/kaios/manifest.pl +++ b/kaios/manifest.pl @@ -32,7 +32,7 @@ if ($version =~ /^20(\d\d)(\d\d)(\d\d)\./) { $decvers = join('.', $1+0, $2+0, $3+0); } -print encode_json({ +print JSON::PP->new->canonical->encode({ name => $displayname, subtitle => $description, description => $objective,