dagolden / Path-Tiny

File path utility
41 stars 58 forks source link

Windows 11: Failed test "relative on absolute paths with symlinks" in t/rel-abs.t #277

Open hakonhagland opened 1 year ago

hakonhagland commented 1 year ago

I am trying to install Path::Tiny on Windows 11 using a debug version of perl 5.37.6 using MinGW-w64 and gcc 11.3.0 from https://winlibs.com/ (using the MSVCRT runtime library), more information here: https://github.com/Perl/perl5/issues/20395.

When testing Path::Tiny including the fix in #268 for realpath, the fix in #270 for lstat->size, and the fixes in #272 and #274 for forward slashes, I get:

>gmake test
"C:\perl-debug\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/basename.t ...................... ok
t/basic.t ......................... ok
t/children.t ...................... ok
t/chmod.t ......................... ok
t/digest.t ........................ ok
t/exception.t ..................... ok
t/exports.t ....................... ok
t/filesystem.t .................... ok
t/has_same_bytes.t ................ ok
t/input_output.t .................. ok
t/input_output_no_PU_UU.t ......... ok
t/input_output_no_UU.t ............ ok
t/locking.t ....................... ok
t/mkdir.t ......................... ok
t/mkpath.t ........................ ok
t/mutable_tree_while_iterating.t .. ok
t/normalize.t ..................... ok
t/overloading.t ................... ok
t/parent.t ........................ ok
t/recurse.t ....................... ok
t/rel-abs.t ....................... 1/?     # No tests run!

#   Failed test 'No tests run for subtest "relative on absolute paths with symlinks"'
#   at t/rel-abs.t line 216.
Error mkdir on 'C:/Users/hakon/AppData/Local/Temp/Uuj5lGkBjm/A/B': File exists; Cannot create a file when that file already exists at t/rel-abs.t line 124.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 33.
t/rel-abs.t ....................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/33 subtests
t/sig_die.t ....................... ok
t/size.t .......................... ok
t/subsumes.t ...................... ok
t/symlinks.t ...................... ok
t/temp.t .......................... ok
t/visit.t ......................... ok
t/zz-atomic.t ..................... skipped: Test::MockRandom required for atomicity tests
t/zzz-spec.t ...................... ok

Test Summary Report
-------------------
t/rel-abs.t                     (Wstat: 512 (exited 2) Tests: 33 Failed: 1)
  Failed test:  33
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=29, Tests=1807, 17 wallclock secs ( 0.76 usr +  0.11 sys =  0.87 CPU)
Result: FAIL
Failed 1/29 test programs. 1/1807 subtests failed.
gmake: *** [Makefile:912: test_dynamic] Error 255

The problem seems to be that an absolute path in symlink directory's target is not recognized by the perl -d operator, see https://github.com/Perl/perl5/issues/20533. A fix has been proposed in https://github.com/Perl/perl5/pull/20539.