On Fri, Aug 28, 2009 at 03:44:34PM +0100, Steve Hay wrote:
> Nicholas Clark wrote on 2009-08-28:

> > So, somehow, require File::Spec::Functions; or running
> > File::Spec::Functions::rel2abs() is triggering this. So do they do
> > dynamic loading somewhere? And why is doing it with a relative path
> and
> > then the same relative path made absolute going to upset it?
> 
> Yes, File::Spec::Win32::rel2abs() does dynamic loading of Cwd when
> called with no $base:
> 
>     if ( !defined( $base ) || $base eq '' ) {
>       require Cwd ;
>       $base = Cwd::getdcwd( ($self->splitpath( $path ))[0] ) if defined
> &Cwd::getdcwd ;
>       $base = $self->_cwd() unless defined $base ;
>     }
>     elsif ( ! $self->file_name_is_absolute( $base ) ) {
>       $base = $self->rel2abs( $base ) ;
>     }
>     else {
>       $base = $self->canonpath( $base ) ;
>     }
> 
> Hacking TestInit to do:
> 
> @new_inc = map { $_ = File::Spec::Functions::rel2abs($_,
> 'C:/gitclients/perl/ext/DynaLoader'); /(.*)/; $1 }
> 
> it now runs okay with the 'A' flag.

But it should still be the same (actual) path, and nothing is changing
directory here. Hence why I'm really confused, as I would have thought
that all the C runtime gubbins loading the DLL will be loading it either
as ../../lib/$whatever or C:/gitclients/perl/ext/DynaLoader/../../lib/$whatever
or C:/gitclients/perl/lib/$whatever

Which will all be the same place.

So when run from the directory C:/gitclients/perl/ext/DynaLoader, what do

    File::Spec::Functions::rel2abs($_, 'C:/gitclients/perl/ext/DynaLoader');

and

    File::Spec::Functions::rel2abs($_);

generate (for ../../lib and ../../t) ?

Does the world suddenly become a happy place if those two paths are re-written
as ..\..\lib and ..\..\t ?

Nicholas Clark

Reply via email to