develooper Front page | perl.perl5.porters | Postings from May 2008

Re: [patch@33919] Module build changes for VMS

Thread Previous | Thread Next
From:
John E. Malmberg
Date:
May 25, 2008 19:48
Subject:
Re: [patch@33919] Module build changes for VMS
Message ID:
483A2503.4000702@qsl.net
Craig A. Berry wrote:
> At 4:17 PM -0500 5/25/08, John E. Malmberg wrote:
>> Please review these patches for improving module build on VMS.
>> These  were being discussed before the 5.10 release, but not included.
> 
> Thanks, I'll have a look.  A few initial comments mixed in below.
> 
>> Also, I left the makefile name as generated by the tests. Sometimes
>> it was generated as 'Makefile' and sometimes as 'descrip.mms'.
>> 
>> I am thinking that if the makefile is being generated for
>> is_vms_mms(), then the name should be forced to 'descrip.mms' for
>> consistency, as I do not think gnu make can deal with MMS/MMK syntax.
>> 
>> With these patches, all but the ppm.t tests will pass on VMS.
>> 
>> The xs.t test passes, but the extra output is messing up the test
>> analysis, so for now, I have left it being skipped.
>> 
>> The ppm.t test still has the issue where it is creating a tarball
>> that it then can not detar, and I will try to look at that in a
 >> little bit.
>> 
>>
>> --- /rsync_root/perl/lib/Module/Build/base.pm	Thu Oct 25 04:50:40 2007
>> +++ lib/Module/Build/base.pm	Sun May 25 00:50:07 2008
>> @@ -2304,7 +2304,7 @@
>>  
>>   foreach my $file (keys %$files) {
>>     my $result = $self->copy_if_modified($file, $script_dir, 'flatten') or next;
>> -    $self->fix_shebang_line($result) unless $self->is_vmsish;
>> +    $self->fix_shebang_line($result) unless $self->is_vms_mms;
> 
> So if we're using GNU make rather than MMS or MMK we have a shebang
> line in Perl?  Not sure how that's possible.

Ok, this needs a bit of thought.  DCL ignores shebang lines, only perl 
and the GNV utilities will honor shebangs, so why are we fixing the 
shebang line.  So why skip fixing the shebang line if is_vmsish in the 
first place?

My thoughts at the time are that when we are running gnu make, it will 
be under the GNV system, so Unix rules will apply.

>> @@ -3179,10 +3184,18 @@
>> \bblibdirs$
>> ^MANIFEST\.SKIP$
>>
>> +# Avoid VMS specific MakeMaker generated files
>> +\bDescript.MMS$
>> +\bDESCRIPT.MMS$
>> +\bdescript.mms$
> 
> It's "descrip" not "descript".

Yep.  Easy fix.  I will try to deal with that tomorrow.  I remember last 
time that you mentioned some other files that also should be ignored.

>> # Avoid Devel::Cover generated files
>> \bcover_db
>> --- /rsync_root/perl/lib/Module/Build/Compat.pm	Thu Oct 25 04:50:40 2007
>> +++ lib/Module/Build/Compat.pm	Sat May 24 22:11:04 2008
>> @@ -171,7 +171,15 @@
>> 		       die "Malformed argument '$arg'");
>>
>>     # Do tilde-expansion if it looks like a tilde prefixed path
>> -    ( $val ) = glob( $val ) if $val =~ /^~/;
>> +    if ($val =~ /^~/) {
>> +      my $class = 'Module::Build';
>> +      if ($class->is_vmsish) {
>> +        # VMS does not glob a ~ yet
>> +        ( $val ) = $class->_detildefy($val)
>> +      } else {
>> +        ( $val ) = glob( $val );
>> +      }
>> +    }
> 
> It may be ok to use _detildefy everywhere -- we'd have to test it on
> something non-VMS.  Most likely the following will get you the class,
> which is currently just being thrown away:
> 
> --- Compat.pm;-0        Thu Oct 25 04:50:40 2007
> +++ Compat.pm   Sun May 25 18:23:27 2008
> @@ -162,7 +162,7 @@ sub subclass_dir {
>  }
> 
>  sub makefile_to_build_args {
> -  shift;
> +  my $self = shift;
>    my @out;
>    foreach my $arg (@_) {
>      next if $arg eq '';
> [end]
> 
> You could then use $self where you have $class (haven't tested that,
> but that's how nearly all these methods work).

I think that for some reason that this will not work because in the 
other places the class is passed as an additional argument, and not as 
the first argument.

>>     if (exists $makefile_to_build{$key}) {
>>       my $trans = $makefile_to_build{$key};
>> @@ -216,10 +224,24 @@
>>   my $class = $args{build_class};
>>
>>   my $perl = $class->find_perl_interpreter;
>> +
>> +  # VMS MMS/MMK usually needs to use MCR to run the Perl image
>> +  $perl = 'MCR ' . $perl if $class->is_vms_mms;
>> +
> 
> This doesn't seem necessary to me since it's going to be spawning a
> subprocess to run Perl; the subprocess-handling code already prepends
> MCR when needed.

It is needed because this is a line being inserted in the makefile or 
descrip.mms file, not a command being spawned by perl.

>> }
>> --- /rsync_root/perl/lib/Module/Build/t/compat.t	Thu Feb 21 08:04:41 2008
>> +++ lib/Module/Build/t/compat.t	Sun May 25 14:32:41 2008
>> @@ -21,6 +21,7 @@
>> }
>> ok 1, "Loaded";
>>
>> +my $vms_mms = ($^O eq 'VMS') && ($Config{make} =~ /MMS|K/i);
> 
> Um, anything with a K in it is considered MMK?  I don't think that's
> what you wanted.  See
> 
> http://perldoc.perl.org/perlrequick.html#Grouping-things-and-hierarchical-matching

Ok, I will lookup the proper regex tomorrow to group the S and K as 
alternatives.

>> --- /rsync_root/perl/lib/Module/Build/t/lib/MBTest.pm	Fri Oct 26 19:01:41 2007
>> +++ lib/Module/Build/t/lib/MBTest.pm	Sat May 24 18:07:44 2008
>> @@ -131,6 +131,10 @@
>>
>>
>> +
>> +sub is_vms_mms { return (is_vmsish && ($Config{make} =~ /MMS|K/i)) }
> 
> Note regex comment above.
yep.

-John
wb8tyw@qsl.net
Personal Opinion Only


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