Fix deprecated (now fatal) UNIVERSAL import

Bug #1613326 reported by Blake GH
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SIPServer
Fix Released
Undecided
Unassigned

Bug Description

[edited original bug description -jeff]

SIPServer fails to start on recent versions of Perl due to its use of "use UNIVERSAL qw(can);"

To quote perl5220delta, "Importing functions from UNIVERSAL has been deprecated since v5.12, and is now a fatal error."

To quote the original bug description, "We need to cut that stuff out of the code."

Tags: pullrequest
Blake GH (bmagic)
summary: - SIPServer UNIVERSAL depricated
+ SIPServer UNIVERSAL removed
Revision history for this message
Blake GH (bmagic) wrote : Re: SIPServer UNIVERSAL removed
Revision history for this message
Mike Rylander (mrylander) wrote :

First, UNIVERSAL has not been removed from Perl. As of 5.22*, trying to import methods (that is, implicitly calling UNIVERSAL->import() via the 'use' line) is a fatal error. That means we can't ask for it to push subs into our namespace, but that's fine because we don't use them that way in any case.

I don't see any reason to remove the inclusion of UNIVERSAL::require. We use that to load the ILS module, and it works just fine.

Removing the line

  use UNIVERSAL qw(can);

seems perfectly fine, though. We don't call bare can() anywhere that I can find.

* http://perldoc.perl.org/perl5220delta.html#use-UNIVERSAL-'...'-is-now-a-fatal-error

Revision history for this message
Blake GH (bmagic) wrote :

Aside from the title of this bug, the code in the branch just removes the line suggested.

Revision history for this message
Galen Charlton (gmc) wrote :

Er, the current patch /also/ adjusts the README to remove the reference to UNIVERSAL::require, which still remains a dependency. Could you submit a version of the patch that just removes the "use UNIVERSAL qw(can);" line?

Revision history for this message
Galen Charlton (gmc) wrote :

Also, since this is not an Evergreen bug per se, and since Launchpad has a bug tracker for SIPServer, I'm moving the bug there.

no longer affects: evergreen
Revision history for this message
Blake GH (bmagic) wrote :

Galen,

No problem. I updated the branch in place.

Jeff Godin (jgodin)
summary: - SIPServer UNIVERSAL removed
+ Fix deprecated (now fatal) UNIVERSAL import
description: updated
Revision history for this message
Jeff Godin (jgodin) wrote :

Edited bug title/description to remove some early unclear statements as to the underlying problem.

I'd like to propose a small style change as well, in branch user/jeff/lp1613326_fix_universal_can
http://git.evergreen-ils.org/?p=working/SIPServer.git;a=shortlog;h=refs/heads/user/jeff/lp1613326_fix_universal_can

Thanks for getting the ball rolling on this, Blake!

I think this is ready to merge, but would appreciate some testing/eyes.

tags: added: pullrequest
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Thanks, Blake, Jeff, Mike and Galen!

I have tested Jeff's branch, signed off, and pushed it to master.

I know this is quick turn around but I've been looking at this for the last two days.

Cheers,
Jason

Changed in sipserver:
status: New → Fix Committed
Revision history for this message
Blake GH (bmagic) wrote :

Does this need to be "Fix Released"? and resolved?

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Funny thing about SIPServer: we don't do releases. The answer to Blake's question is Yes or No, depending on your point of view.

I'm leaning toward "No," but I'm not married to that opinion. Seeing as we have 15 bug listed as Fix Released and only 7 Fix Committed, it appears that Fix Released should win.

Changed in sipserver:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.