]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - silence mojo warning
authorDylan William Hardison <dylan@hardison.net>
Tue, 16 Oct 2018 21:33:04 +0000 (17:33 -0400)
committerGitHub <noreply@github.com>
Tue, 16 Oct 2018 21:33:04 +0000 (17:33 -0400)
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.

Dockerfile
patches/Mojo-IOLoop-Stream.pm.patch [new file with mode: 0644]

index 18c1af20e878fd352e7abb9cc242d94ba602ef55..fe58ed7fbfa85b64d831a828a20351482e513efc 100644 (file)
@@ -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 (file)
index 0000000..bffe4db
--- /dev/null
@@ -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};