On Tue, Apr 05, 2005 at 11:44:34AM +0200, Rafael Garcia-Suarez wrote:
> Well, after a bit of tracking, I notice this new comment in
> MM_Any::clean() :
> 
>         # XXX normally this would be a good idea, but the Perl core sets
>         # INST_LIB = ../../lib rather than actually installing the files.
>         # So a "make clean" in an ext/ directory would blow away lib.
>         # Until the core is adjusted let's leave this out.
>     #     push @dirs, qw($(INST_ARCHLIB) $(INST_LIB)
>     #                    $(INST_BIN) $(INST_SCRIPT)
>     #                    $(INST_MAN1DIR) $(INST_MAN3DIR)
>     #                    $(INST_LIBDIR) $(INST_ARCHLIBDIR) $(INST_AUTODIR) 
>     #                    $(INST_STATIC) $(INST_DYNAMIC) $(INST_BOOT)
>     #                 );
> 
> (The second problem I reported is a side-effect of the first.)
> 
> So I'm guessing that clean() was refactored in something less forgiving,
> and that the special-casing for the core was accidentally removed. I'm a
> bit lost in the huge diff between the core's current makemaker and 6.27,
> so any hint is welcome...

Yes, clean just blindly blows away "./blib" but that's not very accurate
since all the INST_ things (which are normally all in blib) can be
redefined as Perl does.  I was going to use the actual values for
INST_ until I realized this would delete lib/ in the core and probably
cause similar problems in other large systems.

What it looks like I missed is $(INST_ARCHLIBDIR) and $(INST_AUTODIR)
(ie. where all the XS modules in ext/ go).  They used to be cleaned 
separately from blib, presumably as an exception for the core.

Attached patch should fix it.

=== lib/ExtUtils/MM_Any.pm
==================================================================
--- lib/ExtUtils/MM_Any.pm  (revision 4360)
+++ lib/ExtUtils/MM_Any.pm  (local)
@@ -771,6 +771,10 @@
     my @dirs  = qw($(DISTVNAME));
     my @files = qw($(FIRST_MAKEFILE) $(MAKEFILE_OLD));
 
+    # Special exception for the perl core where INST_* is not in blib.
+    # This cleans up the files built from the ext/ directory (all XS).
+    push @dirs, qw($(INST_AUTODIR) $(INST_ARCHAUTODIR)) if $self->{PERL_CORE};
+
     if( $self->has_link_code ){
         push @files, qw($(OBJECT));
     }

Reply via email to