I have the same problem, with the same setup, except for 32bit perl on 64bit Win7.
Interestingly enough, this was working fine without debugging, but in Komodo IDE its injected code for debugging broke my program's use of FindBin (which uses abs_path) to setup lib path - so yeah, had some fun running around tracing it to PathTools from FindBin :)
Anyway, the problem looks to be the new XS bits for File::Spec. If File::Spec is booted before Cwd, then Cwd do not setup abs_path, etc. correctly:
-----
C:\opt\workdir\PathTools-3.47>perl -w -MFile::Spec -MCwd -e "print Cwd::abs_path( cwd() );"
Subroutine Cwd::bootstrap redefined at C:/Perl/lib/DynaLoader.pm line 207.
Subroutine Cwd::CLONE redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine Cwd::fastcwd redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine Cwd::getcwd redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine Cwd::abs_path redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine Cwd::getdcwd redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine File::Spec::Unix::canonpath redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine File::Spec::Unix::_fn_canonpath redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine File::Spec::Unix::catdir redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine File::Spec::Unix::_fn_catdir redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine File::Spec::Unix::catfile redefined at C:/Perl/lib/DynaLoader.pm line 214.
Subroutine File::Spec::Unix::_fn_catfile redefined at C:/Perl/lib/DynaLoader.pm line 214.
C:\opt\workdir\PathTools-3.47/C:/opt/workdir/PathTools-3.47
C:\opt\workdir\PathTools-3.47>
-----
I can see two ways to fix this:
- Split the XS into two modules
- Only load the XS in Cwd (see attached patch, which works here)
With Patch:
-----
C:\opt\workdir\PathTools-3.47>perl -w -MFile::Spec -MCwd -e "print Cwd::abs_path( cwd() );"
C:/opt/workdir/PathTools-3.47
-----
Comments appreciated.
diff -uprN PathTools-3.47.orig/lib/File/Spec/Unix.pm PathTools-3.47/lib/File/Spec/Unix.pm
--- PathTools-3.47.orig/lib/File/Spec/Unix.pm 2014-05-23 18:39:28 +0200
+++ PathTools-3.47/lib/File/Spec/Unix.pm 2014-06-20 14:44:58 +0200
@@ -9,7 +9,9 @@ $VERSION =~ tr/_//;
unless (defined &canonpath) {
eval {
- if ( $] >= 5.006 ) {
+ # XXX: If we load this here, Cwd do not do the needed setup, and abs_path()
+ # fails on Win32. See bug #96190.
+ if ( 0 && $] >= 5.006 ) {
require XSLoader;
XSLoader::load("Cwd", $xs_version);
} else {