From: Nicholas Clark Date: Sat, 12 Sep 2009 06:17:45 +0000 (+0100) Subject: Avoid a parallel make race condition where we load a half-copied module. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc72ff4919d7f1638a7ea29ecb264459926b1933;p=p5sagit%2Fp5-mst-13.2.git Avoid a parallel make race condition where we load a half-copied module. --- diff --git a/make_ext.pl b/make_ext.pl index b5966a9..f88c208 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -231,8 +231,11 @@ sub build_extension { $perl ||= "$up/miniperl"; my $return_dir = $up; my $lib_dir = "$up/lib"; + # $lib_dir must be last, as we're copying files into it, and in a parallel + # make there's a race condition if one process tries to open a module that + # another process has half-written. $ENV{PERL5LIB} - = join $Config{path_sep}, $lib_dir, map {"$up/$_"} @toolchain; + = join $Config{path_sep}, (map {"$up/$_"} @toolchain), $lib_dir; unless (chdir "$ext_dir") { warn "Cannot cd to $ext_dir: $!";