]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1441732 - Improve missing module error in Bugzilla::Extensions and catch more...
authorDylan William Hardison <dylan@hardison.net>
Wed, 25 Apr 2018 21:02:30 +0000 (17:02 -0400)
committerdklawren <dklawren@users.noreply.github.com>
Wed, 25 Apr 2018 21:02:30 +0000 (17:02 -0400)
.circleci/config.yml
Bugzilla.pm
Bugzilla/Extension.pm
Dockerfile

index 64e6c583134ed4c530952a6b970f51288c758487..5ca2de73b730184963e213e8b77291038156f1f6 100644 (file)
@@ -180,8 +180,9 @@ jobs:
           [[ -f build_info/only_version_changed.txt ]] && exit 0
           mv /opt/bmo/local /app/local
           mkdir artifacts
+      - run: perl -I/app -I/app/local/lib/perl5 -c -E 'use Bugzilla; BEGIN { Bugzilla->extensions }'
       - run: |
-          [[ -f build_info/only_version_changed.txt ]] && exit 0
+          [[ -f build_info/only_version_changed.txt ]] && exit 0   
           perl Makefile.PL
       - run:
           name: run sanity tests
index bc3ceb58c7b94b23c406eec415efaa6046be771b..36711f4eaa2e3f4703d7811b96c95868b7791693 100644 (file)
@@ -870,6 +870,8 @@ sub check_rate_limit {
 # Per-process cleanup. Note that this is a plain subroutine, not a method,
 # so we don't have $class available.
 sub _cleanup {
+    return if $^C;
+
     # BMO - finalise and report on metrics
     if (Bugzilla->metrics_enabled) {
         Bugzilla->metrics->finish();
index a41ac9326ca015d3eab8afc32a3ad58a04f8fecb..8e173c711b8f88d16cb914c510bf56ea7954a79b 100644 (file)
@@ -35,7 +35,11 @@ sub INC_HOOK {
         my $first = 1;
         untaint($real_file);
         $INC{$fake_file} = $real_file;
-        open my $fh, '<', $real_file or die "invalid file: $real_file";
+        my $found = open my $fh, '<', $real_file;
+        unless ($found) {
+            require Carp;
+            Carp::croak "Can't locate $fake_file while looking for $real_file in \@INC (\@INC contains: @INC)";
+        }
         return sub {
             no warnings;
             if ( !$first ) {
index 0e7bb7acd9aaabf775133c2a02417fa79cb25cd4..78152531c7286e4cf5b68655435ad83a900769f2 100644 (file)
@@ -26,6 +26,7 @@ COPY . .
 
 RUN mv /opt/bmo/local /app && \
     chown -R app:app /app && \
+    perl -I/app -I/app/local/lib/perl5 -c -E 'use Bugzilla; BEGIN { Bugzilla->extensions }' && \
     perl -c /app/scripts/entrypoint.pl && \
     setcap 'cap_net_bind_service=+ep' /usr/sbin/httpd