Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the File-chdir CPAN distribution.

Report information
The Basics
Id: 84988
Status: resolved
Priority: 0/
Queue: File-chdir

People
Owner: Nobody in particular
Requestors: BBYRD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.1008
Fixed in: (no value)



Subject: Strange directory mismatch in Cygwin
t/00-compile.t .... ok t/array.t ......... 1/55 Failed to change directory to '/cygdrive/c/.cpan/bbyrd': No such file or directory at t/array.t line 52. # Looks like you planned 55 tests but ran 2. # Looks like your test exited with 2 just after 2. t/array.t ......... Dubious, test returned 2 (wstat 512, 0x200) Failed 53/55 subtests t/chdir.t ......... ok t/delete-array.t .. 1/15 Failed to change directory to '/cygdrive/c/.cpan/bbyrd': No such file or directory at t/delete-array.t line 73. # Looks like you planned 15 tests but ran 6. # Looks like your test exited with 2 just after 6. t/delete-array.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 9/15 subtests t/nested.t ........ ok t/newline.t ....... ok t/var.t ........... ok Test Summary Report ------------------- t/array.t (Wstat: 512 Tests: 2 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 55 tests but ran 2. t/delete-array.t (Wstat: 512 Tests: 6 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 15 tests but ran 6. Files=7, Tests=32, 1 wallclock secs ( 0.05 usr 0.03 sys + 0.29 cusr 0.29 csys = 0.66 CPU) Result: FAIL ======================================================== I'm not sure why it decided to take out a critical piece of home path when it was changing directories. The fault doesn't appear to lie in File::Spec (at least not directly) according to some Dwarn checks: ok 1 - use File::chdir; [ "", "/home/bbyrd/.cpan/build/File-chdir-0.1008-AoQaZg", [ "home", "bbyrd", ".cpan", "build", "File-chdir-0.1008-AoQaZg" ] ] ok 2 - @CWD is fit to be tied ok 3 - Ordinary delete from end of @CWD lives ok 4 - Ordinary delete from end of @CWD works ok 5 - ... and value of @CWD is correct ok 6 - ... and value of $CWD is correct [ "", "/home/bbyrd/.cpan/build/File-chdir-0.1008-AoQaZg", [ "home", "bbyrd", ".cpan", "build", "File-chdir-0.1008-AoQaZg" ] ] Failed to change directory to '/cygdrive/c/.cpan/bbyrd': No such file or directory at /home/bbyrd/test-File-bug.pl line 55. The array struct is Dwarn [ $vol, $cwd, \@cwd ]; in both cases. So, @cwd is valid, but the tied @CWD is somehow mangling the path to something else. (BTW, that script is just the first part of t/delete-array.t.)
Found some more information about this bug. I have a symlink (Windows junction that Cygwin translates just fine) on /home/bbyrd -> /cygdrive/c/Users/bbyrd. The problem lies in the _abs_path sub, specifically Cwd::getcwd. See, as its inserting each array piece (directory) down the line, it runs into a complete different path: "/home/bbyrd/.cpan/build" CLEARED: 1 "/home" CLEARED: 0 "/cygdrive/c/Users/bbyrd" CLEARED: 0 Failed to change directory to '/cygdrive/c/.cpan/bbyrd': No such file or directory at t/delete-array.t line 73. So, the '.cpan' part gets inserted into a transformed array of qw(cygdrive c Users bbyrd), and turns into a non-existent directory. ... Well, crap. This is a problem specific with junctions vs. symbolic links. Symbolic links get absolutely resolved at the first go, without the /home/bbyrd part. Close this ticket. I think this is a Cygwin issue with its internal getcwd. Either that or Cwd is overriding it with something else...