[gdal-dev] Sort files in static library to make the build reproducible

Sebastiaan Couwenberg sebastic at xs4all.nl
Fri May 20 04:06:46 PDT 2016


[I'm sending this to the list because I'm unable to successfully create
a ticket with description in Trac at the moment. As reported in #6520
[0] adding a ticket description causes an internal server errors on
submit, it looks like the spam filter cannot handle the content.]


As part of the effort to support Reproducible Builds [1] Alexis
Bienvenüe submitted two patches in Debian Bug #824808 [2] to sort the
object files in the static library: sort-files-1 [3] & sort-files-2 [4]

These patches resolve the random_order_in_static_libraries issue [5],
which is illustrated by the diffoscope output [6].

The attached patch is modified version of the sort-files-2 patch doing
do wildcard sorting in the `$(LIBGDAL)` target instead of a separate
`$(LIBGDAL).buildit` target. Alexis chose that approach because:

> In some situations some of the target dependencies do not exist
> before the "make target" call. When this arises, as $(wildcard) is
> expanded before building the dependencies, it can miss some files…
> I was not sure of the situation here, so I added a transitional
> target to be safe.

I prefer the single line change in the attached patch, but you may want
to consider the separate target as done in the sort-files-2 patch too.

[0] https://trac.osgeo.org/gdal/ticket/6520
[1] https://wiki.debian.org/ReproducibleBuilds
[2] https://bugs.debian.org/824808
[3]
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824808;msg=5;att=1;filename=sort-files-1
[4]
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824808;msg=5;att=2;filename=sort-files-2
[5]
https://tests.reproducible-builds.org/issues/unstable/random_order_in_static_libraries_issue.html
[6]
https://tests.reproducible-builds.org/dbd/unstable/amd64/gdal_2.1.0+dfsg-2.diffoscope.html


Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sort-files-in-static-library.patch
Type: inode/symlink
Size: 653 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160520/860867aa/attachment.bin>


More information about the gdal-dev mailing list