Last Comment Bug 652047 - checksetup.pl --check-modules fails to compile/run if the Voting extension is enabled on a fresh install
: checksetup.pl --check-modules fails to compile/run if the Voting extension is...
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Extensions (show other bugs)
: 4.0
: All All
: -- normal (vote)
: Bugzilla 4.2
Assigned To: Frédéric Buclin
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-21 22:20 PDT by Dave Miller [:justdave] (justdave@bugzilla.org)
Modified: 2012-10-08 04:06 PDT (History)
4 users (show)
LpSolit: approval+
LpSolit: approval4.4+
LpSolit: blocking4.4+
LpSolit: approval4.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch, v1 (698 bytes, patch)
2012-10-07 11:55 PDT, Frédéric Buclin
glob: review-
Details | Diff | Splinter Review
patch for 4.2, v1 (1.10 KB, patch)
2012-10-07 12:00 PDT, Frédéric Buclin
no flags Details | Diff | Splinter Review
patch, v2 (1.08 KB, patch)
2012-10-08 03:42 PDT, Frédéric Buclin
glob: review+
Details | Diff | Splinter Review
patch for 4.2, v2 (1.50 KB, patch)
2012-10-08 03:44 PDT, Frédéric Buclin
glob: review+
Details | Diff | Splinter Review

Description Dave Miller [:justdave] (justdave@bugzilla.org) 2011-04-21 22:20:58 PDT
[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.
Comment 1 Max Kanat-Alexander 2011-04-22 10:52:02 PDT
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.
Comment 2 Dave Miller [:justdave] (justdave@bugzilla.org) 2011-04-22 11:02:21 PDT
I don't see a Config.pm in that module.  Maybe that's the problem.
Comment 3 Max Kanat-Alexander 2011-04-23 03:02:38 PDT
Ah, that would be the problem indeed. I should probably change the system to make that mandatory.
Comment 4 Alex Eiser 2012-02-22 14:24:44 PST
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.
Comment 5 Dave Miller [:justdave] (justdave@bugzilla.org) 2012-02-24 17:58:17 PST
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.
Comment 6 Alex Eiser 2012-02-24 18:22:35 PST
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.
Comment 7 Dave Miller [:justdave] (justdave@bugzilla.org) 2012-10-07 10:53:36 PDT
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.
Comment 8 Dave Miller [:justdave] (justdave@bugzilla.org) 2012-10-07 10:54:33 PDT
FYI I did try running it before enabling Voting, and it does work fine as long as Voting isn't enabled.
Comment 9 Frédéric Buclin 2012-10-07 11:44:46 PDT
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.
Comment 10 Frédéric Buclin 2012-10-07 11:55:20 PDT
Created attachment 668940 [details] [diff] [review]
patch, v1

Add the missing Config.pm file into Voting/. This is the single extension to lack this file.
Comment 11 Frédéric Buclin 2012-10-07 12:00:48 PDT
Created attachment 668941 [details] [diff] [review]
patch for 4.2, v1

4.2 still uses the MPL 1.1 license.
Comment 12 Byron Jones ‹:glob› 2012-10-08 00:06:20 PDT
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
Comment 13 Frédéric Buclin 2012-10-08 03:42:34 PDT
Created attachment 669091 [details] [diff] [review]
patch, v2

Ah thanks, I didn't notice the warning.
Comment 14 Frédéric Buclin 2012-10-08 03:44:26 PDT
Created attachment 669092 [details] [diff] [review]
patch for 4.2, v2
Comment 15 Byron Jones ‹:glob› 2012-10-08 03:46:53 PDT
Comment on attachment 669091 [details] [diff] [review]
patch, v2

r=glob
Comment 16 Byron Jones ‹:glob› 2012-10-08 03:48:47 PDT
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.
Comment 17 Frédéric Buclin 2012-10-08 03:54:21 PDT
(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.
Comment 18 Frédéric Buclin 2012-10-08 04:06:11 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.