You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2022/08/11 05:49:09 UTC

[impala] branch master updated: IMPALA-11257: Fix CMake warnings for module names and cmake_minimum_required

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

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


The following commit(s) were added to refs/heads/master by this push:
     new ba4cb95b6 IMPALA-11257: Fix CMake warnings for module names and cmake_minimum_required
ba4cb95b6 is described below

commit ba4cb95b6251911fa9e057cea1cb37958d339fed
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Tue Mar 15 13:03:31 2022 -0700

    IMPALA-11257: Fix CMake warnings for module names and cmake_minimum_required
    
    This fixes a few different CMake warnings:
    1. This removes cmake_minimum_required invocations except for the
       top-most CMakeLists.txt. This eliminates the warnings like this:
         Compatibility with CMake < 2.8.12 will be removed from a future version of
         CMake.
    
         Update the VERSION argument <min> value or use a ...<max> suffix to tell
         CMake that the project does not need compatibility with older versions.
       Moving to a later version also required setting CMAKE_ENABLE_EXPORTS
       to continue exporting symbols.
    2. This modifies the module names so that they match the corresponding
       module names from Find*.cmake. This is mostly dealing with case
       differences. This address warnings like:
         The package name passed to `find_package_handle_standard_args` (PROTOBUF)
         does not match the name of the calling package (Protobuf).  This can lead
         to problems in calling code that expects `find_package` result variables
         (e.g., `_FOUND`) to follow a certain pattern.
       This fixed the detection logic for KerberosPrograms, and so it required
       adding more Kerberos packages to bin/bootstrap_build.sh.
    3. This adds a missing .cc suffix. This addresses the following warning:
         CMake Warning (dev) at be/src/util/CMakeLists.txt:141 (add_library):
         Policy CMP0115 is not set: Source file extensions must be explicit.  Run
         "cmake --help-policy CMP0115" for policy details.  Use the cmake_policy
         command to set the policy and suppress this warning.
    
    These fixes mostly match how these warnings were handled in
    Apache Kudu.
    
    Testing:
     - Ran GVO
    
    Change-Id: I2a97dd07cdd0831e90882a2035415ac71d670147
    Reviewed-on: http://gerrit.cloudera.org:8080/18444
    Reviewed-by: Joe McDonnell <jo...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 CMakeLists.txt                           |  9 ++++++++-
 be/CMakeLists.txt                        |  3 ---
 be/src/exec/CMakeLists.txt               |  2 --
 be/src/exec/parquet/CMakeLists.txt       |  2 --
 be/src/testutil/CMakeLists.txt           |  3 ---
 be/src/util/CMakeLists.txt               |  2 +-
 bin/bootstrap_build.sh                   | 10 ++++++----
 cmake_modules/FindCrcutil.cmake          |  2 +-
 cmake_modules/FindFlatBuffers.cmake      |  2 +-
 cmake_modules/FindKerberos.cmake         |  2 +-
 cmake_modules/FindKerberosPrograms.cmake |  2 +-
 cmake_modules/FindLibEv.cmake            |  2 +-
 cmake_modules/FindLibUnwind.cmake        |  2 +-
 cmake_modules/FindProtobuf.cmake         |  2 +-
 common/fbs/CMakeLists.txt                |  2 --
 common/function-registry/CMakeLists.txt  |  3 ---
 common/protobuf/CMakeLists.txt           |  3 ---
 common/thrift/CMakeLists.txt             |  3 ---
 18 files changed, 22 insertions(+), 34 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a5e4713..652cd2aec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-cmake_minimum_required(VERSION 3.2.3)
+cmake_minimum_required(VERSION 3.14)
 
 # This is a Kudu-specific flag that disables Kudu targets that are test-only.
 set(NO_TESTS 1)
@@ -36,6 +36,13 @@ set(IMPALA_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
 # Build compile commands database
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
+# Codegen-dependent executables need to be linked with -rdynamic; otherwise LLVM
+# can't find dependent symbols at runtime.
+#
+# Rather than setting ENABLE_EXPORTS for each target, this enables it by default,
+# as most backend tests depend on codegen. See CMake CMP0065 for more information.
+set(CMAKE_ENABLE_EXPORTS ON)
+
 # generate CTest input files
 enable_testing()
 
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 6340592e5..83a658c00 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-
-cmake_minimum_required(VERSION 2.6)
-
 # generate CTest input files
 enable_testing()
 
diff --git a/be/src/exec/CMakeLists.txt b/be/src/exec/CMakeLists.txt
index b26b7e5ef..6e6c88986 100644
--- a/be/src/exec/CMakeLists.txt
+++ b/be/src/exec/CMakeLists.txt
@@ -17,8 +17,6 @@
 
 add_subdirectory(parquet)
 
-cmake_minimum_required(VERSION 2.6)
-
 # where to put generated libraries
 set(LIBRARY_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}/exec")
 
diff --git a/be/src/exec/parquet/CMakeLists.txt b/be/src/exec/parquet/CMakeLists.txt
index af405d2fa..f2c5b55f0 100644
--- a/be/src/exec/parquet/CMakeLists.txt
+++ b/be/src/exec/parquet/CMakeLists.txt
@@ -15,8 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-cmake_minimum_required(VERSION 2.6)
-
 # where to put generated libraries
 set(LIBRARY_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}/exec/parquet")
 
diff --git a/be/src/testutil/CMakeLists.txt b/be/src/testutil/CMakeLists.txt
index 17885fa71..2ac8e6b2e 100644
--- a/be/src/testutil/CMakeLists.txt
+++ b/be/src/testutil/CMakeLists.txt
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-
-cmake_minimum_required(VERSION 2.6)
-
 # where to put generated libraries
 set(LIBRARY_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}/testutil")
 
diff --git a/be/src/util/CMakeLists.txt b/be/src/util/CMakeLists.txt
index a471ac1db..fcf0b5eb6 100644
--- a/be/src/util/CMakeLists.txt
+++ b/be/src/util/CMakeLists.txt
@@ -85,7 +85,7 @@ set(UTIL_SRCS
   parquet-bloom-filter.cc
   parse-util.cc
   path-builder.cc
-  periodic-counter-updater
+  periodic-counter-updater.cc
   pprof-path-handlers.cc
   progress-updater.cc
   process-state-info.cc
diff --git a/bin/bootstrap_build.sh b/bin/bootstrap_build.sh
index 447e6b7b7..c1b78a92b 100755
--- a/bin/bootstrap_build.sh
+++ b/bin/bootstrap_build.sh
@@ -30,10 +30,12 @@
 set -euxo pipefail
 
 # Install non-java dependencies:
-sudo apt-get update
-sudo apt-get --yes install g++ gcc git libsasl2-dev libssl-dev make \
-    python-dev python-setuptools python3-dev python3-setuptools libffi-dev libkrb5-dev
-
+# Kerberos setup would pop up dialog boxes without this
+export DEBIAN_FRONTEND=noninteractive
+sudo -E apt-get update
+sudo -E apt-get --yes install g++ gcc git libsasl2-dev libssl-dev make python-dev \
+     python-setuptools python3-dev python3-setuptools libffi-dev libkrb5-dev \
+     krb5-admin-server krb5-kdc krb5-user
 
 source /etc/lsb-release
 
diff --git a/cmake_modules/FindCrcutil.cmake b/cmake_modules/FindCrcutil.cmake
index f6ec2b1bd..99e187d17 100644
--- a/cmake_modules/FindCrcutil.cmake
+++ b/cmake_modules/FindCrcutil.cmake
@@ -36,5 +36,5 @@ find_library(CRCUTIL_STATIC_LIB libcrcutil.a
   NO_SYSTEM_ENVIRONMENT_PATH)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CRCUTIL REQUIRED_VARS
+find_package_handle_standard_args(Crcutil REQUIRED_VARS
   CRCUTIL_SHARED_LIB CRCUTIL_STATIC_LIB CRCUTIL_INCLUDE_DIR)
diff --git a/cmake_modules/FindFlatBuffers.cmake b/cmake_modules/FindFlatBuffers.cmake
index 2ae4d3692..762b8b00e 100644
--- a/cmake_modules/FindFlatBuffers.cmake
+++ b/cmake_modules/FindFlatBuffers.cmake
@@ -39,5 +39,5 @@ find_program(FLATBUFFERS_COMPILER flatc
   NO_SYSTEM_ENVIRONMENT_PATH)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(FLATBUFFERS REQUIRED_VARS
+find_package_handle_standard_args(FlatBuffers REQUIRED_VARS
   FLATBUFFERS_INCLUDE_DIR FLATBUFFERS_STATIC_LIB FLATBUFFERS_COMPILER)
diff --git a/cmake_modules/FindKerberos.cmake b/cmake_modules/FindKerberos.cmake
index b435291e0..85e7d9fa1 100644
--- a/cmake_modules/FindKerberos.cmake
+++ b/cmake_modules/FindKerberos.cmake
@@ -32,4 +32,4 @@ find_library(KERBEROS_LIBRARY NAMES krb5 ${_KRB5_SEARCH_DIRS} PATH_SUFFIXES lib)
 # handle the QUIETLY and REQUIRED arguments and set KERBEROS_FOUND to TRUE if
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(KERBEROS DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR)
+find_package_handle_standard_args(Kerberos DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR)
diff --git a/cmake_modules/FindKerberosPrograms.cmake b/cmake_modules/FindKerberosPrograms.cmake
index 27b181a48..f5c0b3f26 100644
--- a/cmake_modules/FindKerberosPrograms.cmake
+++ b/cmake_modules/FindKerberosPrograms.cmake
@@ -34,5 +34,5 @@ foreach(bin ${bins})
                /usr/lib/mit/sbin)
 endforeach(bin)
 
-find_package_handle_standard_args(Kerberos REQUIRED_VARS ${bins}
+find_package_handle_standard_args(KerberosPrograms REQUIRED_VARS ${bins}
   FAIL_MESSAGE "Kerberos binaries not found: security tests will fail")
diff --git a/cmake_modules/FindLibEv.cmake b/cmake_modules/FindLibEv.cmake
index 40443f1b4..110e04343 100644
--- a/cmake_modules/FindLibEv.cmake
+++ b/cmake_modules/FindLibEv.cmake
@@ -37,5 +37,5 @@ find_library(LIBEV_STATIC_LIB libev.a PATHS
   NO_SYSTEM_ENVIRONMENT_PATH)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LIBEV REQUIRED_VARS
+find_package_handle_standard_args(LibEv REQUIRED_VARS
   LIBEV_SHARED_LIB LIBEV_STATIC_LIB LIBEV_INCLUDE_DIR)
diff --git a/cmake_modules/FindLibUnwind.cmake b/cmake_modules/FindLibUnwind.cmake
index 53f012c3a..f38eb4903 100644
--- a/cmake_modules/FindLibUnwind.cmake
+++ b/cmake_modules/FindLibUnwind.cmake
@@ -36,5 +36,5 @@ find_library(LIBUNWIND_STATIC_LIB libunwind.a
   NO_SYSTEM_ENVIRONMENT_PATH)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LIBUNWIND REQUIRED_VARS
+find_package_handle_standard_args(LibUnwind REQUIRED_VARS
   LIBUNWIND_SHARED_LIB LIBUNWIND_STATIC_LIB LIBUNWIND_INCLUDE_DIR)
diff --git a/cmake_modules/FindProtobuf.cmake b/cmake_modules/FindProtobuf.cmake
index f3001410d..10b3b7143 100644
--- a/cmake_modules/FindProtobuf.cmake
+++ b/cmake_modules/FindProtobuf.cmake
@@ -230,7 +230,7 @@ find_program(PROTOBUF_PROTOC_EXECUTABLE protoc
   NO_SYSTEM_ENVIRONMENT_PATH)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PROTOBUF REQUIRED_VARS
+find_package_handle_standard_args(Protobuf REQUIRED_VARS
   PROTOBUF_SHARED_LIBRARY PROTOBUF_STATIC_LIBRARY
   PROTOBUF_PROTOC_SHARED_LIBRARY PROTOBUF_PROTOC_STATIC_LIBRARY
   PROTOBUF_INCLUDE_DIR PROTOBUF_PROTOC_EXECUTABLE)
diff --git a/common/fbs/CMakeLists.txt b/common/fbs/CMakeLists.txt
index 446fc5252..324762846 100644
--- a/common/fbs/CMakeLists.txt
+++ b/common/fbs/CMakeLists.txt
@@ -15,8 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-cmake_minimum_required(VERSION 2.6)
-
 # Helper function to generate build rules. For each input flatbuffer file (*.fbs), this
 # function will generate a rule that maps the input file to an output c++ file.
 # The flatbuffers compiler will generate multiple output files for each input file. In
diff --git a/common/function-registry/CMakeLists.txt b/common/function-registry/CMakeLists.txt
index 013632f29..23ae52463 100644
--- a/common/function-registry/CMakeLists.txt
+++ b/common/function-registry/CMakeLists.txt
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-
-cmake_minimum_required(VERSION 2.6)
-
 set(BE_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/be/generated-sources)
 set(FE_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/fe/generated-sources/gen-java/org/apache/impala/)
 
diff --git a/common/protobuf/CMakeLists.txt b/common/protobuf/CMakeLists.txt
index 85b8ab92a..d2fc36f2f 100644
--- a/common/protobuf/CMakeLists.txt
+++ b/common/protobuf/CMakeLists.txt
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-
-cmake_minimum_required(VERSION 2.6)
-
 add_custom_target(proto-deps)
 
 set(PROTOBUF_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/be/generated-sources/gen-cpp/)
diff --git a/common/thrift/CMakeLists.txt b/common/thrift/CMakeLists.txt
index d841566f2..617113789 100644
--- a/common/thrift/CMakeLists.txt
+++ b/common/thrift/CMakeLists.txt
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-
-cmake_minimum_required(VERSION 2.6)
-
 # Helper function to generate build rules.  For each input thrift file, this function will
 # generate a rule that maps the input file to the output c++ file.
 # Thrift will generate multiple output files for each input (including java files) and