Mailing List Archive

Sys::Binmode on win32 with recent perls?
Hi all,

CPAN Testers shows a failure with recent perls on win32 that it didn’t with older perls:

http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04

It looks related to symlink(). Did anything happen to change in Perl recently around that built-in and its handling of upgraded/downgraded strings?

(The tests, alas, apparently are run by “NONAME” … who seems to lack contact info.)

Thanks in advance for any pointers folks can offer!

cheers,
-Felipe Gasper
Re: Sys::Binmode on win32 with recent perls? [ In reply to ]
On Mon, Jul 17, 2023 at 5:40?PM Felipe Gasper via perl5-porters <
perl5-porters@perl.org> wrote:

> Hi all,
>
> CPAN Testers shows a failure with recent perls on win32 that it
> didn’t with older perls:
>
> http://matrix.cpantesters.org/?dist=Sys-Binmode+
> <http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04>0
> <http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04>.04
> <http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04>
>
> It looks related to symlink(). Did anything happen to change in
> Perl recently around that built-in and its handling of upgraded/downgraded
> strings?
>
> (The tests, alas, apparently are run by “NONAME” … who seems to
> lack contact info.)
>
> Thanks in advance for any pointers folks can offer!
>

Yes, older Windows didn't support symlink at all, newer ones support it but
don't always allow it (permission wise). You should first tests if it works
at all, and only then test if your downgrading logic is working.

Leon
Re: Sys::Binmode on win32 with recent perls? [ In reply to ]
On Mon, 17 Jul 2023 11:40:19 -0400
Felipe Gasper via perl5-porters <perl5-porters@perl.org> wrote:

> Hi all,
>
> CPAN Testers shows a failure with recent perls on win32 that it didn?t with older perls:
>
> http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04
>
> It looks related to symlink(). Did anything happen to change in Perl recently around that built-in and its handling of upgraded/downgraded strings?
>
> (The tests, alas, apparently are run by ?NONAME? ? who seems to lack contact info.)
>
> Thanks in advance for any pointers folks can offer!
>
> cheers,
> -Felipe Gasper

Perls 5.32 >= didn't support symlink() on Windows and $Config{d_symlink}
was false. Perl 5.34 added support for it, and $Config{d_symlink} is now
true.

However, symlink() will fail if your user doesn't have the necessary
priviliges. Hence the "operation not permitted" error. Normally, only
administrators can create symlinks on Windows.

One way to probe for it is as follows:

my $can_symlinks_be_used = sub {
return 0 if !$Config{d_symlink};

if ($^O eq 'MSWin32') {
require Win32;
return Win32::IsSymlinkCreationAllowed();
}

return 1;
}->();
Re: Sys::Binmode on win32 with recent perls? [ In reply to ]
On 7/17/23 11:40, Felipe Gasper via perl5-porters wrote:
> Hi all,
>
> CPAN Testers shows a failure with recent perls on win32 that it didn’t with older perls:
>
> http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04

Note that this breakage could have occurred anywhere between perl-5.32.1
and perl-5.37.8 -- a very large range, which is testimony to our chronic
shortage of CPANtesting (and core testing) on Win32.

Are you in a position to try to narrow down the range (i.e., bisect) so
that we have a chance to identify the breaking commit (if indeed the
problem is in the core distribution)?

>
> It looks related to symlink(). Did anything happen to change in Perl recently around that built-in and its handling of upgraded/downgraded strings?
>
> (The tests, alas, apparently are run by “NONAME” … who seems to lack contact info.)
>
> Thanks in advance for any pointers folks can offer!
>
> cheers,
> -Felipe Gasper
Re: Sys::Binmode on win32 with recent perls? [ In reply to ]
Thank you for this and other helpful responses. :)

I’ll fix & push a new build.

Cheers,
-Felipe

> On Jul 17, 2023, at 12:07, Tomasz Konojacki <me@xenu.pl> wrote:
>
> ?On Mon, 17 Jul 2023 11:40:19 -0400
> Felipe Gasper via perl5-porters <perl5-porters@perl.org> wrote:
>
>> Hi all,
>>
>> CPAN Testers shows a failure with recent perls on win32 that it didn?t with older perls:
>>
>> http://matrix.cpantesters.org/?dist=Sys-Binmode+0.04
>>
>> It looks related to symlink(). Did anything happen to change in Perl recently around that built-in and its handling of upgraded/downgraded strings?
>>
>> (The tests, alas, apparently are run by ?NONAME?
> who seems to lack contact info.)
>>
>> Thanks in advance for any pointers folks can offer!
>>
>> cheers,
>> -Felipe Gasper
>
> Perls 5.32 >= didn't support symlink() on Windows and $Config{d_symlink}
> was false. Perl 5.34 added support for it, and $Config{d_symlink} is now
> true.
>
> However, symlink() will fail if your user doesn't have the necessary
> priviliges. Hence the "operation not permitted" error. Normally, only
> administrators can create symlinks on Windows.
>
> One way to probe for it is as follows:
>
> my $can_symlinks_be_used = sub {
> return 0 if !$Config{d_symlink};
>
> if ($^O eq 'MSWin32') {
> require Win32;
> return Win32::IsSymlinkCreationAllowed();
> }
>
> return 1;
> }->();
>
Re: Sys::Binmode on win32 with recent perls? [ In reply to ]
On 2023/07/17 09:01, Leon Timmermans wrote:
>
> Yes, older Windows didn't support symlink at all, newer ones support
> it but don't always allow it (permission wise). You should first tests
> if it works at all, and only then test if your downgrading logic is
> working.
---
If your windows is older than WinXP, you might have probs w/symlinks.

But from WinXP on, there are various linking mechanisms.

Symlinks, 'per se' can be administratively controlled from about Win7
and above (Maybe vista?)

Check out settings in win console of

fsutil behavior query symlinkevaluation
Local to local symbolic links are enabled.
Local to remote symbolic links are enabled.
Remote to local symbolic links are enabled.
Remote to remote symbolic links are enabled.