You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/11/30 22:10:47 UTC

[kudu] branch master updated: [thirdparty] fix preflight check on macOS 10.13

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3b98417  [thirdparty] fix preflight check on macOS 10.13
3b98417 is described below

commit 3b984171bd4a249c4e848062d1e62d1e4c6a1b14
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Mon Nov 30 12:32:00 2020 -0800

    [thirdparty] fix preflight check on macOS 10.13
    
    With e432e637e changelist, the pre-flight check on my macOS HighSierra
    faled while trying to rebuild thirdparty components:
    
      Checking for C++17 compiler support ...
      *** Unable to compile a simple c++17 program. Please use g++ 7.0 or higher. On CentOS 7 or RHEL 7 you must use the devtoolset. See docs/installation.adoc for more info.
      Compilation failed: <stdin>:5:19: error: call to unavailable member function 'value': introduced in macOS 10.14
              return oi.value();
    
    This patch fixes the issue, switching from std::optional<T>::value()
    to std::optional::operator*() in the pre-flight C++17 check.
    
    For posterity, the environment was:
    
      $ sw_vers
      ProductName:	Mac OS X
      ProductVersion:	10.13.6
      BuildVersion:	17G14042
    
      $ clang --version
      Apple LLVM version 10.0.0 (clang-1000.11.45.5)
      Target: x86_64-apple-darwin17.7.0
      Thread model: posix
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    
    Change-Id: I5c6f8b13f141d46d745011cd00f65d3440ab9016
    Reviewed-on: http://gerrit.cloudera.org:8080/16798
    Reviewed-by: Grant Henke <gr...@apache.org>
    Tested-by: Alexey Serbin <as...@cloudera.com>
---
 thirdparty/preflight.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/thirdparty/preflight.py b/thirdparty/preflight.py
index a1bc433..89fd6ce 100755
--- a/thirdparty/preflight.py
+++ b/thirdparty/preflight.py
@@ -108,14 +108,14 @@ def check_cxx17():
   try_do(
     "Checking for C++17 compiler support",
     ("Unable to compile a simple c++17 program. " +
-     "Please use g++ 7.0 or higher. On CentOS 7 or RHEL 7 " +
-     "you must use the devtoolset. See docs/installation.adoc " +
+     "Please use g++ 7.0 or higher (or CLANG 6.0 or higher). On CentOS 7 or "
+     "RHEL 7 you must use the devtoolset. See docs/installation.adoc " +
      "for more info."),
     lambda: compile("""
       #include <optional>
       int f() {
         std::optional<int> oi = 0;
-        return oi.value();
+        return *oi;
       }""",
       flags=['--std=c++17']))