Re: [PATCH] Sort file list for debuginfo extraction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 18, 2011 at 2:19 PM, Robert Schiele <robert.schiele@xxxxxxxxx> wrote:
This is needed to get reproducable builds.  The order of the list
produced by find can depend on physical attributes of the underlying
file system and thus be different accross builds.  This is causing a
problem as soon as several hard links of the same binary reside in
one directory.  Based on the order of those hard links in the list
find-debuginfo will choose a different one for extraction of the
debug information.  While the debug information would still always
be the same (after all those are hard links) the reference to the
debug information file in the executable would change with the order
of the listi and thus produce different build results.

By just sorting the list of files to be processed we make the order
(and thus the build result) reproducable again.  The sorting
criteria for this operation does not matter.
---
 scripts/find-debuginfo.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index e050dc1..d5bb0da 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -177,6 +177,7 @@ $strict || strict_error=WARNING
 find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
                    \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
                    -print |
+sort |
Perhaps it is more portable or reproducible between different locale use
"LANG=C sort " in the pipe and use this everywhere find is used in find-debuginfo.sh, just in case.

IMSHO, the fact that  the build can be truly reproducible in general is a myth, but i digress.

Regards
 file -N -f - | sed -n -e 's/^\(.*\):[  ]*.*ELF.*, not stripped/\1/p' |
 xargs --no-run-if-empty stat -c '%h %D_%i %n' |
 while read nlinks inum f; do
--
1.7.0.4
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux