Re: how to specify "useithreads" in a distroprefs

[email protected] (Alceu Rodrigues de Freitas Junior via cpan-testers-discuss)
Newsgroups perl.cpan.testers.discuss
Message-ID <[email protected]>
Hello Slaven,

On 14/06/2022 18:37, Slaven Rezic wrote:
>
> Hi Alceu,
>
> Kwalify is just a schema for validating data structures and it does 
> not do any parsing or matching using the distroprefs data. The latter 
> is done by CPAN::Distroprefs.
>
> That said, I tried "useithreads: undef" and it did not work. So it 
> looks like the matching is not done against what is displayed in "perl 
> -V" (in this case the string "undef"), but what is in the Config data 
> structure (the value undef).
>
> However, the distroprefs code only does regexp matches against the 
> stringified values, so to match the stringified undef (the empty 
> string) one has to use '^$'. Below is a distroprefs file just for 
> demonstration purposes, and it works on my system.
>
Thank you for that!

Just tried with the regex "^$" on OpenBSD 7.1 and worked without the 
warning.

On the other hand, I tried both methods on my Ubuntu box and both worked 
without any warning, which isn't the expected:

me:~/.cpan/prefs$ cat test.yml
---
disabled: 1
match:
   distribution: ^MIK/CryptX
   perlconfig:
     #useithreads: null
     useithreads: '^$'

me:~/.cpan/prefs$ cpan -t CryptX
CPAN: CPAN::SQLite loaded ok (v0.219)
Database was generated on Wed, 15 Jun 2022 03:16:47 GMT
Running test for module 'CryptX'
CPAN: YAML::XS loaded ok (v0.83)
CPAN: CPAN::Kwalify loaded ok (v5.50)

______________________ D i s t r o P r e f s ______________________
test.yml[0]
   MIK/CryptX-0.076.tar.gz
   [disabled] -- NA Disabled via prefs file 
'/home/semantix/.cpan/prefs/test.yml' doc 0
me:~/.cpan/prefs$ vi test.yml

me:~/.cpan/prefs$ cat test.yml
---
disabled: 1
match:
   distribution: ^MIK/CryptX
   perlconfig:
     useithreads: null
     #useithreads: '^$'

me:~/.cpan/prefs$ cpan -t CryptX
CPAN: CPAN::SQLite loaded ok (v0.219)
Database was generated on Wed, 15 Jun 2022 03:16:47 GMT
Running test for module 'CryptX'
CPAN: YAML::XS loaded ok (v0.83)
CPAN: CPAN::Kwalify loaded ok (v5.50)

______________________ D i s t r o P r e f s ______________________
test.yml[0]
   MIK/CryptX-0.076.tar.gz
   [disabled] -- NA Disabled via prefs file 
'/home/semantix/.cpan/prefs/test.yml' doc 0

Now, testing on OpenBSD, I got the warning if using "undef", as previous 
stated.

Comparing the systems, the only thing I got that is different is the 
perl itself:

[goku@cpan-smoker-openbsd:~/cpan-openbsd-smoker]$ mversion CPAN::Kwalify
5.50
[goku@cpan-smoker-openbsd:~/cpan-openbsd-smoker]$ mversion CPAN::Distroprefs
6.0001
[goku@cpan-smoker-openbsd:~/cpan-openbsd-smoker]$ perl -v

This is perl 5, version 32, subversion 1 (v5.32.1) built for i386-openbsd

The Ubuntu box is running:

perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux.

Both without ithreads support, but the perl on OpenBSD is patched (by 
the maintainers), so that might explain the difference.

Anyway, I think it's worth to document all this and I'm willing to 
provide a PR for that. Any suggestions where I should do it? Maybe the 
CPAN's distribution Pod?

Regards,

Alceu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.