Source: gtk-doc-tools
Version: 1.21-2
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: toolchain randomness
X-Debbugs-Cc: [email protected]
Hi,
While working on the "reproducible builds" effort [1], we have noticed
that gtk-doc-tools does not generate deterministic output.
Patch attached.
[1]: https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index de0d35d..276b163 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -1091,11 +1091,12 @@ sub OutputIndex {
@TRACE@("generate $basename index (".%apiindex." entries)\n");
- # do a case insensitive sort while chopping off the prefix
+ # do a case insensitive sort while chopping off the prefix. we sort case
+ # sensitively first to ensure a deterministic order within this.
foreach my $hash (
sort { $$a{criteria} cmp $$b{criteria} }
map { my $x = uc($_); $x =~ s/^$NAME_SPACE\_?(.*)/$1/i; { criteria =>
$x, original => $_, short => $1 } }
- keys %apiindex) {
+ sort keys %apiindex) {
$symbol = $$hash{original};
if (defined($$hash{short})) {