require vs. use: Perl compilation errors in Storage modules
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Low
|
Unassigned | ||
3.1 |
Fix Released
|
Low
|
Unassigned | ||
3.2 |
Fix Released
|
Low
|
Unassigned | ||
3.4 |
Fix Released
|
Low
|
Unassigned | ||
3.5 |
Fix Released
|
Low
|
Unassigned |
Bug Description
Evergreen Version: master (all current releases affected)
OpenSRF Version: irrelevant
PostgreSQL Version: irrelevant
Linux Distribution: All currently supported distributions, plus Debian Buster
Perl Versions: 5.20.2 (Debian Jessie), 5.22.1 (Ubuntu Xenial), 5.24.1 (Debian Stretch), 5.26.1 (Ubuntu Xenial), 5.28.1 (Debian Buster)
While testing Ben's branches for bug 1835458, I decided to check all of the Perl modules for errors. I ran the following commands to do this:
find /usr/local/
find /usr/local/
Ignoring all of the "subroutine redefined" warnings caused by our circular references in both command outputs, the second command turned up the following errors:
Can't locate object method "has_a" via package "actor::user" (perhaps you forgot to load "actor::user"?) at /usr/local/
Compilation failed in require at /usr/share/
...propagated at /usr/share/
BEGIN failed--compilation aborted at /usr/local/
Compilation failed in require at /usr/local/
BEGIN failed--compilation aborted at /usr/local/
Can't locate object method "register_method" via package "OpenILS:
Compilation failed in require at /usr/local/
BEGIN failed--compilation aborted at /usr/local/
I then ran the same two commands, modulo the Perl version, on all of the currently supported distributions: Ubuntu Xenial and Bionic, Debian Jessie and Stretch. They all turned up more or less the same errors.
These errors appear to happen mainly with perl -c. It seems like they should, but do not, prevent the open-ils.storage service frome starting.
Without getting into a lot of detail, it looks like we should "require" instead of "use" certain modules used by the two modules that have errors. I have already made a branch that does this, but I want to do more testing and to add Perl tests for the open-ils.storage module before sharing it.
description: | updated |
Changed in evergreen: | |
importance: | Undecided → Low |
status: | New → Won't Fix |
status: | Won't Fix → Confirmed |
milestone: | 3.4-beta1 → 3.3.3 |
no longer affects: | evergreen/3.3 |
Changed in evergreen: | |
assignee: | nobody → Galen Charlton (gmc) |
Changed in evergreen: | |
milestone: | 3.3.3 → 3.3.4 |
Changed in evergreen: | |
milestone: | 3.3.4 → 3.3.5 |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Branch is working/ user/dyrcona/ lp1835620- require- not-use: /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ dyrcona/ lp1835620- require- not-use
https:/
It switches the submodules from being used to being required, adds comments in the code to give a partial explanation why, and updates the storage driver tests to test all the submodules.
All Perl tests pass, and I ran a good number of storage methods and everything seems to work.
We should probably add some storage live tests at some point.