From: Dylan William Hardison Date: Tue, 16 Oct 2018 21:33:04 +0000 (-0400) Subject: no bug - silence mojo warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ecb01cf58ae072f48f9ce81e0fdf85b5b9ebd48;p=thirdparty%2Fbugzilla.git no bug - silence mojo warning In perl 5.12, length(undef) was made no longer a warning. In order to reduce memory usage, mojo undefines the outgoing buffer. This means on perl <= 5.12, a warning is printed frequently (multiple times per request). Mojo support for 5.10 is waning, so for the moment we patch that code to silence this warning. --- diff --git a/Dockerfile b/Dockerfile index 18c1af20e..fe58ed7fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,10 @@ 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/bin/perl + setcap 'cap_net_bind_service=+ep' /usr/bin/perl && \ + for file in patches/*.patch; do \ + patch -p0 < $file; \ + done USER app diff --git a/patches/Mojo-IOLoop-Stream.pm.patch b/patches/Mojo-IOLoop-Stream.pm.patch new file mode 100644 index 000000000..bffe4db1f --- /dev/null +++ b/patches/Mojo-IOLoop-Stream.pm.patch @@ -0,0 +1,18 @@ +--- /app/local/lib/perl5/Mojo/IOLoop/Stream.pm 2018-09-09 17:42:26.000000000 +0000 ++++ /app/local/lib/perl5/Mojo/IOLoop/Stream.pm.new 2018-10-16 20:10:06.620747000 +0000 +@@ -34,6 +34,7 @@ + sub is_writing { + my $self = shift; + return undef unless $self->{handle}; ++ no warnings 'uninitialized'; + return !!length($self->{buffer}) || $self->has_subscribers('drain'); + } + +@@ -112,6 +113,7 @@ + + sub _write { + my $self = shift; ++ no warnings 'uninitialized'; + + # Handle errors only when reading (to avoid timing problems) + my $handle = $self->{handle};