summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-25 23:02:30 +0200
committerdklawren <dklawren@users.noreply.github.com>2018-04-25 23:02:30 +0200
commit132700438a4d409a7c9f76be7cfed4d18130a4dd (patch)
treed96ce2f43137a105e3b9fdca2cc0fc2c01cae9f2
parent993e754afdf6a94e128633be7261e27cfc384f2c (diff)
downloadbugzilla-132700438a4d409a7c9f76be7cfed4d18130a4dd.tar.gz
bugzilla-132700438a4d409a7c9f76be7cfed4d18130a4dd.tar.xz
Bug 1441732 - Improve missing module error in Bugzilla::Extensions and catch more compile errors in tests
-rw-r--r--.circleci/config.yml3
-rw-r--r--Bugzilla.pm2
-rw-r--r--Bugzilla/Extension.pm6
-rw-r--r--Dockerfile1
4 files changed, 10 insertions, 2 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 64e6c5831..5ca2de73b 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -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
diff --git a/Bugzilla.pm b/Bugzilla.pm
index bc3ceb58c..36711f4ea 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -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();
diff --git a/Bugzilla/Extension.pm b/Bugzilla/Extension.pm
index a41ac9326..8e173c711 100644
--- a/Bugzilla/Extension.pm
+++ b/Bugzilla/Extension.pm
@@ -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 ) {
diff --git a/Dockerfile b/Dockerfile
index 0e7bb7acd..78152531c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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