Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the ExtUtils-ParseXS CPAN distribution.

Report information
The Basics
Id: 74850
Status: open
Priority: 0/
Queue: ExtUtils-ParseXS

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

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



Subject: port EU:PXS to perl 5.6
Date: Fri, 10 Feb 2012 12:06:37 +0000
To: bug-ExtUtils-ParseXS [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
With only very small changes, ExtUtils::ParseXS can be made to work fine on older Perls back to 5.6.1. Attached patch implements. This patch is against the CPAN distribution. I see that EU:PXS is dual-life and nominally upstream=blead, but blead is actually behind CPAN (3.14 vs 3.15). That's why I'm submitting the patch to rt.cpan.org, rather than just applying it to blead. Also note that the patch includes a hunk for the CPAN Makefile.PL, which doesn't exist in blead. -zefram

Message body is not shown because sender requested not to inline it.

Sounds fine to me, but I can't promise anyone will maintain 5.6 compatibility diligently. I'd like to see a couple changes in the capture stuff: 1) when opening the temp file, open in read/write mode, just seek(0) to read it back in. Then you don't need the filename either. 2) rather than having 2 separate sets of functions for that stuff, merge them together and put the version checks right in the functions. The differences should be pretty small when 1) is implemented. Thanks, -Ken
Subject: Re: [rt.cpan.org #74850] port EU:PXS to perl 5.6
Date: Fri, 10 Feb 2012 14:39:33 +0000
To: Ken Williams via RT <bug-ExtUtils-ParseXS [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
Ken Williams via RT wrote: Show quoted text
>Sounds fine to me, but I can't promise anyone will maintain 5.6 >compatibility diligently.
Of course. But even if 5.6 compat is lost again, at least we'll have a reasonably modern EU:PXS available there. Show quoted text
> 1) when opening the temp file, open in read/write mode, just seek(0) >to read it back in.
Can do. Will send revised patch soon. Show quoted text
> 2) rather than having 2 separate sets of functions for that stuff, >merge them together
I really think they won't share enough code for that to be sensible. Implementing the temp file seeking won't change it much. The dominant feature is the saving and restoring of the original handle, for which the clean way (with handle saved in a lexical variable) doesn't work on 5.6. It would only be worth sharing code if you accepted the 5.6 mode of saving and restoring for all Perls. -zefram
Subject: Re: [rt.cpan.org #74850] port EU:PXS to perl 5.6
Date: Fri, 10 Feb 2012 15:27:34 +0000
To: Ken Williams via RT <bug-ExtUtils-ParseXS [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
I wrote: Show quoted text
>Ken Williams via RT wrote:
>> 1) when opening the temp file, open in read/write mode, just seek(0) >>to read it back in.
> >Can do. Will send revised patch soon.
Actually, this doesn't fit nicely. Since STDOUT needs to point to the temp file, I can't rely on File::Temp opening the file, to avoid handling the filename: I have to explicitly "open STDOUT" on the file. I could conceivably open it read/write, and then do the seek and read on the STDOUT handle, but that puts STDOUT in a strange state and doesn't seem like it wins anything. So I'm not enclosing a patch for this. Please have another think about what you want for the capture code. -zefram
A read/write filehandle can be generated like so: sub rwfh { my $fh; if($] >= 5.008000) { open my $fh, "+>", \(my $tmp) } else { $fh=tempfile(); } return $fh; } And then regardless of perl version, dupe it: open(STDOUT, '+>&', $fh) Not sure what you mean about "puts STDOUT in a strange state". I understand that STDOUT isn't typically read/write, but that shouldn't really matter, especially as it's restored afterwards.
Subject: Re: [rt.cpan.org #74850] port EU:PXS to perl 5.6
Date: Sat, 11 Feb 2012 08:15:44 +0000
To: Ken Williams via RT <bug-ExtUtils-ParseXS [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
Ken Williams via RT wrote: Show quoted text
>And then regardless of perl version, dupe it: > > open(STDOUT, '+>&', $fh)
That doesn't work on 5.6. The inability to use that formulation to restore the old stdout is why I introduced the glob gubbins. -zefram
Subject: Re: [rt.cpan.org #74850] port EU:PXS to perl 5.6
Date: Sat, 11 Feb 2012 09:37:20 +0000
To: Ken Williams via RT <bug-ExtUtils-ParseXS [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
I wrote: Show quoted text
>dual-life and nominally upstream=blead, but blead is actually behind CPAN >(3.14 vs 3.15). That's why I'm submitting the patch to rt.cpan.org, >rather than just applying it to blead.
I've now updated blead to match CPAN, and applied my patch (except for the Makefile.PL hunk, of course) on blead. -zefram