[libmodule-build-perl] 02/05: Preprocess file lists generated by rscan_dir() to sort them

Niko Tyni ntyni at moszumanska.debian.org
Mon Sep 14 18:37:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

ntyni pushed a commit to branch master
in repository libmodule-build-perl.

commit 09ec1569f4782771da94812020a7e2c060e4915e
Author: Niko Tyni <ntyni at debian.org>
Date:   Tue Sep 1 22:05:27 2015 +0300

    Preprocess file lists generated by rscan_dir() to sort them
    
    The rscan_dir() function traverses a directory with File::Find,
    which returns files in readdir() order. This order is nondeterministic
    and depends on the file system.
    
    The lists are used, among other things, to find C files to compile
    (in process_support_files()) and later to link (in c_link()).
    The linking order affects the generated binary, essentially rendering
    it nondeterministic and breaking reproducibility.

Notes:
    Bug-Debian: https://bugs.debian.org/797709
    Bug: https://rt.cpan.org/Public/Bug/Display.html?id=106813
---
 lib/Module/Build/Base.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Module/Build/Base.pm b/lib/Module/Build/Base.pm
index a6189a8..1f4dfee 100644
--- a/lib/Module/Build/Base.pm
+++ b/lib/Module/Build/Base.pm
@@ -5254,7 +5254,7 @@ sub rscan_dir {
              ref($pattern) eq 'CODE' ? sub {push @result, $File::Find::name if $pattern->()} :
              die "Unknown pattern type";
 
-  File::Find::find({wanted => $subr, no_chdir => 1}, $dir);
+  File::Find::find({wanted => $subr, no_chdir => 1, preprocess => sub { sort @_ }}, $dir);
   return \@result;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-build-perl.git



More information about the Pkg-perl-cvs-commits mailing list