You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by uw...@apache.org on 2018/05/02 05:04:39 UTC

[arrow] branch master updated: ARROW-2531: [C++] Update clang bits to 6.0

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

uwe 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 15e4811  ARROW-2531: [C++] Update clang bits to 6.0
15e4811 is described below

commit 15e4811b0b47ed1f311a6e2ef41ac7e5a028f3d9
Author: Korn, Uwe <Uw...@blue-yonder.com>
AuthorDate: Wed May 2 07:04:27 2018 +0200

    ARROW-2531: [C++] Update clang bits to 6.0
    
    Author: Korn, Uwe <Uw...@blue-yonder.com>
    
    Closes #1977 from xhochy/ARROW-2531 and squashes the following commits:
    
    cd18d57b <Korn, Uwe> Update llvm install command
    cbe94bc3 <Korn, Uwe> Support non-standard homebrew location
    651c7e2c <Korn, Uwe> ARROW-2531:  Update clang bits to 6.0
---
 .travis.yml                            | 10 +++++-----
 ci/travis_install_clang_tools.sh       |  4 ++--
 cpp/CMakeLists.txt                     |  2 +-
 cpp/README.md                          |  4 ++--
 cpp/cmake_modules/FindClangTools.cmake | 28 +++++++++++++++++++++++-----
 cpp/src/arrow/builder.cc               |  4 ++--
 cpp/src/arrow/io/io-buffered-test.cc   |  2 +-
 cpp/src/arrow/python/numpy_convert.cc  |  4 ++--
 cpp/src/arrow/type.cc                  |  4 ++--
 9 files changed, 40 insertions(+), 22 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 015984c..736f4fe 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -41,7 +41,7 @@ matrix:
   allow_failures:
   - jdk: oraclejdk9
   include:
-  # C++ & Python w/ clang 5.0
+  # C++ & Python w/ clang 6.0
   - compiler: gcc
     language: cpp
     os: linux
@@ -55,8 +55,8 @@ matrix:
     - ARROW_TRAVIS_PYTHON_BENCHMARKS=1
     - ARROW_TRAVIS_PYTHON_DOCS=1
     - ARROW_BUILD_WARNING_LEVEL=CHECKIN
-    - CC="clang-5.0"
-    - CXX="clang++-5.0"
+    - CC="clang-6.0"
+    - CXX="clang++-6.0"
     before_script:
     # Always run RAT checks, in case another build in matrix breaks RAT
     - $TRAVIS_BUILD_DIR/ci/travis_release_audit.sh
@@ -127,8 +127,8 @@ matrix:
     env: ARROW_TEST_GROUP=integration
     jdk: openjdk8
     env:
-    - CC="clang-5.0"
-    - CXX="clang++-5.0"
+    - CC="clang-6.0"
+    - CXX="clang++-6.0"
     before_script:
     - if [ $ARROW_CI_INTEGRATION_AFFECTED != "1" ]; then exit; fi
     - $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
diff --git a/ci/travis_install_clang_tools.sh b/ci/travis_install_clang_tools.sh
index 9c89253..49b2e47 100755
--- a/ci/travis_install_clang_tools.sh
+++ b/ci/travis_install_clang_tools.sh
@@ -19,6 +19,6 @@
 
 wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
 sudo apt-add-repository -y \
-     "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-5.0 main"
+     "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-6.0 main"
 sudo apt-get update -qq
-sudo apt-get install -q clang-5.0 clang-format-5.0 clang-tidy-5.0
+sudo apt-get install -q clang-6.0 clang-format-6.0 clang-tidy-6.0
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index be940ea..52a843a 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -48,7 +48,7 @@ set(ARROW_ABI_VERSION "${ARROW_SO_VERSION}.0.0")
 
 set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")
 
-set(CLANG_FORMAT_VERSION "5.0")
+set(CLANG_FORMAT_VERSION "6.0")
 find_package(ClangTools)
 if ("$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "1" OR CLANG_TIDY_FOUND)
   # Generate a Clang compile_commands.json "compilation database" file for use
diff --git a/cpp/README.md b/cpp/README.md
index 11c181a..3091588 100644
--- a/cpp/README.md
+++ b/cpp/README.md
@@ -320,10 +320,10 @@ You can also fix any formatting errors automatically:
 
     make format
 
-These commands require `clang-format-5.0` (and not any other version).
+These commands require `clang-format-6.0` (and not any other version).
 You may find the required packages at http://releases.llvm.org/download.html
 or use the Debian/Ubuntu APT repositories on https://apt.llvm.org/. On macOS
-with [Homebrew][1] you can get it via `brew install llvm@5`.
+with [Homebrew][1] you can get it via `brew install llvm@6`.
 
 ## Checking for ABI and API stability
 
diff --git a/cpp/cmake_modules/FindClangTools.cmake b/cpp/cmake_modules/FindClangTools.cmake
index e9221ff..7d1d2d1 100644
--- a/cpp/cmake_modules/FindClangTools.cmake
+++ b/cpp/cmake_modules/FindClangTools.cmake
@@ -30,6 +30,12 @@
 #  CLANG_FORMAT_BIN, The path to the clang format binary
 #  CLANG_TIDY_FOUND, Whether clang format was found
 
+if (DEFINED ENV{HOMEBREW_PREFIX})
+  set(HOMEBREW_PREFIX "${ENV{HOMEBREW_PREFIX}")
+else()
+  set(HOMEBREW_PREFIX "/usr/local")
+endif()
+
 find_program(CLANG_TIDY_BIN
   NAMES clang-tidy-4.0
   clang-tidy-3.9
@@ -37,7 +43,7 @@ find_program(CLANG_TIDY_BIN
   clang-tidy-3.7
   clang-tidy-3.6
   clang-tidy
-  PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin
+  PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin "${HOMEBREW_PREFIX}/bin"
         NO_DEFAULT_PATH
 )
 
@@ -55,7 +61,7 @@ if (CLANG_FORMAT_VERSION)
       PATHS
             ${ClangTools_PATH}
             $ENV{CLANG_TOOLS_PATH}
-            /usr/local/bin /usr/bin
+            /usr/local/bin /usr/bin "${HOMEBREW_PREFIX}/bin"
             NO_DEFAULT_PATH
     )
 
@@ -67,16 +73,28 @@ if (CLANG_FORMAT_VERSION)
         if ("${CLANG_FORMAT_MINOR_VERSION}" STREQUAL "0")
             find_program(CLANG_FORMAT_BIN
               NAMES clang-format
-              PATHS /usr/local/opt/llvm@${CLANG_FORMAT_MAJOR_VERSION}/bin
+              PATHS "${HOMEBREW_PREFIX}/opt/llvm@${CLANG_FORMAT_MAJOR_VERSION}/bin"
                     NO_DEFAULT_PATH
             )
         else()
             find_program(CLANG_FORMAT_BIN
               NAMES clang-format
-              PATHS /usr/local/opt/llvm@${CLANG_FORMAT_VERSION}/bin
+              PATHS "${HOMEBREW_PREFIX}/opt/llvm@${CLANG_FORMAT_VERSION}/bin"
                     NO_DEFAULT_PATH
             )
         endif()
+
+        if ("${CLANG_FORMAT_BIN}" STREQUAL "CLANG_FORMAT_BIN-NOTFOUND")
+          # binary was still not found, look into Cellar
+          # TODO: This currently only works for '.0' patch releases as
+          #       find_program does not support regular expressions
+          #       in the paths.
+          find_program(CLANG_FORMAT_BIN
+            NAMES clang-format
+            PATHS "${HOMEBREW_PREFIX}/Cellar/llvm/${CLANG_FORMAT_VERSION}.0/bin"
+                  NO_DEFAULT_PATH
+          )
+        endif()
     endif()
 else()
     find_program(CLANG_FORMAT_BIN
@@ -86,7 +104,7 @@ else()
       clang-format-3.7
       clang-format-3.6
       clang-format
-      PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin
+      PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin "${HOMEBREW_PREFIX}/bin"
             NO_DEFAULT_PATH
     )
 endif()
diff --git a/cpp/src/arrow/builder.cc b/cpp/src/arrow/builder.cc
index ece191f..71af87a 100644
--- a/cpp/src/arrow/builder.cc
+++ b/cpp/src/arrow/builder.cc
@@ -1626,8 +1626,8 @@ Status StructBuilder::FinishInternal(std::shared_ptr<ArrayData>* out) {
   return Status::OK();
 }
 
-  // ----------------------------------------------------------------------
-  // Helper functions
+// ----------------------------------------------------------------------
+// Helper functions
 
 #define BUILDER_CASE(ENUM, BuilderType)      \
   case Type::ENUM:                           \
diff --git a/cpp/src/arrow/io/io-buffered-test.cc b/cpp/src/arrow/io/io-buffered-test.cc
index 829a2d5..0fa5ca1 100644
--- a/cpp/src/arrow/io/io-buffered-test.cc
+++ b/cpp/src/arrow/io/io-buffered-test.cc
@@ -72,7 +72,7 @@ class TestBufferedOutputStream : public FileTestFixture {
     ASSERT_OK(FileOutputStream::Open(path_, append, &file));
     fd_ = file->file_descriptor();
     if (append) {
-    // Workaround for ARROW-2466 ("append" flag doesn't set file pos)
+      // Workaround for ARROW-2466 ("append" flag doesn't set file pos)
 #if defined(_MSC_VER)
       _lseeki64(fd_, 0, SEEK_END);
 #else
diff --git a/cpp/src/arrow/python/numpy_convert.cc b/cpp/src/arrow/python/numpy_convert.cc
index 0cd616a..e91aae1 100644
--- a/cpp/src/arrow/python/numpy_convert.cc
+++ b/cpp/src/arrow/python/numpy_convert.cc
@@ -46,8 +46,8 @@ bool is_contiguous(PyObject* array) {
 }
 
 int cast_npy_type_compat(int type_num) {
-// Both LONGLONG and INT64 can be observed in the wild, which is buggy. We set
-// U/LONGLONG to U/INT64 so things work properly.
+  // Both LONGLONG and INT64 can be observed in the wild, which is buggy. We set
+  // U/LONGLONG to U/INT64 so things work properly.
 
 #if (NPY_INT64 == NPY_LONGLONG) && (NPY_SIZEOF_LONGLONG == 8)
   if (type_num == NPY_LONGLONG) {
diff --git a/cpp/src/arrow/type.cc b/cpp/src/arrow/type.cc
index 2eb9967..16e7585 100644
--- a/cpp/src/arrow/type.cc
+++ b/cpp/src/arrow/type.cc
@@ -367,8 +367,8 @@ std::shared_ptr<Schema> schema(std::vector<std::shared_ptr<Field>>&& fields,
   return std::make_shared<Schema>(std::move(fields), metadata);
 }
 
-  // ----------------------------------------------------------------------
-  // Visitors and factory functions
+// ----------------------------------------------------------------------
+// Visitors and factory functions
 
 #define ACCEPT_VISITOR(TYPE) \
   Status TYPE::Accept(TypeVisitor* visitor) const { return visitor->Visit(*this); }

-- 
To stop receiving notification emails like this one, please contact
uwe@apache.org.