-
Notifications
You must be signed in to change notification settings - Fork 584
BBC: LNATION/Devel-Required-0.15.tar.gz fails with perl 5.31.10 #17681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The code does this in a BEGIN block to find the
.. and the @iabyn this appears to be further fallout from "avoid identical stack traces". I'm a bit concerned that problems like this may affect a bunch of non-CPAN code too, and could be hard for people to diagnose without conscious awareness of the change. Is there anything we can do to mitigate that? [Edited "caller(2)" to "caller(1)" after deciding my diagnostics had introduced an extra stack frame, then back again when I found that was wrong.] |
On Sun, Mar 29, 2020 at 07:30:40AM -0700, Hugo van der Sanden wrote:
@iabyn this appears to be further fallout from "avoid identical stack
traces". I'm a bit concerned that problems like this may affect a bunch
of non-CPAN code too, and could be hard for people to diagnose without
conscious awareness of the change. Is there anything we can do to
mitigate that?
Not really, apart from pulling the fix altogether.
Previously perl screwed up the stack backtrace within BEGINs; now caller()
returns the correct values. Seems like a binary choice - keep the fix,
or revert to the broken behaviour for backwards compatibility.
Of course if we revert now, we screw up any distributions which have just
been fixed to match blead behaviour.
…--
Counsellor Troi states something other than the blindingly obvious.
-- Things That Never Happen in "Star Trek" #16
|
Ok, I've opened https://rt.cpan.org/Ticket/Display.html?id=132269 against Devel::Required. I think we'll need at least to highlight this prominently in 5.32 perldelta. |
Is the underlying cause of this the same as in #17663? |
Yes. |
As per #17663 (comment), there is still an open question as to whether this is a fix at all, or an undesired behaviour. I don't know the answer, but this was a thoughtful post and no one has responded to the concerns raised yet. |
This is, IMHO, a correct fix, as I expressed in #17663. |
On 4/26/20 2:57 AM, Sawyer X wrote:
This is, IMHO, a correct fix, as I expressed in #17663
<#17663>.
Earlier in this ticket, @hvds observed that we need to "to highlight
[the correction to caller()'s behavior] prominently in 5.32 perldelta."
ack-ing pod/perl pod/perl5031*delta.pod for `caller`, the only thing I
can find is:
```
=item caller
Like L<C<__FILE__>|/__FILE__> and L<C<__LINE__>|/__LINE__>, the filename and
line number returned here may be altered by the mechanism described at
L<perlsyn/"Plain Old Comments (Not!)">.
```
... which to me doesn't seem to be sufficient. Could we get something
better?
Thank you very much.
Jim Keenan
|
Is this now not a blocker, since commits for https://github.com/Perl/perl5/issues/17663 have been reverted? |
On Mon, Apr 27, 2020 at 06:18:48PM -0700, Karl Williamson wrote:
Is this now not a blocker, since commits for [#17663](url) have been reverted?
Correct. To fully quote the revert merge:
commit c0d0530
Merge: c6b2e29 79f75ea
Author: David Mitchell <[email protected]>
AuthorDate: Mon Apr 27 22:04:23 2020 +0100
Commit: David Mitchell <[email protected]>
CommitDate: Mon Apr 27 22:04:51 2020 +0100
[MERGE] Revert BEGIN { caller() } fixups
These commits were intended to fix a problem with stack backtraces
reporting wrong file and line numbers in nested use's.
A side-effect of the commits was to fix the package name returned by
caller() too; but quite a few distributions were relying on the old
behaviour.
So for now, revert to the old behaviour and re-address after 5.32.0 is
released.
The reverted commits are:
v5.31.6-141-gf2f32cd638 avoid identical stack traces
v5.31.9-122-gee428a211d docs: clarify effect of $^H, %^H, ${^WARNING_BITS}
v5.31.9-162-gad89278aa2 fixup to "avoid identical stack traces" - try 2
…--
Monto Blanco... scorchio!
|
Confirmed. The distribution's test suite passes on my smokers with perl 5.31.11. |
The test suite of Devel-Required-0.16 started to fail again. See http://www.cpantesters.org/cpan/report/5ea15b0a-9549-11ec-a601-45351f24ea8f (the reported state is "unknown" for some reason, but it should really be "fail"). |
Manual inspection points to commit f6387cf as the cause of the failures.
At the immediately preceding commit, Devel-Required PASSes its tests, albeit with some peculiar exiting.
This module is, IMO, too clever for its own good. But at least at that commit the tests are PASSing. At the following commit -- which is a revert of a revert -- the tests FAIL in the same manner they were two years ago.
The CPAN maintainer has never replied to the ticket which @hvds created two years ago. How we should proceed is unclear? |
On Sun, 13 Mar 2022 at 19:33, James E Keenan ***@***.***> wrote:
The test suite of Devel-Required-0.16 started to fail again. See
http://www.cpantesters.org/cpan/report/5ea15b0a-9549-11ec-a601-45351f24ea8f
(the reported state is "unknown" for some reason, but it should really be
"fail").
Manual inspection points to commit f6387cf
<f6387cf>
as the cause of the failures.
commit f6387cf
Author: Yves Orton ***@***.***>
AuthorDate: Mon Feb 14 07:34:54 2022 +0100
Commit: Paul Evans ***@***.***>
CommitDate: Sat Feb 19 11:23:43 2022 +0000
Reapply squashed "avoid identical stack traces" patches
This reapplies two reverted patches as a single squashed commit.
At the immediately preceding commit, Devel-Required PASSes its tests,
albeit with some peculiar exiting.
cp lib/Devel/Required.pm blib/lib/Devel/Required.pm
PERL_DL_NONLAZY=1 "/usr/home/jkeenan/testing/f6387cff9cb31db4cf18c8641917ea4639ac2b65^/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/001basic.t ......... ok
t/010specific.t ...... ok
t/020installation.t .. ok
All tests successful.
Files=3, Tests=76, 2 wallclock secs ( 0.04 usr 0.01 sys + 0.70 cusr 0.12 csys = 0.86 CPU)
Result: PASS
make: don't know how to make install. Stop
make: stopped in /usr/home/jkeenan/.cpanm/work/1647195442.32111/Devel-Required-0.16
-> FAIL Installing Devel::Required failed. See /home/jkeenan/.cpanm/work/1647195442.32111/build.log for details. Retry with --force to force install it.
This module is, IMO, too clever for its own good. make test removes the
Makefile, which probably explains the don't know how to make install
message. You get a similar message for make clean. I could not get this
to work properly in Porting/bisect.pl; I suspect the module's cleverness
is behind that as well.
But at least at that commit the tests are PASSing. At the following commit
-- which is a revert of a revert -- the tests FAIL in the same manner they
were two years ago.
t/001basic.t (Wstat: 1536 Tests: 36 Failed: 6)
Failed tests: 16, 19, 23, 26, 30, 33
Non-zero exit status: 6
t/010specific.t (Wstat: 512 Tests: 20 Failed: 2)
Failed tests: 15, 18
Non-zero exit status: 2
t/020installation.t (Wstat: 512 Tests: 20 Failed: 2)
Failed tests: 15, 18
Non-zero exit status: 2
Files=3, Tests=76, 1 wallclock secs ( 0.02 usr 0.02 sys + 0.63 cusr 0.15 csys = 0.82 CPU)
Result: FAIL
Failed 3/3 test programs. 10/76 subtests failed
The CPAN maintainer has never replied to the ticket
<https://rt.cpan.org/Ticket/Display.html?id=132269> which @hvds
<https://github.com/hvds> created two years ago.
How we should proceed is unclear?
This module does dodgy things in a BEGIN{} block that it should be doing
some other way. By the definition of a "well behaved module" this module
never worked properly in that it could only work properly in the first
place it was loaded.
This raises the question of what to do with CPAN modules that were always
broken (Acme::Dot comes to mind), but whose tests passed due to some bug in
the past, and which are no longer maintained, or at the least where the
module maintainers are non-responsive.
As you said, a bug was raised about this over two years ago, seems to me
they had reasonable time to follow up about this.
So I don't think this should be a blocker at all.
Also, I have filed:
…--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
On Mon, 14 Mar 2022 at 02:38, demerphq ***@***.***> wrote:
On Sun, 13 Mar 2022 at 19:33, James E Keenan ***@***.***> wrote:
>
> The test suite of Devel-Required-0.16 started to fail again. See http://www.cpantesters.org/cpan/report/5ea15b0a-9549-11ec-a601-45351f24ea8f (the reported state is "unknown" for some reason, but it should really be "fail").
>
> Manual inspection points to commit f6387cf as the cause of the failures.
>
> commit f6387cf
> Author: Yves Orton ***@***.***>
> AuthorDate: Mon Feb 14 07:34:54 2022 +0100
> Commit: Paul Evans ***@***.***>
> CommitDate: Sat Feb 19 11:23:43 2022 +0000
>
> Reapply squashed "avoid identical stack traces" patches
>
> This reapplies two reverted patches as a single squashed commit.
>
> At the immediately preceding commit, Devel-Required PASSes its tests, albeit with some peculiar exiting.
>
> cp lib/Devel/Required.pm blib/lib/Devel/Required.pm
> PERL_DL_NONLAZY=1 "/usr/home/jkeenan/testing/f6387cff9cb31db4cf18c8641917ea4639ac2b65^/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/001basic.t ......... ok
> t/010specific.t ...... ok
> t/020installation.t .. ok
> All tests successful.
> Files=3, Tests=76, 2 wallclock secs ( 0.04 usr 0.01 sys + 0.70 cusr 0.12 csys = 0.86 CPU)
> Result: PASS
> make: don't know how to make install. Stop
>
> make: stopped in /usr/home/jkeenan/.cpanm/work/1647195442.32111/Devel-Required-0.16
> -> FAIL Installing Devel::Required failed. See /home/jkeenan/.cpanm/work/1647195442.32111/build.log for details. Retry with --force to force install it.
>
> This module is, IMO, too clever for its own good. make test removes the Makefile, which probably explains the don't know how to make install message. You get a similar message for make clean. I could not get this to work properly in Porting/bisect.pl; I suspect the module's cleverness is behind that as well.
>
> But at least at that commit the tests are PASSing. At the following commit -- which is a revert of a revert -- the tests FAIL in the same manner they were two years ago.
>
> t/001basic.t (Wstat: 1536 Tests: 36 Failed: 6)
> Failed tests: 16, 19, 23, 26, 30, 33
> Non-zero exit status: 6
> t/010specific.t (Wstat: 512 Tests: 20 Failed: 2)
> Failed tests: 15, 18
> Non-zero exit status: 2
> t/020installation.t (Wstat: 512 Tests: 20 Failed: 2)
> Failed tests: 15, 18
> Non-zero exit status: 2
> Files=3, Tests=76, 1 wallclock secs ( 0.02 usr 0.02 sys + 0.63 cusr 0.15 csys = 0.82 CPU)
> Result: FAIL
> Failed 3/3 test programs. 10/76 subtests failed
>
> The CPAN maintainer has never replied to the ticket which @hvds created two years ago.
>
> How we should proceed is unclear?
This module does dodgy things in a BEGIN{} block that it should be doing some other way. By the definition of a "well behaved module" this module never worked properly in that it could only work properly in the first place it was loaded.
This raises the question of what to do with CPAN modules that were always broken (Acme::Dot comes to mind), but whose tests passed due to some bug in the past, and which are no longer maintained, or at the least where the module maintainers are non-responsive.
As you said, a bug was raised about this over two years ago, seems to me they had reasonable time to follow up about this.
So I don't think this should be a blocker at all.
Also, I have filed:
Sorry about that, managed to hit send before i meant to.
I have filed:
https://rt.cpan.org/Ticket/Display.html?id=141752&results=2ec5e4d94091d7eedcacb5ca6c07c4c2
which includes a fix which should work on any perl.
commit adce5784bd27acae7fb80f42a4d2b80cd75f12a5
Author: Yves Orton ***@***.***>
Date: Mon Mar 14 02:24:03 2022 +0100
Fix to not depend on caller in BEGIN
In Perl 5.35.9 we fixed various bugs in caller() which broke this
module. Doing this override via caller in a BEGIN is inherently
flawed and happens to exploit a bug in perl about the values returned
by caller. If for some (admittedly bizarre) reason someone loaded
this from a module or wanted to load it in two namespaces it would only
work in one. This fix should work on any Perl version.
This reworks the module so it should work on any version of perl.
A key part of the change is that the
eval "use Devel::Required";
must go BEFORE the
use ExtUtils::MakeMaker;
and not *after* it as it was before.
diff --git a/CHANGELOG b/CHANGELOG
index 6bb429a..a09b9c3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+0.17 14 March 2022
+ Fix module so it should work on any version of perl.
+ Note the order it is used in a Makefile.PL has changed,
+ it should be loaded in an eval BEFORE loading ExtUtils::MakeMaker
+ not afterwards.
+
0.15 9 November 2019
Adoption.
diff --git a/Makefile.PL b/Makefile.PL
index 70e5d19..5897b43 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,6 +1,6 @@
require 5.000;
-use ExtUtils::MakeMaker;
eval "use Devel::Required";
+use ExtUtils::MakeMaker;
WriteMakefile (
NAME => "Devel::Required",
diff --git a/lib/Devel/Required.pm b/lib/Devel/Required.pm
index ab859e0..43bb0b2 100644
--- a/lib/Devel/Required.pm
+++ b/lib/Devel/Required.pm
@@ -1,11 +1,12 @@
package Devel::Required;
# set version information
-$VERSION= '0.16';
+$VERSION= '0.17';
# make sure we do everything by the book from now on
use strict;
use warnings;
+use ExtUtils::MakeMaker ();
# initializations
my @text; # list with text-file conversion
@@ -16,7 +17,7 @@ my $INSTALLATION; # any installation information
BEGIN {
no warnings 'redefine';
no strict 'refs';
- my $subname= caller() . '::WriteMakefile';
+ my $subname= 'ExtUtils::MakeMaker::WriteMakefile';
my $old= \&{$subname};
*$subname= sub {
@@ -255,29 +256,29 @@ This documentation describes version 0.16.
=head1 SYNOPSIS
- use ExtUtils::MakeMaker; # check README and lib/Your/Module.pm
eval "use Devel::Required";
+ use ExtUtils::MakeMaker; # check README and lib/Your/Module.pm
WriteMakefile (
NAME => "Your::Module",
VERSION_FROM => "lib/Your/Module.pm",
PREREQ_PM => { 'Foo' => '1.0', 'Bar::Baz' => '0.05' }
);
- use ExtUtils::MakeMaker; # specify which files should be checked
eval <<"CODE";
use Devel::Required
text => 'INSTALL',
pod => [ qw( lib/Your/Module.pod ) ],
;
CODE
+ use ExtUtils::MakeMaker; # specify which files should be checked
WriteMakefile (
NAME => "Your::Module",
VERSION_FROM => "lib/Your/Module.pm",
PREREQ_PM => { 'Foo' => '1.0', 'Bar::Baz' => '0.05' }
);
- use ExtUtils::MakeMaker; # specify maint / blead installation information
eval "use Devel::Required maint_blead => 5.014";
+ use ExtUtils::MakeMaker; # specify maint / blead installation information
=head1 DESCRIPTION
@@ -298,6 +299,10 @@ distributions that have a C<maint> and C<blead>
version internally.
This module should B<only> be installed on the system of the developer.
+Note that as 0.17 the module should be used in an eval BEFORE loading
+L<ExtUtils::MakeMaker>, not afterwards as in previous versions. This version
+should work on any version of perl.
+
=head1 FILES CHANGED
By default the following types of files will be changed:
@@ -429,7 +434,7 @@ the future to provide more clarity for developers
and packagers.
=head1 REQUIRED MODULES
- (none)
+ ExtUtils::MakeMaker
=head1 THEORY OF OPERATION
diff --git a/t/001basic.t b/t/001basic.t
index a35f02f..4b8dd5d 100644
--- a/t/001basic.t
+++ b/t/001basic.t
@@ -4,8 +4,8 @@ use Test::More tests => 1 + ( 3 * 3 ) + 10 + ( 2 * 7 ) + 1 + 1;
use strict;
use warnings;
…-use ExtUtils::MakeMaker;
use Devel::Required;
+use ExtUtils::MakeMaker;
can_ok( 'Devel::Required', qw(
import
) );
diff --git a/t/010specific.t b/t/010specific.t
index 41afbee..663ef18 100644
--- a/t/010specific.t
+++ b/t/010specific.t
@@ -4,8 +4,8 @@ use Test::More tests => ( 3 * 3 ) + 11;
use strict;
use warnings;
-use ExtUtils::MakeMaker;
use Devel::Required pod => 'Foo.pm', text => 'README';
+use ExtUtils::MakeMaker;
my @modules= qw( Foo Bar Baz );
foreach ***@***.***) {
diff --git a/t/020installation.t b/t/020installation.t
index 72b922a..6706844 100644
--- a/t/020installation.t
+++ b/t/020installation.t
@@ -4,8 +4,8 @@ use Test::More tests => ( 3 * 3 ) + 11;
use strict;
use warnings;
-use ExtUtils::MakeMaker;
use Devel::Required maint_blead => 5.014;
+use ExtUtils::MakeMaker;
my @modules= qw( Foo Bar Baz );
foreach ***@***.***) {
--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
On Mon, 14 Mar 2022 at 02:40, demerphq ***@***.***> wrote:
On Mon, 14 Mar 2022 at 02:38, demerphq ***@***.***> wrote:
>
> On Sun, 13 Mar 2022 at 19:33, James E Keenan ***@***.***> wrote:
>>
>> The test suite of Devel-Required-0.16 started to fail again. See http://www.cpantesters.org/cpan/report/5ea15b0a-9549-11ec-a601-45351f24ea8f (the reported state is "unknown" for some reason, but it should really be "fail").
>>
>> Manual inspection points to commit f6387cf as the cause of the failures.
>>
>> commit f6387cf
>> Author: Yves Orton ***@***.***>
>> AuthorDate: Mon Feb 14 07:34:54 2022 +0100
>> Commit: Paul Evans ***@***.***>
>> CommitDate: Sat Feb 19 11:23:43 2022 +0000
>>
>> Reapply squashed "avoid identical stack traces" patches
>>
>> This reapplies two reverted patches as a single squashed commit.
>>
>> At the immediately preceding commit, Devel-Required PASSes its tests, albeit with some peculiar exiting.
>>
>> cp lib/Devel/Required.pm blib/lib/Devel/Required.pm
>> PERL_DL_NONLAZY=1 "/usr/home/jkeenan/testing/f6387cff9cb31db4cf18c8641917ea4639ac2b65^/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
>> t/001basic.t ......... ok
>> t/010specific.t ...... ok
>> t/020installation.t .. ok
>> All tests successful.
>> Files=3, Tests=76, 2 wallclock secs ( 0.04 usr 0.01 sys + 0.70 cusr 0.12 csys = 0.86 CPU)
>> Result: PASS
>> make: don't know how to make install. Stop
>>
>> make: stopped in /usr/home/jkeenan/.cpanm/work/1647195442.32111/Devel-Required-0.16
>> -> FAIL Installing Devel::Required failed. See /home/jkeenan/.cpanm/work/1647195442.32111/build.log for details. Retry with --force to force install it.
>>
>> This module is, IMO, too clever for its own good. make test removes the Makefile, which probably explains the don't know how to make install message. You get a similar message for make clean. I could not get this to work properly in Porting/bisect.pl; I suspect the module's cleverness is behind that as well.
>>
>> But at least at that commit the tests are PASSing. At the following commit -- which is a revert of a revert -- the tests FAIL in the same manner they were two years ago.
>>
>> t/001basic.t (Wstat: 1536 Tests: 36 Failed: 6)
>> Failed tests: 16, 19, 23, 26, 30, 33
>> Non-zero exit status: 6
>> t/010specific.t (Wstat: 512 Tests: 20 Failed: 2)
>> Failed tests: 15, 18
>> Non-zero exit status: 2
>> t/020installation.t (Wstat: 512 Tests: 20 Failed: 2)
>> Failed tests: 15, 18
>> Non-zero exit status: 2
>> Files=3, Tests=76, 1 wallclock secs ( 0.02 usr 0.02 sys + 0.63 cusr 0.15 csys = 0.82 CPU)
>> Result: FAIL
>> Failed 3/3 test programs. 10/76 subtests failed
>>
>> The CPAN maintainer has never replied to the ticket which @hvds created two years ago.
>>
>> How we should proceed is unclear?
>
> This module does dodgy things in a BEGIN{} block that it should be doing some other way. By the definition of a "well behaved module" this module never worked properly in that it could only work properly in the first place it was loaded.
>
> This raises the question of what to do with CPAN modules that were always broken (Acme::Dot comes to mind), but whose tests passed due to some bug in the past, and which are no longer maintained, or at the least where the module maintainers are non-responsive.
>
> As you said, a bug was raised about this over two years ago, seems to me they had reasonable time to follow up about this.
>
> So I don't think this should be a blocker at all.
>
> Also, I have filed:
Sorry about that, managed to hit send before i meant to.
I have filed:
https://rt.cpan.org/Ticket/Display.html?id=141752&results=2ec5e4d94091d7eedcacb5ca6c07c4c2
which includes a fix which should work on any perl.
While working on this I also noticed that ExtUtils::MakeMaker has some
documentation bugs where it says WriteMakeFile() and not
WriteMakefile(). I filed a ticket as:
https://rt.cpan.org/Ticket/Display.html?id=141753
cheers,
Yves
…--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
I think you sent those two tickets to the wrong queue |
On Mon, 14 Mar 2022 at 12:54, Leon Timmermans ***@***.***> wrote:
I think you sent those two tickets to the wrong queue
<https://rt.cpan.org/Dist/Display.html?Queue=0.05>
WTF. So I did. I followed links from MetaCpan, and then hit create a new
issue, so not sure what the heck happened there.
Thanks!
Yves
|
On Mon, 14 Mar 2022 at 14:12, demerphq ***@***.***> wrote:
On Mon, 14 Mar 2022 at 12:54, Leon Timmermans ***@***.***> wrote:
>
> I think you sent those two tickets to the wrong queue
WTF. So I did. I followed links from MetaCpan, and then hit create a new issue, so not sure what the heck happened there.
Thanks!
And fixed now.
cheers,
Yves
…--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
Unfortunately there are two buttons. The "Report a new bug" button is the correct one, which pre-selects the current queue. The "Create new ticket" button doesn't, so it just ends up with the first one, "0.05", and the wrong button is the one highlighted in the UI. I believe it's been reported to Best Practical, but it hasn't been fixed. |
On Mon, 14 Mar 2022 at 14:20, Graham Knop ***@***.***> wrote:
Unfortunately there are two buttons. The "Report a new bug" button is the
correct one, which pre-selects the current queue. The "Create new ticket"
button doesn't, so it just ends up with the first one, "0.05", and the
wrong button is the one highlighted in the UI. I believe it's been reported
to Best Practical, but it hasn't been fixed.
Well at least you can edit the ticket to assign it to the right queue.
Thank heaven for small mercies.
cheers,
Yves
|
I have marked this not-a-blocker. A fix has been sent upstream, and the library does not appear high up the river. |
See http://fast-matrix.cpantesters.org/?dist=Devel-Required%200.15 --- there are no pass reports with released 5.31.10 (though there are some passes for pre-release versions of 5.31.10).
The text was updated successfully, but these errors were encountered: