Skip Menu |

This queue is for tickets about the Test-Without-Module CPAN distribution.

Report information
The Basics
Id: 122551
Status: open
Priority: 0/
Queue: Test-Without-Module

People
Owner: Nobody in particular
Requestors: dimitrios.kechagias [...] spareroom.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: v0.19 broke compatibility with Module::Load::Conditional
Date: Thu, 20 Jul 2017 16:24:12 +0100
To: bug-Test-Without-Module [...] rt.cpan.org
From: Dimitrios Kechagias <dimitrios.kechagias [...] spareroom.co.uk>
Version 0.18 was the last one that could be used with Module::Load::Conditional::can_load. Tested on CentOS 6 / Perl 5.10 and CentOS 7 / Perl 5.24 the following: use Test::Without::Module qw(Test::More); use Module::Load::Conditional qw(can_load);; can_load( modules => { 'Test::More' => undef, } ); Gives a "Can't locate Test/More.pm in @INC (you may need to install the Test::More module)… ” for Test::Without::Module versions 0.19, 0.20. Flatshare is a limited company registered in England and Wales. Registration #04407847, Registered office: 32 Park Green, Macclesfield, Cheshire, SK11 7NA. T: 01625 666 750 This electronic mail may contain confidential or legally privileged information. It is for the intended recipient(s) only. Should you receive this message in error, please notify the sender immediately by replying to this email. If you are not the intended recipient, any disclosure, distribution, reproduction, printing or reliance on the contents of this information is strictly prohibited. Whilst all care has been taken, Flatshare Ltd is not responsible for the integrity or content of any attachment(s) or links included within. * THE CONTENT OF THIS EMAIL IS NOT LEGAL ADVICE AND SHOULD NOT BE TREATED AS SUCH. CONTENT IS THE AUTHORS OPINION BASED ON EXPERIENCE OR THEIR INTERPRETATION OF PUBLICLY AVAILABLE INFORMATION. NONE OF OUR STAFF ARE LEGALLY TRAINED AND WE ALWAYS ADVISE THAT PROPER LEGAL ADVICE IS TAKEN IF REQUIRED.
Subject: Re: [rt.cpan.org #122551] v0.19 broke compatibility with Module::Load::Conditional
Date: Thu, 20 Jul 2017 18:18:50 +0200
To: bug-Test-Without-Module [...] rt.cpan.org
From: Max Maischein <corion [...] corion.net>
Hello Dimitrios, thank you very much for the bug report. Show quoted text
> Version 0.18 was the last one that could be used with Module::Load::Conditional::can_load. Tested on CentOS 6 / Perl 5.10 and CentOS 7 / Perl 5.24 the following: > > use Test::Without::Module qw(Test::More); > use Module::Load::Conditional qw(can_load);; > > can_load( > modules => { > 'Test::More' => undef, > } > ); > > Gives a "Can't locate Test/More.pm in @INC (you may need to install the Test::More module)… ” for Test::Without::Module versions 0.19, 0.20. >
From looking at the source code of Module::Load::Conditional, I would expect can_load() fail, as it can't load Test::More. What did happen with the versions before? When I run the below test program, it passes its one test for me. -max #!/usr/bin/perl -w use strict; use Test::More tests => 1; use Test::Without::Module qw(Test::More); use Module::Load::Conditional qw(can_load); my $res = can_load( modules => { 'Test::More' => undef, } ); ok !$res, "We don't load Test::More"; diag "Test::Without::Module: $Test::Without::Module::VERSION"; diag "Module::Load::Conditional: $Module::Load::Conditional::VERSION"; done_testing; __END__ 1..1 ok 1 - We don't load Test::More # Test::Without::Module: 0.20 # Module::Load::Conditional: 0.62
Subject: Re: [rt.cpan.org #122551] v0.19 broke compatibility with Module::Load::Conditional
Date: Thu, 20 Jul 2017 18:52:55 +0100
To: bug-Test-Without-Module [...] rt.cpan.org
From: Dimitrios Kechagias <dimitrios.kechagias [...] spareroom.co.uk>
Thanks for the prompt response. I can’t find Module::Load::Conditional: 0.62 on CPAN, but installing the current (0.68) version on a MacOS Sierra machine (to try a completely different OS stack), along with Test::Without::Module: 0.20 and this is the result of your test: 1..1 Can't locate Test/More.pm in @INC (you may need to install the Test::More module) (@INC contains: CODE(0x7f919520a960) /usr/local/lib/perl5/site_perl [...] .) at /Users/dimitrios/perl5/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Module/Load/Conditional.pm line 215. # Looks like your test exited with 255 before it could output anything. Best regards, Dimitrios Show quoted text
> On 20 Jul 2017, at 17:19, Max Maischein via RT <bug-Test-Without-Module@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=122551 > > > Hello Dimitrios, > > thank you very much for the bug report.
>> Version 0.18 was the last one that could be used with Module::Load::Conditional::can_load. Tested on CentOS 6 / Perl 5.10 and CentOS 7 / Perl 5.24 the following: >> >> use Test::Without::Module qw(Test::More); >> use Module::Load::Conditional qw(can_load);; >> >> can_load( >> modules => { >> 'Test::More' => undef, >> } >> ); >> >> Gives a "Can't locate Test/More.pm in @INC (you may need to install the Test::More module)… ” for Test::Without::Module versions 0.19, 0.20. >>
> > From looking at the source code of Module::Load::Conditional, I would > expect can_load() fail, as it can't load Test::More. > > What did happen with the versions before? > > When I run the below test program, it passes its one test for me. > > -max > > > #!/usr/bin/perl -w > use strict; > use Test::More tests => 1; > > use Test::Without::Module qw(Test::More); > use Module::Load::Conditional qw(can_load); > > my $res = can_load( > modules => { > 'Test::More' => undef, > } > ); > ok !$res, "We don't load Test::More"; > > diag "Test::Without::Module: $Test::Without::Module::VERSION"; > diag "Module::Load::Conditional: $Module::Load::Conditional::VERSION"; > done_testing; > > __END__ > > 1..1 > ok 1 - We don't load Test::More > # Test::Without::Module: 0.20 > # Module::Load::Conditional: 0.62 >
Flatshare is a limited company registered in England and Wales. Registration #04407847, Registered office: 32 Park Green, Macclesfield, Cheshire, SK11 7NA. T: 01625 666 750 This electronic mail may contain confidential or legally privileged information. It is for the intended recipient(s) only. Should you receive this message in error, please notify the sender immediately by replying to this email. If you are not the intended recipient, any disclosure, distribution, reproduction, printing or reliance on the contents of this information is strictly prohibited. Whilst all care has been taken, Flatshare Ltd is not responsible for the integrity or content of any attachment(s) or links included within. * THE CONTENT OF THIS EMAIL IS NOT LEGAL ADVICE AND SHOULD NOT BE TREATED AS SUCH. CONTENT IS THE AUTHORS OPINION BASED ON EXPERIENCE OR THEIR INTERPRETATION OF PUBLICLY AVAILABLE INFORMATION. NONE OF OUR STAFF ARE LEGALLY TRAINED AND WE ALWAYS ADVISE THAT PROPER LEGAL ADVICE IS TAKEN IF REQUIRED.
Subject: Re: [rt.cpan.org #122551] v0.19 broke compatibility with Module::Load::Conditional
Date: Thu, 20 Jul 2017 20:15:56 +0200
To: bug-Test-Without-Module [...] rt.cpan.org
From: Max Maischein <corion [...] corion.net>
Hello Dimitrios, Show quoted text
> Thanks for the prompt response. I can’t find Module::Load::Conditional: 0.62 on CPAN, but installing the current (0.68) version on a MacOS Sierra machine (to try a completely different OS stack), along with Test::Without::Module: 0.20 and this is the result of your test: > > 1..1 > Can't locate Test/More.pm in @INC (you may need to install the Test::More module) (@INC contains: CODE(0x7f919520a960) /usr/local/lib/perl5/site_perl [...] .) at /Users/dimitrios/perl5/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Module/Load/Conditional.pm line 215. > # Looks like your test exited with 255 before it could output anything.
That's really weird, because I still get the same result, after upgrading Module::Load::Conditional (see below). Maybe there is something else in your setup (or mine) that makes this behaviour special. Maybe set $Module::Load::Conditional::VERBOSE=1; With that set, I see the error messages but still don't get a crash afterwards, see the second test run below. -max c:\Users\Corion\Projekte\Test-Without-Module>perl -Ilib -w t\rt122551.t 1..1 ok 1 - We don't load Test::More # Test::Without::Module: 0.20 # Module::Load::Conditional: 0.68 c:\Users\Corion\Projekte\Test-Without-Module>perl -v This is perl 5, version 20, subversion 1 (v5.20.1) built for MSWin32-x64-multi-thread Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. c:\Users\Corion\Projekte\Test-Without-Module> --- c:\Users\Corion\Projekte\Test-Without-Module>perl -Ilib -w t\rt122551.t 1..1 Cannot open file 'Test\More.pm': at C:/strawberry-perl-5.20.1.1-x64/perl/site/l ib/Module/Load/Conditional.pm line 228. Can't locate Test/More.pm in @INC (you may need to install the Test::More module ) (@INC contains: CODE(0x2c05ae0) lib C:/strawberry-perl-5.20.1.1-x64/perl/site/ lib/MSWin32-x64-multi-thread C:/strawberry-perl-5.20.1.1-x64/perl/site/lib C:/st rawberry-perl-5.20.1.1-x64/perl/vendor/lib C:/strawberry-perl-5.20.1.1-x64/perl/ lib .) at C:/strawberry-perl-5.20.1.1-x64/perl/lib/Module/Load.pm line 77. Can't locate Test/More in @INC (@INC contains: CODE(0x2c05ae0) lib C:/strawberry -perl-5.20.1.1-x64/perl/site/lib/MSWin32-x64-multi-thread C:/strawberry-perl-5.2 0.1.1-x64/perl/site/lib C:/strawberry-perl-5.20.1.1-x64/perl/vendor/lib C:/straw berry-perl-5.20.1.1-x64/perl/lib .) at C:/strawberry-perl-5.20.1.1-x64/perl/lib/ Module/Load.pm line 77. [THIS MAY BE A PROBLEM!] at t\rt122551.t line 10. ok 1 - We don't load Test::More # Test::Without::Module: 0.20 # Module::Load::Conditional: 0.68
Subject: Re: [rt.cpan.org #122551] v0.19 broke compatibility with Module::Load::Conditional
Date: Thu, 20 Jul 2017 19:48:06 +0100
To: bug-Test-Without-Module [...] rt.cpan.org
From: Dimitrios Kechagias <dimitrios.kechagias [...] spareroom.co.uk>
Hmm, maybe Strawberry Perl behaves differently? I don’t have a Windows machine to try it on, but, on both Mac and Linux it dies and VERBOSE makes no difference in the output. You could try running it with VERBOSE=1 on windows with Test::Without::Module 0.18 to see if there is a difference compared to 0.19-0.20. Regards, Dimitrios Show quoted text
> On 20 Jul 2017, at 19:16, Max Maischein via RT <bug-Test-Without-Module@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=122551 > > > Hello Dimitrios,
>> Thanks for the prompt response. I can’t find Module::Load::Conditional: 0.62 on CPAN, but installing the current (0.68) version on a MacOS Sierra machine (to try a completely different OS stack), along with Test::Without::Module: 0.20 and this is the result of your test: >> >> 1..1 >> Can't locate Test/More.pm in @INC (you may need to install the Test::More module) (@INC contains: CODE(0x7f919520a960) /usr/local/lib/perl5/site_perl [...] .) at /Users/dimitrios/perl5/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Module/Load/Conditional.pm line 215. >> # Looks like your test exited with 255 before it could output anything.
> > That's really weird, because I still get the same result, after > upgrading Module::Load::Conditional (see below). Maybe there is > something else in your setup (or mine) that makes this behaviour > special. Maybe set > > $Module::Load::Conditional::VERBOSE=1; > > With that set, I see the error messages but still don't get a crash > afterwards, see the second test run below. > > -max > > > c:\Users\Corion\Projekte\Test-Without-Module>perl -Ilib -w t\rt122551.t > 1..1 > ok 1 - We don't load Test::More > # Test::Without::Module: 0.20 > # Module::Load::Conditional: 0.68 > > c:\Users\Corion\Projekte\Test-Without-Module>perl -v > > This is perl 5, version 20, subversion 1 (v5.20.1) built for > MSWin32-x64-multi-thread > > Copyright 1987-2014, Larry Wall > > Perl may be copied only under the terms of either the Artistic License > or the > GNU General Public License, which may be found in the Perl 5 source kit. > > Complete documentation for Perl, including FAQ lists, should be found on > this system using "man perl" or "perldoc perl". If you have access to the > Internet, point your browser at http://www.perl.org/, the Perl Home Page. > > > c:\Users\Corion\Projekte\Test-Without-Module> > > --- > > c:\Users\Corion\Projekte\Test-Without-Module>perl -Ilib -w t\rt122551.t > 1..1 > Cannot open file 'Test\More.pm': at > C:/strawberry-perl-5.20.1.1-x64/perl/site/l > ib/Module/Load/Conditional.pm line 228. > Can't locate Test/More.pm in @INC (you may need to install the > Test::More module > ) (@INC contains: CODE(0x2c05ae0) lib > C:/strawberry-perl-5.20.1.1-x64/perl/site/ > lib/MSWin32-x64-multi-thread > C:/strawberry-perl-5.20.1.1-x64/perl/site/lib C:/st > rawberry-perl-5.20.1.1-x64/perl/vendor/lib > C:/strawberry-perl-5.20.1.1-x64/perl/ > lib .) at C:/strawberry-perl-5.20.1.1-x64/perl/lib/Module/Load.pm line 77. > Can't locate Test/More in @INC (@INC contains: CODE(0x2c05ae0) lib > C:/strawberry > -perl-5.20.1.1-x64/perl/site/lib/MSWin32-x64-multi-thread > C:/strawberry-perl-5.2 > 0.1.1-x64/perl/site/lib C:/strawberry-perl-5.20.1.1-x64/perl/vendor/lib > C:/straw > berry-perl-5.20.1.1-x64/perl/lib .) at > C:/strawberry-perl-5.20.1.1-x64/perl/lib/ > Module/Load.pm line 77. > [THIS MAY BE A PROBLEM!] at t\rt122551.t line 10. > ok 1 - We don't load Test::More > # Test::Without::Module: 0.20 > # Module::Load::Conditional: 0.68 >
Flatshare is a limited company registered in England and Wales. Registration #04407847, Registered office: 32 Park Green, Macclesfield, Cheshire, SK11 7NA. T: 01625 666 750 This electronic mail may contain confidential or legally privileged information. It is for the intended recipient(s) only. Should you receive this message in error, please notify the sender immediately by replying to this email. If you are not the intended recipient, any disclosure, distribution, reproduction, printing or reliance on the contents of this information is strictly prohibited. Whilst all care has been taken, Flatshare Ltd is not responsible for the integrity or content of any attachment(s) or links included within. * THE CONTENT OF THIS EMAIL IS NOT LEGAL ADVICE AND SHOULD NOT BE TREATED AS SUCH. CONTENT IS THE AUTHORS OPINION BASED ON EXPERIENCE OR THEIR INTERPRETATION OF PUBLICLY AVAILABLE INFORMATION. NONE OF OUR STAFF ARE LEGALLY TRAINED AND WE ALWAYS ADVISE THAT PROPER LEGAL ADVICE IS TAKEN IF REQUIRED.
CC: chris [...] bingosnet.co.uk
Subject: Re: [rt.cpan.org #122551] v0.19 broke compatibility with Module::Load::Conditional
Date: Thu, 20 Jul 2017 22:17:33 +0200
To: bug-Test-Without-Module [...] rt.cpan.org
From: Max Maischein <corion [...] corion.net>
Hello Dimitrios, yes, I can reproduce the problem under Unix, at least with Perl 5.18. But I think the problem is with Module::Load::Conditional, because it does not guard itself against the @INC callback die-ing, only against a file being unreadable or containing invalid Perl code. I'm not really sure that the error is with Test::Without::Module. It breaks backwards compatibility as Module::Load::Conditional doesn't work anymore, but as the change simplifies the hackery I had to do before, I would rather like it more if Module::Load::Conditional guarded itself against the callback failing, which is why I cc Chris :-) The current logic in Module::Load::Conditional (line 210 onwards) will skip an entry in @INC if it somehow fails. This means that the whole loop would need to be wrapped in an eval{} block to be close(r) to what Perl does in `require`... Chris: If the change is OK with you, I will try to come up with a patch! -max