Subject: | Parallel build fails |
Running make in many jobs fails sometimes like this:
make -j16 'OPTIMIZE=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic'
"/usr/bin/perl" -Mblib -I/usr/share/perl5 genchars.pl
Cannot find blib even in /builddir/build/BUILD/TermReadKey-2.32/../../../../..
BEGIN failed--compilation aborted.
Makefile:383: recipe for target 'cchars.h' failed
make: *** [cchars.h] Error 2
make: *** Waiting for unfinished jobs....
This can been seen on the CPAN Testers matrix as "unknown" tasks.
I think the problem is in the Makefile.PL which adds a new target which needs the "build" directory to be already present but it does not declare the dependency:
sub MY::top_targets {
my $self = shift;
$_ = $self->MM::top_targets();
$_ .= "
sgtty cchars.h: genchars.pl
\$(PERL) -Mblib -I\$(PERL_LIB) genchars.pl
distcc: genchars.pl
\$(PERL) -Mblib -I\$(PERL_LIB) genchars.pl dist
[...]
}
See lines with the "-MBlib" argument.