List Info

Thread: M::B::base.pm install.t fixes for VMS




M::B::base.pm install.t fixes for VMS
user name
2007-09-14 00:27:25
Hello Ken,

Here is another step in getting Module::Build going on VMS.

In lib/Module/Build/Base.pm:

The code to merge the destination dir with the default
directories 
needed fixing, as it was stripping off any filenames that
may be 
present, such as .packlist.


In lib/Module/Build/t/install.t,

Change strip_volume to return a list of directories which
catdir() and 
catfile() can handle portably better, because the VMS
directory 
delimiters have been removed.

If you do not remove the directory delimiters, The VMS
variants of the 
catdir() routines will add an implied volume name as an
additional 
directory.

Change catdir() to catfile for .packlist.

The build file is "Build.COM" on VMS, not
"Build".

Traditional VMS returns filenames and pathnames in lower
case, so the 
key $expect to $pods->{$expect} needs to be converted to
lowercase.

TODO:
However this will need to be fixed for VMS ODS-5 support as
that will 
return the filename in the exact case it was created in. 
Currently 
there is no API to let a module know that VMS is in this
mode.

As a hack, $ENV{DECC$EFS_CASE_PRESERVE} having a string
beginning with 
one of "EeTt1" indicates that VMS is in this mode.
 It will not be 
accurate once an API is available for controlling this
mode.

-John
wb8tywqsl.net
Personal Opinion Only

  
Re: M::B::base.pm install.t fixes for VMS
user name
2007-09-15 19:38:06
At 12:27 AM -0500 9/14/07, John E. Malmberg wrote:
>Hello Ken,
>
>Here is another step in getting Module::Build going on
VMS.

This is generally a step in the right direction in
principle, but
causes the following failure on OS X:

lib/Module/Build/t/install..................................
..#   Failed test at ../lib/Module/Build/t/install.t line
68.
#          got: 'Can't open file
/Users/craig/perl/t/install_test/usr/local/lib/perl5/site_pe
rl/5.10.0/darwin-2level/auto/Simple/.packlist/: No such file
or directory at
/Users/craig/perl/t/../lib/ExtUtils/Install.pm line 691
# '
#     expected: ''
FAILED at test 2


So it needs a bit more work (though it addresses something
that's
definitely not correct as-is).

>Traditional VMS returns filenames and pathnames in lower
case, so the key $expect to $pods->{$expect} needs to be
converted to lowercase.
>
>TODO:
>However this will need to be fixed for VMS ODS-5 support
as that will return the filename in the exact case it was
created in.  Currently there is no API to let a module know
that VMS is in this mode.

IMO all tests of the type "Is this filename the one I'm
expecting?"
should be case blind on all platforms.  The default filename
lookup
behavior is case blind on the default filesystem on every
non-UNIX
platform Perl supports, as well as on OS X with HFS+, so
unless you
are doing something intentionally non-portable, I see no
reason for
these tests to be case sensitive.  There are of course lots
of ways
to do it, but using C<like> instead of C<is>
makes sense to me:

% perl -e 'use Test::More qw(no_plan); like (q{Foo.Dat},
qr{^(?i:foo.dat)$}, q{File matches});'
ok 1 - File matches
1..1


-- 
________________________________________
Craig A. Berry
mailto:craigberrymac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Re: M::B::base.pm install.t fixes for VMS
user name
2007-09-15 20:31:39
Craig A. Berry wrote:
> At 12:27 AM -0500 9/14/07, John E. Malmberg wrote:
> 
>>Hello Ken,
>>
>>Here is another step in getting Module::Build going
on VMS.
> 
> 
> This is generally a step in the right direction in
principle, but
> causes the following failure on OS X:
> 
>
lib/Module/Build/t/install..................................
..#   Failed test at ../lib/Module/Build/t/install.t line
68.
> #          got: 'Can't open file
/Users/craig/perl/t/install_test/usr/local/lib/perl5/site_pe
rl/5.10.0/darwin-2level/auto/Simple/.packlist/: No such file
or directory at
/Users/craig/perl/t/../lib/ExtUtils/Install.pm line 691
> # '
> #     expected: ''
> FAILED at test 2

       # Need to remove volume from $map{$_} using
splitpath, or else
       # we'll create something crazy like
C:FooBarE:BazQuux
       # VMS will always have the file separate than the
path.
       my ($volume, $path, $file) =
File::Spec->splitpath( $map{$_}, 1 );

On UNIX systems, the above is treating the file the same as
a path, so 
the $file component is blank on those systems.

       # catdir needs a list of directories, or it will
create something
       # crazy like volume:[Foo.Bar.volume.Baz.Quux]
       my dirs = File::Spec->splitdir($path);

       # First merge the directories
       $path = File::Spec->catdir($destdir, dirs);

       # Then put the file back on if there is one.
       $map{$_} = File::Spec->catfile($path, $file);

The above probably needs to only be done if ($file ne '') as
a second 
part.  This second part is probably all that is needed to
make it work, 
but the above line.

Apparently catfile works fine on VMS for an empty file
specification, 
but on UNIX, it appends a trailing slash.

> So it needs a bit more work (though it addresses
something that's
> definitely not correct as-is).
> 
> 
>> Traditional VMS returns filenames and pathnames in
lower case, so
>> the  key $expect to $pods->{$expect} needs to be
converted to lowercase.
>>
>>TODO:
>> However this will need to be fixed for VMS ODS-5
support as that
>> will  return the filename in the exact case it was
created in. Currently
 >> there is no API to let a module know that VMS is
in this mode.
> 
> 
> IMO all tests of the type "Is this filename the
one I'm expecting?"
> should be case blind on all platforms.  The default
filename lookup
> behavior is case blind on the default filesystem on
every non-UNIX
> platform Perl supports, as well as on OS X with HFS+,
so unless you
> are doing something intentionally non-portable, I see
no reason for
> these tests to be case sensitive.  There are of course
lots of ways
> to do it, but using C<like> instead of
C<is> makes sense to me:
> 
> % perl -e 'use Test::More qw(no_plan); like
(q{Foo.Dat}, qr{^(?i:foo.dat)$}, q{File matches});'
> ok 1 - File matches
> 1..1

Yes, that would be better.

-John
wb8tywqsl.net
Personal Opinion Only



Re: M::B::base.pm install.t fixes for VMS
user name
2007-09-16 14:57:39
John E. Malmberg wrote:
> Craig A. Berry wrote:
> 
>> At 12:27 AM -0500 9/14/07, John E. Malmberg wrote:
>>
>>> Hello Ken,
>>>
>>> Here is another step in getting Module::Build
going on VMS.
>>
>> This is generally a step in the right direction in
principle, but
>> causes the following failure on OS X:
>>
>>
lib/Module/Build/t/install..................................
..#   
>> Failed test at ../lib/Module/Build/t/install.t line
68.
>> #          got: 'Can't open file 
>>
/Users/craig/perl/t/install_test/usr/local/lib/perl5/site_pe
rl/5.10.0/darwin-2level/auto/Simple/.packlist/: 
>> No such file or directory at 
>> /Users/craig/perl/t/../lib/ExtUtils/Install.pm line
691
>> # '
>> #     expected: ''
>> FAILED at test 2

That should be addressed by the attached patch.

>>> Traditional VMS returns filenames and pathnames
in lower case, so
>>> the  key $expect to $pods->{$expect} needs
to be converted to lowercase.
>>>
>>> TODO:
>>> However this will need to be fixed for VMS
ODS-5 support as that
>>> will  return the filename in the exact case it
was created in. Currently
> 
>  >> there is no API to let a module know that VMS
is in this mode.
> 
>> IMO all tests of the type "Is this filename
the one I'm expecting?"
>> should be case blind on all platforms.  The default
filename lookup
>> behavior is case blind on the default filesystem on
every non-UNIX
>> platform Perl supports, as well as on OS X with
HFS+, so unless you
>> are doing something intentionally non-portable, I
see no reason for
>> these tests to be case sensitive.  There are of
course lots of ways
>> to do it, but using C<like> instead of
C<is> makes sense to me:
>>
>> % perl -e 'use Test::More qw(no_plan); like
(q{Foo.Dat}, 
>> qr{^(?i:foo.dat)$}, q{File matches});'
>> ok 1 - File matches
>> 1..1

Unfortunately in the case of install.t, the pathname is used
as a key to 
a hash, and that key is in the case that the OS returned the
filename 
in, and in traditional VMS, that is lower case.

I updated the comment in the install.t patch to make this
more clear.

Additional changes:

In VMS.pm,

Fix man3page_name so that the "__" prefix is
actually removed.

In manifypods.t,

When comparing paths, the directory delimiters can get in
the way.

In metadata.t,

Again, file case comparison issues.  I do not know how to
make is_deeply 
do a case insensitive compare.  So another one to be revised
when ODS-5 
support is fully implemented.

This leaves me with the following tests not working:

ppm.t, tilde.t, xs.t

-John
wb8tywqsl.net
Personal Opinion Only






  
Re: Revised Module::Build fixes for VMS.
user name
2007-09-28 21:23:34
On Sep 28, 2007, at 8:55 AM, John E. Malmberg wrote:

> Additional changes:
>
> In Base.pm, created a subroutine to return the regex
either as case  
> insensitive or case sensitive based on the setting for 

> File::Spec::case_tolerant.
>
> Note in the existing code, one place assumes that the 

> File::Spec::case_tolerant routine exists, and another
tests to see  
> if it exists.
>
> Converted were needed the qr to file_qr('xxxx')

[...]

> I missed runthrough.t in my last assessment.
>
> This patch also fixes runthrough.t to pass all tests on
VMS.
>
> Modifying the expected dist_dir to meet what VMS
expects it to be  
> in, handling both ODS-2 and ODS-5 cases.
>
> Skipping the rewritten shebang test, since the shebang
is not  
> rewritten on VMS.


Thanks, John.

I assume that in process_support_files() you meant
file_qr('.c(pp)? 
$') and not qr('.c(pp)?$').

The M::B::Platform::VMS hunk didn't apply cleanly against
the svn  
repo, something about a manpage separator.  There seems to
be no such  
code to what's getting patched, do you know what's going on
there?

Also, the t/install.t patch caused some new failures so I
haven't  
applied that yet.

  -Ken


Re: Revised Module::Build fixes for VMS.
user name
2007-09-28 21:31:34
On Sep 28, 2007, at 9:23 PM, Ken Williams wrote:

>
> Also, the t/install.t patch caused some new failures so
I haven't  
> applied that yet.
>

Actually the failures were just because I didn't notice the
whole  
patch didn't apply cleanly.  Once I went in and hand-applied
the  
remaining hunks, things passed.  Applying now.

  -Ken


Re: Revised Module::Build fixes for VMS.
user name
2007-09-28 23:42:13
At 9:31 PM -0500 9/28/07, Ken Williams wrote:
>On Sep 28, 2007, at 9:23 PM, Ken Williams wrote:
>
>>
>>Also, the t/install.t patch caused some new failures
so I haven't applied that yet.
>>
>
>Actually the failures were just because I didn't notice
the whole patch didn't apply cleanly.  Once I went in and
hand-applied the remaining hunks, things passed.  Applying
now.

It applied cleanly against blead, where I've checked it in
as 31995.
I wonder if we've had some drift between blead and the
independent
version.
-- 
________________________________________
Craig A. Berry
mailto:craigberrymac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Re: Revised Module::Build fixes for VMS.
user name
2007-09-29 10:44:34
On Sep 28, 2007, at 11:42 PM, Craig A. Berry wrote:

> It applied cleanly against blead, where I've checked it
in as 31995.
> I wonder if we've had some drift between blead and the
independent
> version.

Indeed we have, here are the VMS-related outstanding
differences.   
Could someone verify that the blead version is correct, and
let me  
know who to assign credit to in the Changes file?

  -Ken

diff -ur
/Users/ken/Downloads/perl/bleadperl/lib/Module/Build/Base.pm
 
lib/Module/Build/Base.pm
---
/Users/ken/Downloads/perl/bleadperl/lib/Module/Build/Base.pm
	 
2007-09-28 23:43:35.000000000 -0500
+++ lib/Module/Build/Base.pm	2007-09-28 20:57:28.000000000
-0500
 -447,7
+446,10 
    my $exe = $c->get('exe_ext');
    foreach my $thisperl ( potential_perls ) {

-    if (defined $exe and $proto->os_type ne 'VMS') {
+    if ($proto->is_vmsish) {
+      # VMS might have a file version at the end
+      $thisperl .= $exe unless $thisperl =~
m/$exe(;d+)?$/i;
+    } elsif (defined $exe) {
        $thisperl .= $exe unless $thisperl =~ m/$exe$/i;
      }

diff -ur
/Users/ken/Downloads/perl/bleadperl/lib/Module/Build/ 
Platform/VMS.pm lib/Module/Build/Platform/VMS.pm
---
/Users/ken/Downloads/perl/bleadperl/lib/Module/Build/Platfor
m/ 
VMS.pm	2007-09-28 23:43:35.000000000 -0500
+++ lib/Module/Build/Platform/VMS.pm	2007-09-28
20:51:56.000000000 -0500
 -195,9
+195,8 

    # Need to create with the same name as DynaLoader will
load with.
    if (defined &DynaLoader::mod2fname) {
-    my $file = $$spec . '.' .
$self->->get 
('dlext');
-    $file =~ tr/:/_/;
-    $file = DynaLoader::mod2fname([$file]);
+    my $file = DynaLoader::mod2fname([$$spec]);
+    $file .= '.' . $self->->get('dlext');
      $$spec =
File::Spec->catfile($$spec, $file);
    }

 -220,36
+219,6 
    return $result;
  }

-=item dist_dir
-
-Inherit the standard version but replace embedded dots with
 
underscores because
-a dot is the directory delimiter on VMS.
-
-=cut
-
-sub dist_dir {
-  my $self = shift;
-
-  my $dist_dir = $self->SUPER::dist_dir;
-  $dist_dir =~ s/./_/g;
-  return $dist_dir;
-}
-
-=item man3page_name
-
-Inherit the standard version but chop the extra manpage
delimiter  
off the front if
-there is one.  The VMS version of splitdir('[.foo]')
returns '', 'foo'.
-
-=cut
-
-sub man3page_name {
-  my $self = shift;
-
-  my $mpname = $self->SUPER::man3page_name( shift );
-  my $sep = $self->manpage_separator;
-  $mpname =~ s/^$sep//;
-  return $mpname;
-}

  =item expand_test_dir

 -275,9
+244,7 

  =head1 AUTHOR

-Michael G Schwern <schwernpobox.com>
-Ken Williams <kwilliamscpan.org>
-Craig A. Berry <craigberrymac.com>
+Michael G Schwern <schwernpobox.com>, Ken Williams
 
<kwilliamscpan.org>

  =head1 SEE ALSO



Re: Revised Module::Build fixes for VMS.
user name
2007-09-29 11:10:53
Ken Williams wrote:
> 
> On Sep 28, 2007, at 8:55 AM, John E. Malmberg wrote:
> 
>> Additional changes:
>>
>> In Base.pm, created a subroutine to return the
regex either as case  
>> insensitive or case sensitive based on the setting
for  
>> File::Spec::case_tolerant.
>>
>> Note in the existing code, one place assumes that
the  
>> File::Spec::case_tolerant routine exists, and
another tests to see  if 
>> it exists.
>>
>> Converted were needed the qr to
file_qr('xxxx')

> 
> Thanks, John.
> 
> I assume that in process_support_files() you meant
file_qr('.c(pp)? $') 
> and not qr('.c(pp)?$').

I must have missed that one, thanks.

> The M::B::Platform::VMS hunk didn't apply cleanly
against the svn  repo, 
> something about a manpage separator.  There seems to be
no such  code to 
> what's getting patched, do you know what's going on
there?

I don't know about that, Maybe Craig does.

> Also, the t/install.t patch caused some new failures so
I haven't  
> applied that yet.

I see that you addressed this in a later e-mail.

-John
wb8tywqsl.network
Personal Opinion Only

Re: Revised Module::Build fixes for VMS.
user name
2007-09-29 11:41:08
At 4:55 PM +0100 9/29/07, Nicholas Clark wrote:
>On Sat, Sep 29, 2007 at 10:44:34AM -0500, Ken Williams
wrote:
>>
>> On Sep 28, 2007, at 11:42 PM, Craig A. Berry
wrote:
>>
>> >It applied cleanly against blead, where I've
checked it in as 31995.
>> >I wonder if we've had some drift between blead
and the independent
>> >version.
>>
>> Indeed we have, here are the VMS-related
outstanding differences.  
>> Could someone verify that the blead version is
correct, and let me 
>> know who to assign credit to in the Changes file?
>
>I can't answer on the first, but on the second I used
"Show Annotated File"
>on http
://public.activestate.com/cgi-bin/perlbrowse to work out
that the
>first two chunks are this change:
>
>http://public.activestate.com/cgi-bin/perlbrowse/p/31156

>
>and the rest seems to be this change:
>
>http://public.activestate.com/cgi-bin/perlbrowse/p/31619


Obviously I consider the blead changes correct since I made
them .
Sorry not to keep you up-to-date; I think I had a fantasy
that I
would get all the M::B on VMS issues worked out and submit
one big
patch, but even with John's help that hasn't happened and is
unlikely
to before 5.10.
-- 
________________________________________
Craig A. Berry
mailto:craigberrymac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

[1-10] [11-17]

about | contact  Other archives ( Real Estate discussion Medical topics )