Re: make -j2 disttest fails

2005-12-27 Thread Nicholas Clark
On Mon, Dec 26, 2005 at 12:25:54PM -0600, Steve Peters wrote:

 From my quick and dirty test, it appears that the cd's in a GNU make are in
 effect for the current command, but you are implicitly returned to your
 start directory after the completed command.  BSD doesn't return you back to
 your starting directory.  Looking at the OpenBSD make(1) manpage, I got a 
 hint to the fix.
 
  -j max_jobs
  Specify the maximum number of jobs that make may have running at
  any one time.  Turns compatibility mode off, unless the -B flag
  is also specified.
 
 So, after running make -j2 -B disttest everything compiled just fine.  Check
 the FreeBSD make manpage to see if there is a similar -B flag.  That 
 might be the fix you're looking for.

There is a -B flag.

However, I found that the following change stops the nested make thinking
that it should be running with -j, and everything passes:

Change 26499 by [EMAIL PROTECTED] on 2005/12/27 00:29:33

Removing MAKE_JOBS_FIFO from %ENV causes FreeBSD make to forget about
any -j flags. (And their implied disabling of backwards compatibility,
which is the real cause of the make disttest failure).

Affected files ...

... //depot/perl/lib/ExtUtils/t/basic.t#20 edit

Differences ...

 //depot/perl/lib/ExtUtils/t/basic.t#20 (text) 

@@ -25,7 +25,7 @@
 
 # 'make disttest' sets a bunch of environment variables which interfere
 # with our testing.
-delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
+delete @ENV{qw(PREFIX LIB MAKEFLAGS MAKE_JOBS_FIFO)};
 
 my $perl = which_perl();
 my $Is_VMS = $^O eq 'VMS';


I hope that this also helps other *BSD makes.

Nicholas Clark


Re: make -j2 disttest fails

2005-12-27 Thread Ken Williams


On Dec 26, 2005, at 12:25 PM, Steve Peters wrote:

This problems seems to be related solely to BSD-based makes and not 
GNU make.
On my OpenBSD system, make -j2 disttest fails with the default make, 
but

works fine with a GNU make.

From my quick and dirty test, it appears that the cd's in a GNU make 
are in

effect for the current command, but you are implicitly returned to your
start directory after the completed command.  BSD doesn't return you 
back to
your starting directory.  Looking at the OpenBSD make(1) manpage, I 
got a

hint to the fix.

 -j max_jobs
 Specify the maximum number of jobs that make may have 
running at
 any one time.  Turns compatibility mode off, unless the 
-B flag

 is also specified.

So, after running make -j2 -B disttest everything compiled just 
fine.  Check

the FreeBSD make manpage to see if there is a similar -B flag.  That
might be the fix you're looking for.


Or if we wanted to make a change in MakeMaker so that it could work 
with just make -j2 everywhere, maybe something like this would work:


disttest : distdir
cd $(DISTVNAME)  $(ABSPERLRUN) Makefile.PL  cd $(ORIGDIR)
cd $(DISTVNAME)  $(MAKE) $(PASTHRU) cd $(ORIGDIR)
cd $(DISTVNAME)  $(MAKE) test $(PASTHRU)cd $(ORIGDIR)

for some suitable value of $(ORIGDIR).

 -Ken



Re: make -j2 disttest fails

2005-12-26 Thread Steve Peters
On Mon, Dec 26, 2005 at 05:19:15PM +, Nicholas Clark wrote:
 A parallel make of the disttest target fails with MakeMaker.
 
 For my empty distribution created with h2xs -n Moo
 
 $ make -j2  disttest
 rm -rf Moo-0.01
 /home/nicholas/Sandpit/snap5.9.x-26488/bin/perl5.9.3 
 -MExtUtils::Manifest=manicopy,maniread  -e manicopy(maniread(),'Moo-0.01', 
 'best');
 mkdir Moo-0.01
 mkdir Moo-0.01/lib
 mkdir Moo-0.01/t
 mkdir Moo-0.01/fallback
 Generating META.yml
 cd Moo-0.01  /home/nicholas/Sandpit/snap5.9.x-26488/bin/perl5.9.3 
 Makefile.PL
 Checking if your kit is complete...
 Looks good
 Writing Makefile for Moo
 cd Moo-0.01  make LIBPERL_A=libperl.a LINKTYPE=dynamic OPTIMIZE=-Os 
 PREFIX=/home/nicholas/Sandpit/snap5.9.x-26488 PASTHRU_DEFINE= 
 PASTHRU_INC=
 cd: can't cd to Moo-0.01
 cd Moo-0.01  make test LIBPERL_A=libperl.a LINKTYPE=dynamic 
 OPTIMIZE=-Os PREFIX=/home/nicholas/Sandpit/snap5.9.x-26488 
 PASTHRU_DEFINE= PASTHRU_INC=
 cd: can't cd to Moo-0.01
 *** Error code 2
 1 error
 
 
 (make disttest passes if I don't use -j)
 
 The disttest target is:
 
 disttest : distdir
 cd $(DISTVNAME)  $(ABSPERLRUN) Makefile.PL 
 cd $(DISTVNAME)  $(MAKE) $(PASTHRU)
 cd $(DISTVNAME)  $(MAKE) test $(PASTHRU)
 
 If I change those last two by adding 'pwd ' at the start, I see:
 
 pwd  cd Moo-0.01  make LIBPERL_A=libperl.a LINKTYPE=dynamic 
 OPTIMIZE=-Os PREFIX=/home/nicholas/Sandpit/snap5.9.x-26488 
 PASTHRU_DEFINE= PASTHRU_INC=
 /home/nicholas/Perl/Moo/Moo-0.01
 cd: can't cd to Moo-0.01
 pwd  cd Moo-0.01  make test LIBPERL_A=libperl.a LINKTYPE=dynamic 
 OPTIMIZE=-Os PREFIX=/home/nicholas/Sandpit/snap5.9.x-26488 
 PASTHRU_DEFINE= PASTHRU_INC=
 /home/nicholas/Perl/Moo/Moo-0.01
 cd: can't cd to Moo-0.01
 
 
 Which explains why it's failing, but not why a parallel make does this, nor
 how to tweak things to stop it.
 

This problems seems to be related solely to BSD-based makes and not GNU make.
On my OpenBSD system, make -j2 disttest fails with the default make, but
works fine with a GNU make.  

From my quick and dirty test, it appears that the cd's in a GNU make are in
effect for the current command, but you are implicitly returned to your
start directory after the completed command.  BSD doesn't return you back to
your starting directory.  Looking at the OpenBSD make(1) manpage, I got a 
hint to the fix.

 -j max_jobs
 Specify the maximum number of jobs that make may have running at
 any one time.  Turns compatibility mode off, unless the -B flag
 is also specified.

So, after running make -j2 -B disttest everything compiled just fine.  Check
the FreeBSD make manpage to see if there is a similar -B flag.  That 
might be the fix you're looking for.

Steve Peters
[EMAIL PROTECTED]