avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ieme...@apache.org
Subject [avro] branch master updated: AVRO-2238 Update Dockerfile base image from java to openjdk Fix the PHP error due increased json_decode strictness with PHP 5.6
Date Mon, 21 Jan 2019 22:29:11 GMT
This is an automated email from the ASF dual-hosted git repository.

iemejia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 5896f1a  AVRO-2238 Update Dockerfile base image from java to openjdk Fix the PHP
error due increased json_decode strictness with PHP 5.6
5896f1a is described below

commit 5896f1a1bdcbc2f7450b09b1dbbdeb4ad0cb13b6
Author: Fokko Driesprong <fokkodriesprong@godatadriven.com>
AuthorDate: Mon Nov 12 20:35:22 2018 +0100

    AVRO-2238 Update Dockerfile base image from java to openjdk
    Fix the PHP error due increased json_decode strictness
    with PHP 5.6
    
    For more information:
    http://php.net/manual/en/migration56.incompatible.php#migration56.incompatible.json-decode
    
    Changed the import of Perl to first do system imports, and then Avro imports
    
    Updated Build,md with the latest versions which are also used in the CI
    
    Removed the explicit stopping of the Ruby server after the first request,
    because it would throw an error on the Java client
---
 BUILD.md                                            | 11 ++++++-----
 .../src/test/java/org/apache/avro/TestBulkData.java |  4 ++++
 .../main/java/org/apache/avro/tool/RpcSendTool.java |  3 +--
 lang/js/lib/utils.js                                |  2 +-
 lang/perl/t/04_datafile.t                           |  2 +-
 lang/php/test/SchemaTest.php                        |  9 +++++----
 lang/ruby/test/tool.rb                              |  1 -
 share/docker/Dockerfile                             | 21 +++++++++++++--------
 share/test/interop/bin/test_rpc_interop.sh          |  5 +----
 9 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/BUILD.md b/BUILD.md
index 882338a..a70c9c5 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -6,13 +6,14 @@ The following packages must be installed before Avro can be built:
 
  - Java: JDK 1.8, Maven 2 or better, protobuf-compile
  - PHP: php5, phpunit, php5-gmp
- - Python: 2.5 or greater, python-setuptools for dist target
+ - Python 2: 2.7 or greater, python-setuptools for dist target
+ - Python 3: 3.5 or greater
  - C: gcc, cmake, asciidoc, source-highlight
- - C++: cmake 2.8.4 or greater, g++, flex, bison, libboost-dev
+ - C++: cmake 3.7.2 or greater, g++, flex, bison, libboost-dev
  - C#: mono-devel mono-gmcs nunit
- - JavaScript: nodejs, npm
- - Ruby: ruby 1.86 or greater, ruby-dev, gem, rake, echoe, yajl-ruby
- - Perl: perl 5.8.1 or greater, gmake, Module::Install,
+ - JavaScript: Node 6.x+, nodejs, npm
+ - Ruby: Ruby 2.3.3 or greater, ruby-dev, gem, rake, echoe, yajl-ruby
+ - Perl: Perl 5.24.1 or greater, gmake, Module::Install,
    Module::Install::ReadmeFromPod, Module::Install::Repository,
    Math::BigInt, JSON::XS, Try::Tiny, Regexp::Common, Encode,
    IO::String, Object::Tiny, Compress::ZLib, Test::More,
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java b/lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java
index 3ca8ecc..db9220f 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/TestBulkData.java
@@ -51,7 +51,11 @@ public class TestBulkData {
   }
 
   public static class BulkDataImpl implements BulkData {
+
+    @Override
     public ByteBuffer read() { return DATA.duplicate(); }
+
+    @Override
     public void write(ByteBuffer data) {
       Assert.assertEquals(SIZE, data.remaining());
     }
diff --git a/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java b/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java
index 5db620b..c6e1506 100644
--- a/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java
+++ b/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java
@@ -53,8 +53,7 @@ public class RpcSendTool implements Tool {
   }
 
   @Override
-  public int run(InputStream in, PrintStream out, PrintStream err,
-      List<String> args) throws Exception {
+  public int run(InputStream in, PrintStream out, PrintStream err, List<String> args)
throws Exception {
     OptionParser p = new OptionParser();
     OptionSpec<String> file =
       p.accepts("file", "Data file containing request parameters.")
diff --git a/lang/js/lib/utils.js b/lang/js/lib/utils.js
index c453bdd..a2ef016 100644
--- a/lang/js/lib/utils.js
+++ b/lang/js/lib/utils.js
@@ -487,7 +487,7 @@ Tap.prototype.writeBinary = function (str, len) {
   if (this.pos > this.buf.length) {
     return;
   }
-  this.buf.binaryWrite(str, pos, len);
+  this.buf.write(str, pos, len, 'binary');
 };
 
 // Binary comparison methods.
diff --git a/lang/perl/t/04_datafile.t b/lang/perl/t/04_datafile.t
index b7aaba8..2f67f0d 100644
--- a/lang/perl/t/04_datafile.t
+++ b/lang/perl/t/04_datafile.t
@@ -19,11 +19,11 @@
 
 use strict;
 use warnings;
+use File::Temp;
 use Avro::DataFile;
 use Avro::BinaryEncoder;
 use Avro::BinaryDecoder;
 use Avro::Schema;
-use File::Temp;
 use Test::Exception;
 use Test::More;
 
diff --git a/lang/php/test/SchemaTest.php b/lang/php/test/SchemaTest.php
index 10f747a..1461603 100644
--- a/lang/php/test/SchemaTest.php
+++ b/lang/php/test/SchemaTest.php
@@ -419,10 +419,11 @@ class SchemaTest extends PHPUnit_Framework_TestCase
                         array("bar", "baz", "blurfl"));
     $this->assertFalse(is_array(json_decode('null', true)));
     $this->assertEquals(json_decode('{"type": "null"}', true), array("type" => 'null'));
-    foreach (array('true', 'True', 'TRUE', 'tRue') as $truthy)
-    {
-      $this->assertEquals(json_decode($truthy, true), true, $truthy);
-    }
+
+    // PHP now only accept lowercase true, and rejects TRUE etc.
+    // http://php.net/manual/en/migration56.incompatible.php#migration56.incompatible.json-decode
+    $this->assertEquals(json_decode('true', true), true, 'true');
+
     $this->assertEquals(json_decode('"boolean"'), 'boolean');
   }
 
diff --git a/lang/ruby/test/tool.rb b/lang/ruby/test/tool.rb
index 111b9d7..1a1f12e 100644
--- a/lang/ruby/test/tool.rb
+++ b/lang/ruby/test/tool.rb
@@ -42,7 +42,6 @@ class GenericHandler < WEBrick::HTTPServlet::AbstractServlet
     writer = Avro::IPC::FramedWriter.new(StringIO.new)
     writer.write_framed_message(unframed_resp)
     resp.body = writer.to_s
-    @server.stop
   end
 end
 
diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile
index 3588b77..022e192 100644
--- a/share/docker/Dockerfile
+++ b/share/docker/Dockerfile
@@ -17,24 +17,27 @@
 # Dockerfile for installing the necessary dependencies for building Avro.
 # See BUILD.txt.
 
-FROM java:8-jdk
+FROM openjdk:8
 
 WORKDIR /root
 
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 
-# Add the repository for node.js 4.x
-RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -
+# Add the repository for node.js 6.x
+RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
 
 # Register Microsoft key and feed for .NET SDK
 # https://dotnet.microsoft.com/download/linux-package-manager/debian8/sdk-current
 RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
&& \
   mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ && \
-  wget -q https://packages.microsoft.com/config/debian/8/prod.list && \
+  wget -q https://packages.microsoft.com/config/debian/9/prod.list && \
   mv prod.list /etc/apt/sources.list.d/microsoft-prod.list && \
   chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
   chown root:root /etc/apt/sources.list.d/microsoft-prod.list
 
+RUN curl https://packages.sury.org/php/apt.gpg | apt-key add --no-tty - && \
+      echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
+
 # Install dependencies from packages
 RUN apt-get -qq update && \
   apt-get -qq install --no-install-recommends -y \
@@ -56,14 +59,13 @@ RUN apt-get -qq update && \
     libglib2.0-dev \
     libjansson-dev \
     libsnappy-dev \
-    libsnappy1 \
+    libsnappy1v5 \
     make \
     maven \
     nodejs \
     perl \
-    php5 \
-    php5-gmp \
-    phpunit \
+    php5.6 \
+    php5.6-gmp \
     python \
     python-setuptools \
     python3-setuptools \
@@ -99,6 +101,9 @@ RUN curl -L http://cpanmin.us | perl - --self-upgrade && \
   IO::String Object::Tiny Compress::Zlib Test::More \
   Test::Exception Test::Pod
 
+# Install PHPUnit
+RUN wget -O /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-5.6.phar && chmod
+x /usr/local/bin/phpunit
+
 # Install Ruby modules
 RUN gem install echoe yajl-ruby multi_json snappy
 
diff --git a/share/test/interop/bin/test_rpc_interop.sh b/share/test/interop/bin/test_rpc_interop.sh
index 3c9321b..6e5d1df 100755
--- a/share/test/interop/bin/test_rpc_interop.sh
+++ b/share/test/interop/bin/test_rpc_interop.sh
@@ -15,14 +15,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-set -e                          # exit on error
+set -ex
 
 cd `dirname "$0"`/../../../..   # connect to root
 
 VERSION=`cat share/VERSION.txt`
 
-set -x                          # echo commands
-
 java_client="java -jar lang/java/tools/target/avro-tools-$VERSION.jar rpcsend"
 java_server="java -jar lang/java/tools/target/avro-tools-$VERSION.jar rpcreceive"
 
@@ -75,7 +73,6 @@ do
         done
         read ignore port < $portfile
         $client http://127.0.0.1:$port $proto $msg -file $c/request.avro
-        wait
         done
     done
     done


Mime
View raw message