Skip Menu |
 

This queue is for tickets about the namespace-autoclean CPAN distribution.

Report information
The Basics
Id: 110153
Status: open
Priority: 0/
Queue: namespace-autoclean

People
Owner: Nobody in particular
Requestors: OSCHWALD [...] cpan.org
Cc:
AdminCc:

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



Subject: Imported constants are not cleaned up
Download (untitled) / with headers
text/plain 133b
It appears that at least some imported constants are not cleaned up properly. For instance, the attached test fails on 0.28. Greg
Subject: imported-constant.t
Download imported-constant.t
text/x-perl 204b
use strict; use warnings; use Test::More; { package Foo; use Fcntl qw( O_CREAT ); use namespace::autoclean; } ok(!Foo->can('O_CREAT'), 'imported constant is cleaned up'); done_testing;
Download (untitled) / with headers
text/plain 388b
On 2015-12-07 15:28:01, OSCHWALD wrote: Show quoted text
> It appears that at least some imported constants are not cleaned up > properly. > > For instance, the attached test fails on 0.28. > > Greg
I don't think we can fix that particular case, because of this: https://metacpan.org/source/RJBS/perl-5.22.0/ext/Fcntl/Fcntl.pm#L88 You'll have to do: use namespace::autoclean -also => [ 'O_CREAT' ];
Download (untitled) / with headers
text/plain 386b
On 2015-12-07 16:12:43, ETHER wrote: Show quoted text
> On 2015-12-07 15:28:01, OSCHWALD wrote:
> > It appears that at least some imported constants are not cleaned up > > properly. > > > > For instance, the attached test fails on 0.28. > > > > Greg
> > > I don't think we can fix that particular case, because of this:
Er, no, belay that -- I misread the code. I'll look into this further tonight.
Download (untitled) / with headers
text/plain 511b
On 2015-12-07 16:13:34, ETHER wrote: Show quoted text
> On 2015-12-07 16:12:43, ETHER wrote:
> > On 2015-12-07 15:28:01, OSCHWALD wrote:
> > > It appears that at least some imported constants are not cleaned up > > > properly. > > > > > > For instance, the attached test fails on 0.28.
It appears that constants coming from the XS code are treated differently than those defined as perl subs -- as expected, any regular sub defined in Fcntl and exported will be properly detected and cleaned up. This might be an XSLoader bug?
Download (untitled) / with headers
text/plain 413b
Show quoted text
> It appears that constants coming from the XS code are treated > differently than those defined as perl subs -- as expected, any > regular sub defined in Fcntl and exported will be properly detected > and cleaned up. This might be an XSLoader bug?
I agree that this does not occur with regular subs. I do however experience the same issue when using the constant pragma, which does not appear to use XS. Greg
Download (untitled) / with headers
text/plain 402b
constants from either the pragma or XS are not implemented as subs (on perl >= 5.10). The source package is not stored with them. There isn't really anything we can do about this. The only choices are to clean all constants or no constants, and document the behavior. In perl 5.8, we'll end up cleaning constants created using the pragma, since they will show as coming from the 'constant' package.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.