dagolden / Path-Tiny

File path utility
41 stars 59 forks source link

Tests fail on Windows 11: Failed test 'lstat' ... Error resolving realpath #258

Closed hakonhagland closed 1 year ago

hakonhagland commented 2 years ago

I am trying to install this module on Windows 11 with a custom perl (see https://github.com/Perl/perl5/issues/20395 for more information on how I installed this perl). See also https://github.com/miyagawa/cpanminus/issues/652.

>where perl
C:\perl-debug\bin\perl.exe
>perl --version
This is perl 5, version 37, subversion 5 (v5.37.5 (v5.37.4-121-g4e362c6516)) built for MSWin32-x64-multi-thread
[...]

>where cpan
C:\perl-debug\bin\cpan.bat

>powershell "cpan Path::Tiny 2>&1 | tee cpan-path-tiny.log"
[...]
t/00-report-prereqs.t ............. ok
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

#   Failed test 'lstat'
#   at t/filesystem.t line 348.
Error resolving realpath on '/??/C:/Users/hakon/AppData/Local/Temp/GmRhPY46Ey/foo.txt': No such file or directory at t/filesystem.t 
line 350.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 81.
t/filesystem.t .................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/81 subtests 
t/input_output.t .................. ok
t/input_output_no_PU_UU.t ......... ok
[...]

The complete log is here: cpan-path-tiny.log

xdg commented 1 year ago

/??/C:/Users/hakon/AppData/Local/Temp/GmRhPY46Ey/foo.txt is not a valid path on Windows. As I have no way to replicate your build, there's nothing I can do. Since Path::Tiny works correctly on "normal" Windows Perls, I'm closing this ticket. If you ever find the problem and have a PR, I'll consider it.

hakonhagland commented 1 year ago

/??/C:/Users/hakon/AppData/Local/Temp/GmRhPY46Ey/foo.txt is not a valid path on Windows

@xdg It looks like this is an issue with readlink, see https://github.com/Perl/perl5/issues/20460 for more information.