Skip Menu |

This queue is for tickets about the Perl6-Export-Attrs CPAN distribution.

Report information
The Basics
Id: 107627
Status: resolved
Priority: 0/
Queue: Perl6-Export-Attrs

People
Owner: DCONWAY [...] cpan.org
Requestors: ether [...] cpan.org
POWERMAN [...] cpan.org
Cc:
AdminCc:

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



Subject: regression: can't import functions by name
$ cat Lib.pm package Lib; use 5.010001; use warnings; use strict; use utf8; use Perl6::Export::Attrs; sub doit :Export { print "Do it!\n"; } 1; With Perl6::Export::Attrs-0.0.3 everything works as expected: $ perl -E 'use Lib; doit()' Undefined subroutine &main::doit called at -e line 1. $ perl -E 'use Lib qw(doit); doit()' Do it! $ perl -E 'use Lib qw(:ALL); doit()' Do it! With Perl6::Export::Attrs-0.0.4 only :ALL works: $ perl -E 'use Lib; doit()' Undefined subroutine &main::doit called at -e line 1. $ perl -E 'use Lib qw(doit); doit()' Lib does not export: doit use Lib failed at -e line 1. BEGIN failed--compilation aborted at -e line 1. $ perl -E 'use Lib qw(:ALL); doit()' Do it!
On 2015-10-08 10:49:42, POWERMAN wrote: Show quoted text
> $ cat Lib.pm > package Lib; > use 5.010001; > use warnings; > use strict; > use utf8; > use Perl6::Export::Attrs; > > sub doit :Export { > print "Do it!\n"; > } > > 1; > > With Perl6::Export::Attrs-0.0.3 everything works as expected: > > $ perl -E 'use Lib; doit()' > Undefined subroutine &main::doit called at -e line 1. > $ perl -E 'use Lib qw(doit); doit()' > Do it! > $ perl -E 'use Lib qw(:ALL); doit()' > Do it! > > With Perl6::Export::Attrs-0.0.4 only :ALL works: > > $ perl -E 'use Lib; doit()' > Undefined subroutine &main::doit called at -e line 1. > $ perl -E 'use Lib qw(doit); doit()' > Lib does not export: doit > use Lib failed at -e line 1. > BEGIN failed--compilation aborted at -e line 1. > $ perl -E 'use Lib qw(:ALL); doit()' > Do it!
I can confirm the regression --- App::PodPreview is affected by this problem: $ perl5.20.2 -MApp::PodPreview=podpreview -e1 App::PodPreview does not export: podpreview use App::PodPreview failed at -e line 0. BEGIN failed--compilation aborted. With 0.0.3 this used to work.
On 2015-10-31 07:29:21, SREZIC wrote: Show quoted text
> On 2015-10-08 10:49:42, POWERMAN wrote:
> > $ cat Lib.pm > > package Lib; > > use 5.010001; > > use warnings; > > use strict; > > use utf8; > > use Perl6::Export::Attrs; > > > > sub doit :Export { > > print "Do it!\n"; > > } > > > > 1; > > > > With Perl6::Export::Attrs-0.0.3 everything works as expected: > > > > $ perl -E 'use Lib; doit()' > > Undefined subroutine &main::doit called at -e line 1. > > $ perl -E 'use Lib qw(doit); doit()' > > Do it! > > $ perl -E 'use Lib qw(:ALL); doit()' > > Do it! > > > > With Perl6::Export::Attrs-0.0.4 only :ALL works: > > > > $ perl -E 'use Lib; doit()' > > Undefined subroutine &main::doit called at -e line 1. > > $ perl -E 'use Lib qw(doit); doit()' > > Lib does not export: doit > > use Lib failed at -e line 1. > > BEGIN failed--compilation aborted at -e line 1. > > $ perl -E 'use Lib qw(:ALL); doit()' > > Do it!
> > I can confirm the regression --- App::PodPreview is affected by this > problem: > > $ perl5.20.2 -MApp::PodPreview=podpreview -e1 > App::PodPreview does not export: podpreview > use App::PodPreview failed at -e line 0. > BEGIN failed--compilation aborted. > > With 0.0.3 this used to work.
Also affected: PSHANGOV/App-Pmhack-0.002.tar.gz Sample fail report: http://www.cpantesters.org/cpan/report/115c704a-70df-11e5-b92b-d2037053cd79
From: ntyni [...] iki.fi
On Thu Oct 08 10:49:42 2015, POWERMAN wrote: Show quoted text
> With Perl6::Export::Attrs-0.0.3 everything works as expected:
Show quoted text
> With Perl6::Export::Attrs-0.0.4 only :ALL works:
Show quoted text
> $ perl -E 'use Lib qw(doit); doit()' > Lib does not export: doit
Hi, the attached patch fixes this for me. -- Niko Tyni (Debian Perl Group) ntyni@debian.org
Subject: 0001-Fix-a-0.000004-regression-in-exporting-subroutines.patch
From 132e0e132ba7d5185433e760f390aa330ea3ab49 Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Sun, 22 Nov 2015 00:08:55 +0200 Subject: [PATCH] Fix a 0.000004 regression in exporting subroutines While at it, add a test case catching the regression. Bug: https://rt.cpan.org/Public/Bug/Display.html?id=107627 Bug-Debian: https://bugs.debian.org/805105 --- lib/Perl6/Export/Attrs.pm | 2 +- t/01export.t | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 t/01export.t diff --git a/lib/Perl6/Export/Attrs.pm b/lib/Perl6/Export/Attrs.pm index cbe36b0..03016aa 100644 --- a/lib/Perl6/Export/Attrs.pm +++ b/lib/Perl6/Export/Attrs.pm @@ -141,7 +141,7 @@ sub _generic_import { REQUEST: while ($argno < @_) { my $request = $_[$argno]; - if (my ($sub_name) = $request =~ m/\A & ($IDENT) (?:\(\))? \z/xms) { + if (my ($sub_name) = $request =~ m/\A &? ($IDENT) (?:\(\))? \z/xms) { if (exists $request{$sub_name}) { splice @_, $argno, 1; next REQUEST; diff --git a/t/01export.t b/t/01export.t new file mode 100644 index 0000000..976e924 --- /dev/null +++ b/t/01export.t @@ -0,0 +1,12 @@ +use Test::More tests => 1; + +package Lib; +use Perl6::Export::Attrs; +sub doit :Export { "Do it!"; } +1; + +package main; +import Lib qw(doit); + +is(doit(), "Do it!", "function exported as expected"); + -- 2.6.2
Hi. 2015-11-22 08:47:12, ntyni@iki.fi писал: Show quoted text
> Hi, the attached patch fixes this for me.
Thanks. But it looks like this module release schedule is 1 release every 10 years. :) So chances are we'll have to update all code to be compatible with both 0.0.3 and 0.0.4, which means to fix all `use` lines in this way (works both on 0.0.3 and 0.0.4): $ perl -E 'use Lib qw(&doit); doit()' Do it! WBR, Alex.
RT-Send-CC: ntyni [...] iki.fi
On 2015-10-31 07:57:54, SREZIC wrote: Show quoted text
> On 2015-10-31 07:29:21, SREZIC wrote:
> > On 2015-10-08 10:49:42, POWERMAN wrote:
> > > $ cat Lib.pm > > > package Lib; > > > use 5.010001; > > > use warnings; > > > use strict; > > > use utf8; > > > use Perl6::Export::Attrs; > > > > > > sub doit :Export { > > > print "Do it!\n"; > > > } > > > > > > 1; > > > > > > With Perl6::Export::Attrs-0.0.3 everything works as expected: > > > > > > $ perl -E 'use Lib; doit()' > > > Undefined subroutine &main::doit called at -e line 1. > > > $ perl -E 'use Lib qw(doit); doit()' > > > Do it! > > > $ perl -E 'use Lib qw(:ALL); doit()' > > > Do it! > > > > > > With Perl6::Export::Attrs-0.0.4 only :ALL works: > > > > > > $ perl -E 'use Lib; doit()' > > > Undefined subroutine &main::doit called at -e line 1. > > > $ perl -E 'use Lib qw(doit); doit()' > > > Lib does not export: doit > > > use Lib failed at -e line 1. > > > BEGIN failed--compilation aborted at -e line 1. > > > $ perl -E 'use Lib qw(:ALL); doit()' > > > Do it!
> > > > I can confirm the regression --- App::PodPreview is affected by this > > problem: > > > > $ perl5.20.2 -MApp::PodPreview=podpreview -e1 > > App::PodPreview does not export: podpreview > > use App::PodPreview failed at -e line 0. > > BEGIN failed--compilation aborted. > > > > With 0.0.3 this used to work.
> > Also affected: PSHANGOV/App-Pmhack-0.002.tar.gz > Sample fail report: > http://www.cpantesters.org/cpan/report/115c704a-70df-11e5-b92b-d2037053cd79
Complete list of affected CPAN distributions: - KTAT/Util-Any-0.24.tar.gz - PETAMEM/Lingua-AFR-Word2Num-0.1106.tar.gz - PETAMEM/Lingua-DEU-Word2Num-0.1106.tar.gz - PETAMEM/Lingua-ENG-Word2Num-0.0682.tar.gz - PETAMEM/Lingua-EUS-Word2Num-0.0682.tar.gz - PETAMEM/Lingua-POR-Nums2Words-0.0682.tar.gz - PETAMEM/Lingua-RUS-Number-0.136.tar.gz - PETAMEM/Lingua-RUS-Word2Num-0.0682.tar.gz - PETAMEM/Lingua-SWE-Num2Word-0.0682.tar.gz - PETAMEM/Lingua-ZHO-Word2Num-0.0682.tar.gz - POWERMAN/CGI-Easy-1.0.1.tar.gz - POWERMAN/CGI-Easy-URLconf-1.0.1.tar.gz (https://rt.cpan.org/Ticket/Display.html?id=108288) - POWERMAN/Inferno-RegMgr-0.1.7.tar.gz - POWERMAN/Sub-Throttler-v0.2.3.tar.gz - POWERMAN/Text-MiniTmpl-1.1.6.tar.gz - PSHANGOV/App-Pmhack-0.002.tar.gz - PSHANGOV/Dist-Zilla-App-Command-podpreview-0.004.tar.gz (https://rt.cpan.org/Ticket/Display.html?id=110342) - STEFFENW/Hash-Map-0.014.tar.gz - STEFFENW/HTML-Template-Compiled-Filter-Whitespace-0.08.tar.gz - TAKERU/Atompub-0.3.7.tar.gz (https://rt.cpan.org/Ticket/Display.html?id=108287) - TAKERU/Google-Data-JSON-v0.1.10.tar.gz
2016-01-22 09:26:47, SREZIC писал: Show quoted text
> Complete list of affected CPAN distributions:
The real issue is not in affected CPAN distributions, but in affected applications which use these CPAN modules - we can fix "use" lines in dozen of CPAN modules, but who will fix "use" lines in all scripts which use modules based on Perl6::Export::Attrs? Damian doesn't respond, so to make it possible to fix only CPAN modules I've forked Perl6::Export::Attrs and released module named Export::Attrs to CPAN - it's same as Perl6::Export::Attrs 0.000005 with patch attached to this issue by Niko Tyni and modern build system (GitHub, Dist::Milla). Now to fix this issue all affected CPAN modules can be updated to "use Export::Attrs …;" instead of "use Perl6::Export::Attrs …;".
On 2016-01-22 02:26:47, SREZIC wrote: Show quoted text
> On 2015-10-31 07:57:54, SREZIC wrote:
> > On 2015-10-31 07:29:21, SREZIC wrote:
> > > On 2015-10-08 10:49:42, POWERMAN wrote:
> > > > $ cat Lib.pm > > > > package Lib; > > > > use 5.010001; > > > > use warnings; > > > > use strict; > > > > use utf8; > > > > use Perl6::Export::Attrs; > > > > > > > > sub doit :Export { > > > > print "Do it!\n"; > > > > } > > > > > > > > 1; > > > > > > > > With Perl6::Export::Attrs-0.0.3 everything works as expected: > > > > > > > > $ perl -E 'use Lib; doit()' > > > > Undefined subroutine &main::doit called at -e line 1. > > > > $ perl -E 'use Lib qw(doit); doit()' > > > > Do it! > > > > $ perl -E 'use Lib qw(:ALL); doit()' > > > > Do it! > > > > > > > > With Perl6::Export::Attrs-0.0.4 only :ALL works: > > > > > > > > $ perl -E 'use Lib; doit()' > > > > Undefined subroutine &main::doit called at -e line 1. > > > > $ perl -E 'use Lib qw(doit); doit()' > > > > Lib does not export: doit > > > > use Lib failed at -e line 1. > > > > BEGIN failed--compilation aborted at -e line 1. > > > > $ perl -E 'use Lib qw(:ALL); doit()' > > > > Do it!
> > > > > > I can confirm the regression --- App::PodPreview is affected by > > > this > > > problem: > > > > > > $ perl5.20.2 -MApp::PodPreview=podpreview -e1 > > > App::PodPreview does not export: podpreview > > > use App::PodPreview failed at -e line 0. > > > BEGIN failed--compilation aborted. > > > > > > With 0.0.3 this used to work.
> > > > Also affected: PSHANGOV/App-Pmhack-0.002.tar.gz > > Sample fail report: > > http://www.cpantesters.org/cpan/report/115c704a-70df-11e5-b92b- > > d2037053cd79
> > Complete list of affected CPAN distributions: > > - KTAT/Util-Any-0.24.tar.gz > - PETAMEM/Lingua-AFR-Word2Num-0.1106.tar.gz > - PETAMEM/Lingua-DEU-Word2Num-0.1106.tar.gz > - PETAMEM/Lingua-ENG-Word2Num-0.0682.tar.gz > - PETAMEM/Lingua-EUS-Word2Num-0.0682.tar.gz > - PETAMEM/Lingua-POR-Nums2Words-0.0682.tar.gz > - PETAMEM/Lingua-RUS-Number-0.136.tar.gz > - PETAMEM/Lingua-RUS-Word2Num-0.0682.tar.gz > - PETAMEM/Lingua-SWE-Num2Word-0.0682.tar.gz > - PETAMEM/Lingua-ZHO-Word2Num-0.0682.tar.gz > - POWERMAN/CGI-Easy-1.0.1.tar.gz > - POWERMAN/CGI-Easy-URLconf-1.0.1.tar.gz > (https://rt.cpan.org/Ticket/Display.html?id=108288) > - POWERMAN/Inferno-RegMgr-0.1.7.tar.gz > - POWERMAN/Sub-Throttler-v0.2.3.tar.gz > - POWERMAN/Text-MiniTmpl-1.1.6.tar.gz > - PSHANGOV/App-Pmhack-0.002.tar.gz > - PSHANGOV/Dist-Zilla-App-Command-podpreview-0.004.tar.gz > (https://rt.cpan.org/Ticket/Display.html?id=110342) > - STEFFENW/Hash-Map-0.014.tar.gz > - STEFFENW/HTML-Template-Compiled-Filter-Whitespace-0.08.tar.gz > - TAKERU/Atompub-0.3.7.tar.gz > (https://rt.cpan.org/Ticket/Display.html?id=108287) > - TAKERU/Google-Data-JSON-v0.1.10.tar.gz
Another one: - INFINOID/AI-Evolve-Befunge-0.03.tar.gz
On 2016-09-06 15:39:43, SREZIC wrote: Show quoted text
> On 2016-01-22 02:26:47, SREZIC wrote:
> > On 2015-10-31 07:57:54, SREZIC wrote:
> > > On 2015-10-31 07:29:21, SREZIC wrote:
> > > > On 2015-10-08 10:49:42, POWERMAN wrote:
> > > > > $ cat Lib.pm > > > > > package Lib; > > > > > use 5.010001; > > > > > use warnings; > > > > > use strict; > > > > > use utf8; > > > > > use Perl6::Export::Attrs; > > > > > > > > > > sub doit :Export { > > > > > print "Do it!\n"; > > > > > } > > > > > > > > > > 1; > > > > > > > > > > With Perl6::Export::Attrs-0.0.3 everything works as expected: > > > > > > > > > > $ perl -E 'use Lib; doit()' > > > > > Undefined subroutine &main::doit called at -e line 1. > > > > > $ perl -E 'use Lib qw(doit); doit()' > > > > > Do it! > > > > > $ perl -E 'use Lib qw(:ALL); doit()' > > > > > Do it! > > > > > > > > > > With Perl6::Export::Attrs-0.0.4 only :ALL works: > > > > > > > > > > $ perl -E 'use Lib; doit()' > > > > > Undefined subroutine &main::doit called at -e line 1. > > > > > $ perl -E 'use Lib qw(doit); doit()' > > > > > Lib does not export: doit > > > > > use Lib failed at -e line 1. > > > > > BEGIN failed--compilation aborted at -e line 1. > > > > > $ perl -E 'use Lib qw(:ALL); doit()' > > > > > Do it!
> > > > > > > > I can confirm the regression --- App::PodPreview is affected by > > > > this > > > > problem: > > > > > > > > $ perl5.20.2 -MApp::PodPreview=podpreview -e1 > > > > App::PodPreview does not export: podpreview > > > > use App::PodPreview failed at -e line 0. > > > > BEGIN failed--compilation aborted. > > > > > > > > With 0.0.3 this used to work.
> > > > > > Also affected: PSHANGOV/App-Pmhack-0.002.tar.gz > > > Sample fail report: > > > http://www.cpantesters.org/cpan/report/115c704a-70df-11e5-b92b- > > > d2037053cd79
> > > > Complete list of affected CPAN distributions: > > > > - KTAT/Util-Any-0.24.tar.gz > > - PETAMEM/Lingua-AFR-Word2Num-0.1106.tar.gz > > - PETAMEM/Lingua-DEU-Word2Num-0.1106.tar.gz > > - PETAMEM/Lingua-ENG-Word2Num-0.0682.tar.gz > > - PETAMEM/Lingua-EUS-Word2Num-0.0682.tar.gz > > - PETAMEM/Lingua-POR-Nums2Words-0.0682.tar.gz > > - PETAMEM/Lingua-RUS-Number-0.136.tar.gz > > - PETAMEM/Lingua-RUS-Word2Num-0.0682.tar.gz > > - PETAMEM/Lingua-SWE-Num2Word-0.0682.tar.gz > > - PETAMEM/Lingua-ZHO-Word2Num-0.0682.tar.gz > > - POWERMAN/CGI-Easy-1.0.1.tar.gz > > - POWERMAN/CGI-Easy-URLconf-1.0.1.tar.gz > > (https://rt.cpan.org/Ticket/Display.html?id=108288) > > - POWERMAN/Inferno-RegMgr-0.1.7.tar.gz > > - POWERMAN/Sub-Throttler-v0.2.3.tar.gz > > - POWERMAN/Text-MiniTmpl-1.1.6.tar.gz > > - PSHANGOV/App-Pmhack-0.002.tar.gz > > - PSHANGOV/Dist-Zilla-App-Command-podpreview-0.004.tar.gz > > (https://rt.cpan.org/Ticket/Display.html?id=110342) > > - STEFFENW/Hash-Map-0.014.tar.gz > > - STEFFENW/HTML-Template-Compiled-Filter-Whitespace-0.08.tar.gz > > - TAKERU/Atompub-0.3.7.tar.gz > > (https://rt.cpan.org/Ticket/Display.html?id=108287) > > - TAKERU/Google-Data-JSON-v0.1.10.tar.gz
> > Another one: > > - INFINOID/AI-Evolve-Befunge-0.03.tar.gz
What's the state of this issue?
Subject: Re: [rt.cpan.org #107627] regression: can't import functions by name
Date: Sat, 17 Feb 2018 11:06:28 +1100
To: bug-Perl6-Export-Attrs [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Apologies to everyone who was kind enough to contribute to this report. I have just uploaded a new release with Niko's patch applied. Damian