Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the GCCJIT CPAN distribution.

Report information
The Basics
Id: 112655
Status: resolved
Priority: 0/
Queue: GCCJIT

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

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



Subject: Perl minimum version too high?
The minimum perl version is set to 5.20.2, see: * https://metacpan.org/source/VYF/GCCJIT-0.01/lib/GCCJIT.pm#L3 * https://metacpan.org/source/VYF/GCCJIT-0.01/Makefile.PL#L1 To me this seems to be the result of autogenerated files and is not a real requirement. If so, can you remove these use statements? Otherwise it would be good to put a short comment why this perl version is required, e.g. "use 5.020002; # subroutine signature" or so.
It is, in fact, auto-generated. But it is also the minimum Perl version I have tested it on, and since perlmodstyle suggests that distributions should specify minimum Perl version I kept it as is. That said, I am all for making that more accurate. If you could confirm that the module also works on an earlier version I would be more than happy to adjust the requirement or apply the patch. On Thu Mar 03 02:00:00 2016, SREZIC wrote: Show quoted text
> The minimum perl version is set to 5.20.2, see: > * https://metacpan.org/source/VYF/GCCJIT-0.01/lib/GCCJIT.pm#L3 > * https://metacpan.org/source/VYF/GCCJIT-0.01/Makefile.PL#L1 > > To me this seems to be the result of autogenerated files and is not a > real requirement. If so, can you remove these use statements? > Otherwise it would be good to put a short comment why this perl > version is required, e.g. "use 5.020002; # subroutine signature" or > so.
On 2016-03-07 11:56:49, VYF wrote: Show quoted text
> It is, in fact, auto-generated. But it is also the minimum Perl > version I have tested it on, and since perlmodstyle suggests that > distributions should specify minimum Perl version I kept it as is.
Putting wrong minimum perl version requirements is actually worse than specifying no minimum version. If you don't know what's the minimum version then the correct way is to put the distribution on CPAN (maybe as a non-stable release) and to let CPAN Testers smoke the module. If there's a minimum perl version already specified, then CPAN Testers would not test the distribution for older perls at all. Unfortunately, your case is somewhat more difficult, as few CPAN Testers have libgccjit installed. So CPAN Testers is currently full of "UNKNOWN" reports. Still my point is still valid. Show quoted text
> That said, I am all for making that more accurate. If you could > confirm that the module also works on an earlier version I would be > more than happy to adjust the requirement or apply the patch.
See the attached patch. The only trick is to replace av_top_index (introduced in 5.17.9) by av_len. I tried this successfully with perl 5.10.1 (at least "make test" passes), but I think it should also work with perl 5.8.x. So still I think there should be no minimum perl version specification --- let CPAN Testers do the work. Regards, Slaven Show quoted text
> > On Thu Mar 03 02:00:00 2016, SREZIC wrote:
> > The minimum perl version is set to 5.20.2, see: > > * https://metacpan.org/source/VYF/GCCJIT-0.01/lib/GCCJIT.pm#L3 > > * https://metacpan.org/source/VYF/GCCJIT-0.01/Makefile.PL#L1 > > > > To me this seems to be the result of autogenerated files and is not a > > real requirement. If so, can you remove these use statements? > > Otherwise it would be good to put a short comment why this perl > > version is required, e.g. "use 5.020002; # subroutine signature" or > > so.
Subject: 0001-compatibility-for-older-perls.patch
From 6ddfdc3244009ca0e0d0b09c20fcf78b4aa4779f Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Wed, 9 Mar 2016 08:44:29 +0100 Subject: [PATCH] compatibility for older perls * replace av_top_index by av_len (the former is only defined in perl 5.17.9 and later) * remove minimum perl specifications (5.10.1 is fine, and most probably older perls, too) --- Makefile.PL | 1 - av_to_pp.h | 4 ++-- lib/GCCJIT.pm | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index f6debc0..f60c980 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,4 +1,3 @@ -use 5.020002; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. diff --git a/av_to_pp.h b/av_to_pp.h index ccb5ff9..d2d82a0 100644 --- a/av_to_pp.h +++ b/av_to_pp.h @@ -1,7 +1,7 @@ void **av_to_pp(pTHX_ AV* av, char *ctx, char *avname, char *typename) { void **ptr; - SSize_t idx, size = av_top_index(av) + 1; + SSize_t idx, size = av_len(av) + 1; if (size == 0) return NULL; @@ -25,7 +25,7 @@ void **av_to_pp(pTHX_ AV* av, char *ctx, char *avname, char *typename) int num_##av; #define AVPP_CODE(av, ctx, type, typename) { \ - num_##av = av_top_index(av) + 1; \ + num_##av = av_len(av) + 1; \ ptr_##av = (type*) av_to_pp(aTHX_ av, ctx, #av, typename); \ } diff --git a/lib/GCCJIT.pm b/lib/GCCJIT.pm index be91b4d..56cd068 100644 --- a/lib/GCCJIT.pm +++ b/lib/GCCJIT.pm @@ -1,6 +1,5 @@ package GCCJIT; -use 5.020002; use strict; use warnings; use Carp; -- 2.6.4
On Thu Mar 10 14:18:59 2016, SREZIC wrote: Show quoted text
> See the attached patch. The only trick is to replace av_top_index > (introduced in 5.17.9) by av_len. I tried this successfully with perl > 5.10.1 (at least "make test" passes), but I think it should also work > with perl 5.8.x. So still I think there should be no minimum perl > version specification --- let CPAN Testers do the work.
I applied your patch and uploaded v0.02 to CPAN. Thanks a lot!