You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/06/19 13:26:11 UTC

[arrow] branch master updated: ARROW-5474: [C++] Document Boost 1.58 as minimum supported version, add docker-compose entry for it, fix broken cpp/Dockerfile* builds

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 5b2bf32  ARROW-5474: [C++] Document Boost 1.58 as minimum supported version, add docker-compose entry for it, fix broken cpp/Dockerfile* builds
5b2bf32 is described below

commit 5b2bf32f72856589bb50ffd1b47868e5393d04e3
Author: Wes McKinney <we...@apache.org>
AuthorDate: Wed Jun 19 08:26:01 2019 -0500

    ARROW-5474: [C++] Document Boost 1.58 as minimum supported version, add docker-compose entry for it, fix broken cpp/Dockerfile* builds
    
    Technically Boost 1.58 is new enough (as `docker-compose run cpp-minimum-boost-version` proves), but the Flight tests require at least 1.64 (to get Boost.Process), so Flight is disabled in this test.
    
    Note I broke some of the Docker C++ builds in https://github.com/apache/arrow/commit/463c17b7a2ac9b8fa9bac555d185be9d395fe07c. I look forward to guidance about what checks I can run to try to prevent such breakages in the future when I make changes to the build system like this. I also enabled running the unit tests in the Fedora 29 build which were previously disabled
    
    Author: Wes McKinney <we...@apache.org>
    
    Closes #4612 from wesm/ARROW-5474 and squashes the following commits:
    
    dd9d6a4f2 <Wes McKinney> Apply Boost version check patch from Kou
    cf5f78f65 <Wes McKinney> Fix docker-compose entry docs
    9e56b7f55 <Wes McKinney> Test and document Boost 1.58 as minimum supported version, fix some cpp/Dockerfile* builds given ORC toolchain changes
    9a6fbc085 <Wes McKinney> Add Boost 1.58 build entry
---
 cpp/Dockerfile.debian-testing               |  5 ++++-
 cpp/Dockerfile.fedora                       | 19 ++++++++++---------
 cpp/Dockerfile.ubuntu-bionic                |  8 +++++++-
 cpp/Dockerfile.ubuntu-trusty                |  1 +
 cpp/Dockerfile.ubuntu-xenial                |  4 +++-
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 18 ++++++++++++++----
 docker-compose.yml                          | 17 +++++++++++++++++
 docs/source/developers/cpp.rst              |  4 +++-
 8 files changed, 59 insertions(+), 17 deletions(-)

diff --git a/cpp/Dockerfile.debian-testing b/cpp/Dockerfile.debian-testing
index 52d2037..83a9c5a 100644
--- a/cpp/Dockerfile.debian-testing
+++ b/cpp/Dockerfile.debian-testing
@@ -70,7 +70,10 @@ ENV CC=gcc \
      ARROW_GANDIVA_JAVA=ON \
      ARROW_HOME=/usr \
      JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 \
-     CMAKE_ARGS="-DFlatbuffers_SOURCE=BUNDLED -Dc-ares_SOURCE=BUNDLED -DgRPC_SOURCE=BUNDLED"
+     CMAKE_ARGS="-DFlatbuffers_SOURCE=BUNDLED \
+-Dc-ares_SOURCE=BUNDLED \
+-DgRPC_SOURCE=BUNDLED \
+-DORC_SOURCE=BUNDLED"
 
 # build and test
 CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.fedora b/cpp/Dockerfile.fedora
index bb7946f..3e79ea2 100644
--- a/cpp/Dockerfile.fedora
+++ b/cpp/Dockerfile.fedora
@@ -25,7 +25,6 @@ RUN dnf update -y && \
         boost-devel \
         brotli-devel \
         bzip2-devel \
-        c-ares-devel \
         ccache \
         clang-devel \
         cmake \
@@ -49,8 +48,6 @@ RUN dnf update -y && \
         make \
         ninja-build \
         openssl-devel \
-        protobuf-compiler \
-        protobuf-devel \
         python \
         rapidjson-devel \
         re2-devel \
@@ -58,19 +55,23 @@ RUN dnf update -y && \
         thrift-devel \
         zlib-devel
 
-# c-ares cmake config is not installed on Fedora but gRPC needs it
-# when built via ExternalProject: https://bugzilla.redhat.com/show_bug.cgi?id=1687844
+# * c-ares cmake config is not installed on Fedora but gRPC needs it
+#   when built via ExternalProject: https://bugzilla.redhat.com/show_bug.cgi?id=1687844
+# * protobuf libraries in Fedora 29 are too old for gRPC
 ENV CC=gcc \
      CXX=g++ \
      ARROW_ORC=ON \
      ARROW_DEPENDENCY_SOURCE=SYSTEM \
      ARROW_PARQUET=ON \
-     ARROW_FLIGHT=OFF \
+     ARROW_FLIGHT=ON \
      ARROW_GANDIVA=ON \
      ARROW_GANDIVA_JAVA=ON \
      ARROW_BUILD_TESTS=ON \
      ARROW_HOME=/usr/local \
-     CMAKE_ARGS="-DgRPC_SOURCE=BUNDLED"
+     CMAKE_ARGS="\
+-Dc-ares_SOURCE=BUNDLED \
+-DgRPC_SOURCE=BUNDLED \
+-DORC_SOURCE=BUNDLED \
+-DProtobuf_SOURCE=BUNDLED"
 
-# build; tests don't work on Fedora at the moment due to compiler problems in gcc 8.2 (fixed in 8.3)
-CMD ["arrow/ci/docker_build_cpp.sh"]
+CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.ubuntu-bionic b/cpp/Dockerfile.ubuntu-bionic
index 4e2620f..e2fd92d 100644
--- a/cpp/Dockerfile.ubuntu-bionic
+++ b/cpp/Dockerfile.ubuntu-bionic
@@ -82,7 +82,13 @@ ENV CC=gcc \
      ARROW_PARQUET=ON \
      ARROW_HOME=/usr \
      ARROW_WITH_ZSTD=ON \
-     CMAKE_ARGS="-DThrift_SOURCE=BUNDLED -DFlatbuffers_SOURCE=BUNDLED -DGTest_SOURCE=BUNDLED -DgRPC_SOURCE=BUNDLED -Dc-ares_SOURCE=BUNDLED -DProtobuf_SOURCE=BUNDLED"
+     CMAKE_ARGS="-DThrift_SOURCE=BUNDLED \
+-DFlatbuffers_SOURCE=BUNDLED \
+-DGTest_SOURCE=BUNDLED \
+-DgRPC_SOURCE=BUNDLED \
+-Dc-ares_SOURCE=BUNDLED \
+-DORC_SOURCE=BUNDLED \
+-DProtobuf_SOURCE=BUNDLED"
 
 # build and test
 CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.ubuntu-trusty b/cpp/Dockerfile.ubuntu-trusty
index 181dc8a..d44491c 100644
--- a/cpp/Dockerfile.ubuntu-trusty
+++ b/cpp/Dockerfile.ubuntu-trusty
@@ -76,6 +76,7 @@ ENV CC=gcc \
 -DGTest_SOURCE=BUNDLED \
 -DgRPC_SOURCE=BUNDLED \
 -DLz4_SOURCE=BUNDLED \
+-DORC_SOURCE=BUNDLED \
 -DProtobuf_SOURCE=BUNDLED \
 -DRapidJSON_SOURCE=BUNDLED \
 -DRE2_SOURCE=BUNDLED \
diff --git a/cpp/Dockerfile.ubuntu-xenial b/cpp/Dockerfile.ubuntu-xenial
index 3df4dc2..40a537b 100644
--- a/cpp/Dockerfile.ubuntu-xenial
+++ b/cpp/Dockerfile.ubuntu-xenial
@@ -36,6 +36,7 @@ RUN apt-get update -y -q && \
         g++ \
         gcc \
         git \
+        libboost-all-dev \
         libbrotli-dev \
         libbz2-dev \
         libdouble-conversion-dev \
@@ -61,7 +62,7 @@ RUN apt-get update -y -q && \
 # - c-ares in Xenial isn't recognized by gRPC build system
 # - libprotobuf-dev / libprotoc-dev in Xenial too old for gRPC
 # - libboost-all-dev does not include Boost.Process, needed for Flight
-#   unit tests
+#   unit tests, so doing vendored build by default
 # - liburiparser-dev is too old (< 0.9.0)
 ENV CC=gcc \
      CXX=g++ \
@@ -80,6 +81,7 @@ ENV CC=gcc \
 -Dgflags_SOURCE=BUNDLED \
 -DgRPC_SOURCE=BUNDLED \
 -DGTest_SOURCE=BUNDLED \
+-DORC_SOURCE=BUNDLED \
 -DProtobuf_SOURCE=BUNDLED \
 -DRapidJSON_SOURCE=BUNDLED"
 
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index fa2f27f..56c1697 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -478,6 +478,12 @@ find_package(Threads REQUIRED)
 # ----------------------------------------------------------------------
 # Add Boost dependencies (code adapted from Apache Kudu)
 
+if(ARROW_FLIGHT AND ARROW_BUILD_TESTS)
+  set(ARROW_BOOST_REQUIRED_VERSION "1.64")
+else()
+  set(ARROW_BOOST_REQUIRED_VERSION "1.58")
+endif()
+
 set(Boost_USE_MULTITHREADED ON)
 if(MSVC AND ARROW_USE_STATIC_CRT)
   set(Boost_USE_STATIC_RUNTIME ON)
@@ -590,9 +596,11 @@ else()
     endif()
 
     if(ARROW_BOOST_HEADER_ONLY)
-      find_package(Boost REQUIRED)
+      find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED)
     else()
-      find_package(Boost COMPONENTS regex system filesystem REQUIRED)
+      find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION}
+                   COMPONENTS regex system filesystem
+                   REQUIRED)
       set(BOOST_SYSTEM_LIBRARY Boost::system)
       set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem)
       set(BOOST_REGEX_LIBRARY Boost::regex)
@@ -605,9 +613,11 @@ else()
     # TODO Differentiate here between release and debug builds
     set(Boost_USE_STATIC_LIBS ON)
     if(ARROW_BOOST_HEADER_ONLY)
-      find_package(Boost REQUIRED)
+      find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED)
     else()
-      find_package(Boost COMPONENTS regex system filesystem REQUIRED)
+      find_package(Boost ${ARROW_BOOST_REQUIRED_VERSION}
+                   COMPONENTS regex system filesystem
+                   REQUIRED)
       set(BOOST_SYSTEM_LIBRARY Boost::system)
       set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem)
       set(BOOST_REGEX_LIBRARY Boost::regex)
diff --git a/docker-compose.yml b/docker-compose.yml
index ac74a32..6bb22cc 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -222,6 +222,23 @@ services:
       PARQUET_TEST_DATA: /arrow/cpp/submodules/parquet-testing/data
     volumes: *ubuntu-xenial-volumes
 
+  cpp-minimum-boost-version:
+    # Ubuntu Xenial 16.04 has Boost 1.58, our minimum version
+    #
+    # Usage:
+    #   docker-compose build cpp-minimum-boost-version
+    #   docker-compose run cpp-minimum-boost-version
+    image: arrow:cpp-ubuntu-xenial
+    shm_size: 2G
+    build:
+      context: .
+      dockerfile: cpp/Dockerfile.ubuntu-xenial
+    environment:
+      PARQUET_TEST_DATA: /arrow/cpp/submodules/parquet-testing/data
+      ARROW_BOOST_VENDORED: "OFF"
+      ARROW_FLIGHT: "OFF"
+    volumes: *ubuntu-xenial-volumes
+
   cpp-ubuntu-bionic:
     # Usage:
     #   docker-compose build cpp-ubuntu-bionic
diff --git a/docs/source/developers/cpp.rst b/docs/source/developers/cpp.rst
index 568e5c8..9e5013e 100644
--- a/docs/source/developers/cpp.rst
+++ b/docs/source/developers/cpp.rst
@@ -40,7 +40,9 @@ Building requires:
 * A C++11-enabled compiler. On Linux, gcc 4.8 and higher should be
   sufficient. For Windows, at least Visual Studio 2015 is required.
 * CMake 3.2 or higher
-* Boost
+* Boost 1.58 or higher, though some unit tests require 1.64 or
+  newer. Use ``-DARROW_BOOST_VENDORED=ON`` when invoking CMake to have
+  the Arrow build system automatically build a recent version of Boost.
 * ``bison`` and ``flex`` (for building Apache Thrift from source only, an
   Apache Parquet dependency.)