develooper Front page | perl.perl5.porters | Postings from March 2014

Re: smoke-me/nicholas/fake-pm_to_blib on VMS

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 1, 2014 19:22
Subject:
Re: smoke-me/nicholas/fake-pm_to_blib on VMS
Message ID:
20140301192235.GC22619@plum.flirble.org
On Sat, Mar 01, 2014 at 04:10:06PM +0000, Nicholas Clark wrote:
> On Sat, Mar 01, 2014 at 09:56:39AM -0600, Craig A. Berry wrote:
> 
> > Trimming .DIR makes that one go away too, which also doesn't make
> > sense.  But all is not well as running mmk test reruns all of the
> > Makefile.PLs.  It likely has something to do with the fact that the
> > VMS make utilities do not leave anything behind in the filesystem for
> > a target with no extension, and for that very reason MakeMaker uses
> > 'pm_to_blib.ts' rather than 'pm_to_blib' on VMS (or rather defines the
> > latter in terms of the former).  So make_ext.pl probably needs to be
> > looking for pm_to_blib.ts on VMS.
> 
> I don't think that it's that. I'm testing a patch which I think will fix it
> (at least on the HP machines). Right now I've got 72 extensions on the fast
> path, but I think I need one more tweak to get the last 8.

Now pushed as a revised branch smoke-me/nicholas/fake-pm_to_blib

The appended commit fixes all the VMS problems for me on the HP machine.
With it, 81 extensions take the fast path, which is the 80 on *nix plus
ext/VMS-Filespec

Nicholas Clark

commit 829fc4a3617ca1cc2ba338517617607d36a4b2a1
Author: Nicholas Clark <nick@ccl4.org>
Date:   Sat Mar 1 11:39:27 2014 +0100

    On VMS, lib is lib.DIR, etc. make_ext.pl needs to account for this.
    
    Likewise regular files without periods in the names get one appended.
    
    Also, the file generated is pm_to_blib.ts, not pm_to_blib.

diff --git a/make_ext.pl b/make_ext.pl
index b078b27..b433762 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -598,8 +598,12 @@ sub just_pm_to_blib {
     my ($last) = $mname =~ /([^:]+)$/;
     my ($first) = $mname =~ /^([^:]+)/;
 
+    my $pm_to_blib = $is_VMS ? 'pm_to_blib.ts' : 'pm_to_blib';
+
     foreach my $leaf (<*>) {
         if (-d $leaf) {
+            $leaf =~ s/\.DIR\z//i
+                if $is_VMS;
             next if $leaf =~ /\A(?:\.|\.\.|t|demo)\z/;
             if ($leaf eq 'lib') {
                 ++$has_lib;
@@ -612,6 +616,8 @@ sub just_pm_to_blib {
         }
         return $leaf
             unless -f _;
+        $leaf =~ s/\.\z//
+            if $is_VMS;
         # Makefile.PL is "safe" to ignore because we will only be called for
         # directories that hold a Makefile.PL if they are in the exception list.
         next
@@ -621,7 +627,7 @@ sub just_pm_to_blib {
                             |Makefile\.PL
                             |MANIFEST
                             |META\.yml
-                            |pm_to_blib
+                            |\Q$pm_to_blib\E
                             |README
                             |README\.patching
                             |README\.release
@@ -685,11 +691,11 @@ sub just_pm_to_blib {
     if ($target eq 'all') {
         require ExtUtils::Install;
         ExtUtils::Install::pm_to_blib(\%pm, '../../lib/auto');
-        open my $fh, '>', 'pm_to_blib'
-            or die $!;
+        open my $fh, '>', $pm_to_blib
+            or die "Can't open '$pm_to_blib': $!";
         print $fh "$0 has handled pm_to_blib directly\n";
         close $fh
-            or die $!;
+            or die "Can't close '$pm_to_blib': $!";
 	if ($is_Unix) {
             # Fake the fallback cleanup
             my $fallback
@@ -702,7 +708,7 @@ sub just_pm_to_blib {
         # A clean target.
         # For now, make the targets behave the same way as ExtUtils::MakeMaker
         # does
-        _unlink('pm_to_blib');
+        _unlink($pm_to_blib);
         unless ($target eq 'clean') {
             # but cheat a bit, by relying on the top level Makefile clean target
             # to take out our directory lib/auto/...

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About