The default bug view has changed. See this FAQ.

Bugzilla/Template.pm fails on perl 5.9.5

RESOLVED FIXED in Bugzilla 2.22

Status

()

Bugzilla
Bugzilla-General
--
major
RESOLVED FIXED
10 years ago
7 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

Bugzilla 2.22
Bug Flags:
approval +
approval3.0 +
approval2.22 +

Details

(Whiteboard: [relnote for 2.22.6])

Attachments

(2 attachments)

(Assignee)

Description

10 years ago
Created attachment 274754 [details] [diff] [review]
v1 (3.0)

Perl 5.9.5 is supposed to be the last development version of Perl before 5.10.0 is released, so we should get ready to support it. I have a testing installation of it, and I've discovered that the only thing that prevents checksetup.pl from completing is this error:

Not a subroutine reference at Bugzilla/Template.pm line 66.

And that line is:

if (defined &{$Bugzilla::Constants::{$constant}}) {

Apparently, the way we do that, perl 5.9.5 doesn't like. There's a better way to write that anyhow, so I've attached a patch that fixes it.

This code exists all the way back to 2.20, but I don't think we have to support any version of Bugzilla older than 3.0 on perl 5.10.
Attachment #274754 - Flags: review?(LpSolit)

Comment 1

10 years ago
Comment on attachment 274754 [details] [diff] [review]
v1 (3.0)

>Index: Bugzilla/Template.pm
>===================================================================
>RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v
>retrieving revision 1.73
>diff -u -r1.73 Template.pm
>--- Bugzilla/Template.pm	4 Jul 2007 22:56:09 -0000	1.73
>+++ Bugzilla/Template.pm	1 Aug 2007 11:12:04 -0000
>@@ -63,7 +63,7 @@
>     foreach my $constant (@Bugzilla::Constants::EXPORT,
>                           @Bugzilla::Constants::EXPORT_OK)
>     {
>-        if (defined &{$Bugzilla::Constants::{$constant}}) {
>+        if (defined Bugzilla::Constants->$constant) {
>             # Constants can be lists, and we can't know whether we're
>             # getting a scalar or a list in advance, since they come to us
>             # as the return value of a function call, so we have to


If Perl 5.9.5 doesn't understand this syntax, why don't you change the $constants{$constant} = [&{$Bugzilla::Constants::{$constant}}]; line too?
(Assignee)

Comment 2

10 years ago
(In reply to comment #1)
> If Perl 5.9.5 doesn't understand this syntax, why don't you change the
> $constants{$constant} = [&{$Bugzilla::Constants::{$constant}}]; line too?

  It doesn't complain about that line. I think it has to do with a change to what's allowed after "defined". But we could change that line also, to be consistent.

Comment 3

10 years ago
This would probably be fine. But I would prefer to see this patch landing *after* the release of 3.0.1, and have it for 3.0.2 which will very likely be released on time for Perl 5.10. I would hate to break something a couple of days before the release.
(Assignee)

Comment 4

10 years ago
(In reply to comment #3)
> This would probably be fine. But I would prefer to see this patch landing
> *after* the release of 3.0.1, and have it for 3.0.2 which will very likely be
> released on time for Perl 5.10. I would hate to break something a couple of
> days before the release.

  Okay. That sounds good to me. That'll also give me more time to check if anything else is broken with perl 5.9.5, and if this is the only thing, then it wouldn't hurt to check it in as far back as 2.20 and 2.22, also.

Comment 5

10 years ago
Created attachment 277218 [details] [diff] [review]
patch, v2 (tip)

Isn't it cleaner this way?
Attachment #277218 - Flags: review?(mkanat)

Comment 6

10 years ago
CC'ing myk who wrote the original patch in bug 280770.
(Assignee)

Comment 7

10 years ago
Comment on attachment 277218 [details] [diff] [review]
patch, v2 (tip)

Yes. Let's use yours on the trunk and mine on the branch.
Attachment #277218 - Flags: review?(mkanat) → review+

Comment 8

10 years ago
Comment on attachment 274754 [details] [diff] [review]
v1 (3.0)

Looks good. r=LpSolit
Attachment #274754 - Flags: review?(LpSolit) → review+

Comment 9

10 years ago
I will let you decide if you want it for 3.0.1 or 3.0.2.
Flags: approval3.0?
Flags: approval+
(Assignee)

Comment 10

10 years ago
Sure, couldn't hurt for 3.0. We'll wait until after release, though.
Flags: approval3.0? → approval3.0+
(Assignee)

Comment 11

10 years ago
tip:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.78; previous revision: 1.77
done

3.0 branch:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.68.2.3; previous revision: 1.68.2.2
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Keywords: relnote
Resolution: --- → FIXED
(Assignee)

Updated

10 years ago
Attachment #274754 - Attachment description: v1 → v1 (3.0)
(Assignee)

Updated

10 years ago
Attachment #277218 - Attachment description: patch, v2 → patch, v2 (tip)

Comment 12

9 years ago
Has been relnoted in 3.0.2.
Keywords: relnote

Updated

9 years ago
Duplicate of this bug: 434199

Comment 14

9 years ago
(In reply to comment #4)
> wouldn't hurt to check it in as far back as 2.20 and 2.22, also.

I'm approving and committing attachment 274754 [details] [diff] [review] on the 2.22 branch too. Since I upgraded my OS, I have Perl 5.10.0 installed and I'm unable to test 2.22.x without this fix. I applied it locally and Bugzilla is now working fine again.

About 2.20, I don't think we need to land it there as it's almost EOL and I doubt we will release 2.20.7 as it has currently no code change compared to 2.20.6.
Flags: approval2.22+
Whiteboard: [relnote for 2.22.6]
Target Milestone: Bugzilla 3.0 → Bugzilla 2.22

Comment 15

9 years ago
2.22.5+:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.41.2.5; previous revision: 1.41.2.4
done

Comment 16

7 years ago
Thanks for this patch.  I still need to maintain a 'tweaked' 3.0.1 instance, and it wasn't working on a newer OS with Perl 5.10.  Patch worked.

I love open source software.
You need to log in before you can comment on or make changes to this bug.