Skip to content

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

@hakonhagland

Description

@hakonhagland

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions