Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 11: Failed test 'lstat' at t\filesystem.t line 420 (lstat->size returns zero) #269

Open
hakonhagland opened this issue Nov 19, 2022 · 1 comment

Comments

@hakonhagland
Copy link

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: Perl/perl5#20395.

When testing Path::Tiny including the fix in #268 for realpath, I get:

>perl Makefile.PL
Generating a gmake-style Makefile
Writing Makefile for Path::Tiny
Writing MYMETA.yml and MYMETA.json

>gmake
cp p.pl blib\lib\Path\p.pl
cp lib/Path/Tiny.pm blib\lib\Path\Tiny.pm

C:\Users\hakon\perl\github\Path-Tiny>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 .................... 37/?
#   Failed test 'lstat'
#   at t/filesystem.t line 420.
# Looks like you failed 1 test of 104.
t/filesystem.t .................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/104 subtests
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
[...]

More information about the failed test:

>perl -Ilib t\filesystem.t
ok 1 - Got a filename via tmpnam()

[...]

ok 80 - copy()
ok 81 - touch can chain
not ok 82 - lstat
#   Failed test 'lstat'
#   at t\filesystem.t line 420.
ok 83 - realpath resolves symlinks
ok 84 - remove symbolic link

[...]

The problem is most likely that lstat->size returns zero on windows, see Perl/perl5#20476 for more information. A fix has been proposed here: Perl/perl5#20500 but has currently not been merged into blead.

hakonhagland added a commit to hakonhagland/Path-Tiny that referenced this issue Nov 19, 2022
@hakonhagland
Copy link
Author

Added a PR to fix this, see #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant