Closed Bug 652047 Opened 14 years ago Closed 12 years ago

checksetup.pl --check-modules fails to compile/run if the Voting extension is enabled on a fresh install

Categories

(Bugzilla :: Extensions, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: justdave, Assigned: LpSolit)

Details

Attachments

(2 files, 2 obsolete files)

[root@ip-admin02 bugzilla.mozilla.org]# ./checksetup.pl --check-modules Can't locate Date/Parse.pm in @INC (@INC contains: . lib /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8) at Bugzilla/Util.pm line 52. BEGIN failed--compilation aborted at Bugzilla/Util.pm line 52. Compilation failed in require at Bugzilla/Error.pm line 33. BEGIN failed--compilation aborted at Bugzilla/Error.pm line 33. Compilation failed in require at Bugzilla/Extension.pm line 26. BEGIN failed--compilation aborted at Bugzilla/Extension.pm line 26. Compilation failed in require at (eval 13) line 3. ...propagated at /usr/lib/perl5/5.8.8/base.pm line 85. BEGIN failed--compilation aborted at ./extensions/Voting/Extension.pm line 29. Compilation failed in require at Bugzilla/Install/Util.pm line 179.
Oh interesting. Good to know. I suppose it's easy to work around. I wonder if we should just say that people can't enable extensions until after that point. Although realistically, it shouldn't be failing at that point, because only the module's Config.pm should be being loaded. So we'll have to investigate what's wrong, there.
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → Bugzilla 4.0
I don't see a Config.pm in that module. Maybe that's the problem.
Ah, that would be the problem indeed. I should probably change the system to make that mandatory.
I just hit this problem, on our local builds... and felt I should document the research I did to figure out what was causing it. The root cause, is the use Bugzilla; line. If you include that line in config.pm for example, this error will come back. The problem is that when use Bugzilla is called, it triggers the if ($INC{'Bugzilla.pm'}) { return Bugzilla->extensions; } line in Bugzilla/Install/Util.pm, which is not supposed to be called at all during check setup. Changing if ($INC{'Bugzilla.pm'}) , to a different method of ensuring your in the requirements phase would also solve this issue.
Shouldn't that be if (exists $INC{'Bugzilla.pm'}) { ? Without the 'exists' it creates it in the process of seeing whether it's there or not.
hmm.. Thats definitely true if looking up a hash reference... not sure in this case. Although, it does not use exist in 3.6-4.2.
Target Milestone: Bugzilla 4.0 → Bugzilla 4.2
Flags: blocking4.4+
I can still reproduce this on trunk, but I get a different traceback now than I did back then. Justdaves-MacBook-Pro:bugzilla dave$ rm extensions/Voting/disabled Justdaves-MacBook-Pro:bugzilla dave$ ./checksetup.pl --check-modules Can't locate Math/Random/ISAAC.pm in @INC (@INC contains: . lib /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12) at Bugzilla/RNG.pm line 16. BEGIN failed--compilation aborted at Bugzilla/RNG.pm line 16. Compilation failed in require at Bugzilla/Util.pm line 28. BEGIN failed--compilation aborted at Bugzilla/Util.pm line 28. Compilation failed in require at Bugzilla/FlagType.pm line 39. BEGIN failed--compilation aborted at Bugzilla/FlagType.pm line 39. Compilation failed in require at Bugzilla/Flag.pm line 44. BEGIN failed--compilation aborted at Bugzilla/Flag.pm line 44. Compilation failed in require at Bugzilla/Attachment.pm line 40. BEGIN failed--compilation aborted at Bugzilla/Attachment.pm line 40. Compilation failed in require at Bugzilla/Bug.pm line 13. BEGIN failed--compilation aborted at Bugzilla/Bug.pm line 13. Compilation failed in require at ./extensions/Voting/Extension.pm line 12. BEGIN failed--compilation aborted at ./extensions/Voting/Extension.pm line 12. Compilation failed in require at Bugzilla/Install/Util.pm line 175.
FYI I did try running it before enabling Voting, and it does work fine as long as Voting isn't enabled.
AFAICT, this mess is due to bug 530994 and bug 530767 (support CPAN modules as Bugzilla extensions), because extensions/Voting/Extension.pm is require()'ed, and as there is a missing dependency, it crashes: sub extension_requirement_packages { my ($file_sets, $extra_packages) = extension_code_files('requirements only'); foreach my $file_set (@$file_sets) { my $file = shift @$file_set; my $name = require $file; # The culprit! Comment 4 and comment 5 have nothing to do with this bug. Bugzilla->extensions isn't called at that point.
Attached patch patch, v1 (obsolete) — Splinter Review
Add the missing Config.pm file into Voting/. This is the single extension to lack this file.
Assignee: extensions → LpSolit
Status: NEW → ASSIGNED
Attachment #668940 - Flags: review?(justdave)
Attachment #668940 - Flags: review?(glob)
Attached patch patch for 4.2, v1 (obsolete) — Splinter Review
4.2 still uses the MPL 1.1 license.
Attachment #668941 - Flags: review?(justdave)
Comment on attachment 668940 [details] [diff] [review] patch, v1 you need to remove the NAME definition from Extension.pm: Constant subroutine Bugzilla::Extension::Voting::NAME redefined
Attachment #668940 - Flags: review?(justdave)
Attachment #668940 - Flags: review?(glob)
Attachment #668940 - Flags: review-
Attached patch patch, v2Splinter Review
Ah thanks, I didn't notice the warning.
Attachment #668940 - Attachment is obsolete: true
Attachment #668941 - Attachment is obsolete: true
Attachment #668941 - Flags: review?(justdave)
Attachment #669091 - Flags: review?(glob)
Attachment #669092 - Flags: review?(glob)
Comment on attachment 669091 [details] [diff] [review] patch, v2 r=glob
Attachment #669091 - Flags: review?(glob) → review+
Comment on attachment 669092 [details] [diff] [review] patch for 4.2, v2 r=glob although i'd prefer to see REQUIRED_MODULES and OPTIONAL_MODULES defined to match our sample config.pm.
Attachment #669092 - Flags: review?(glob) → review+
(In reply to Byron Jones ‹:glob› from comment #16) > although i'd prefer to see REQUIRED_MODULES and OPTIONAL_MODULES defined to > match our sample config.pm. I simply copied OldBugMove/Config.pm into Voting/ and didn't check that. I can add them if you want.
Flags: approval4.4+
Flags: approval4.2+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ added extensions/Voting/Config.pm modified extensions/Voting/Extension.pm Committed revision 8416. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/ added extensions/Voting/Config.pm modified extensions/Voting/Extension.pm Committed revision 8410. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/ added extensions/Voting/Config.pm modified extensions/Voting/Extension.pm Committed revision 8146.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: