Subject: | Wrong order of dependencies generated in presence of MYEXTLIB in a subdirectory |
Date: | Tue, 23 Apr 2019 00:30:05 -0700 |
To: | bug-ExtUtils-MakeMaker [...] rt.cpan.org |
From: | Ilya Zakharevich <nospam-abuse [...] ilyaz.org> |
Hello,
I’m fighting with this issue (on and off) for decades now. Anyway,
the generated Makefile contains something like this (following the
docs in the POD):
all :: pure_all
$(NOECHO) $(NOOP)
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
subdirs ::
$(NOECHO) cd sdbm && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
$(MYEXTLIB):
cd sdbm && $(MAKE) $(PASTHRU)
As far as I understand, as a result,
cd sdbm && etc
is executed twice: once as one of the ::-rules for subdirs, once as a
dependence of $(MYEXTLIB). With parallel make's (as a lot of machines
on Perl-Testers network do) these child $(MAKE) may run concurrently,
leading to disasters.
⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜
Proposal: change the second `subdirs´ rule to
subdirs :: subdirs-makeall
subdirs-makeall ::
$(NOECHO) cd sdbm && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
Then one could just specify `subdirs-makeall´ as a dependency for
$(MYEXTLIB).
(The example of disaster is in
http://www.cpantesters.org/cpan/report/c935d292-632a-11e9-bf31-80c71e9d5857
although there it is due to TRIPLE dependence on a rule with `cd FOO && …´.)
Yours,
Ilya
P.S. I see no way to fix this in forward-compatible way; the
Makefile.PL⸣s must be version-dependent to use `depend on
subdirs-makeall´ trick.
P.P.S. With several subdirectories, one can have multiples:
subdir-makeall1 subdir-makeall2 subdir-makeall3 …
to speed up the parallel make…