Module-Pluggable icon indicating copy to clipboard operation
Module-Pluggable copied to clipboard

changed behavior of perl CORE (File::Find 1.39 - e.g. perl >= 5.34) on Windows

Open thockar opened this issue 3 years ago • 2 comments

Callers of Module::Pluggable may fail with perl 5.34 on Windows (for example Perl::Critic - but possibly some more modules and tests). This is caused by the (undocumented) changed default behavior of File::Find 1.39 on MSWin32.

The following changes to Module::Pluggable::Object will force the old behavior of File::Find, if not otherwise told

Object.pm .... # default whether to follow symlinks

  • disable follow symlinks for File::Find VERSION >= '1.39' (e.g. Perl 5.34 and higher) on Windows and option 'follow_symlinks' is not given by the caller

  •  # because the default behavior is changed in the Perl-CORE module File::Find VERSION >= '1.39', in lower versions of File::Find, 'follow_symlinks' 
    
  •  # is (independend from the callers setting of 'follow_symlinks') hardcoded set to 0 on Windows
    
  •  # so we force File::Find to fall back to the old behavior, if not otherwise told 
    
  • $self->{'follow_symlinks'} = 0 if ( $File::Find::VERSION >= '1.39' && $^O eq 'MSWin32' && ! exists $self->{'follow_symlinks'} ); $self->{'follow_symlinks'} = 1 unless exists $self->{'follow_symlinks'}; ....

best regards Thomas

thockar avatar Mar 10 '22 10:03 thockar

I just hit the same problem building perl 5.36 using the Strawberry Perl 5.32 toolchain. This fix also worked for me. Thanks Thomas.

blues1875 avatar Jul 24 '22 17:07 blues1875

As of perl-5.37.3 this issue has been addressed by https://github.com/Perl/perl5/pull/20008 and no patching of Module::Pluggable is required.

sisyphus avatar Aug 02 '22 02:08 sisyphus