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

[nifi-minifi-cpp] branch master updated: MINIFICPP-902: Attempt improved caching with travis

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

phrocker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new d82cdb4  MINIFICPP-902: Attempt improved caching with travis
d82cdb4 is described below

commit d82cdb43aca9ca6d68a50e75c6884baa6579bd01
Author: Marc Parisi <ph...@apache.org>
AuthorDate: Thu May 30 12:29:57 2019 -0400

    MINIFICPP-902: Attempt improved caching with travis
    
    This closes #576.
    
    +1 from committers based on community approval.
    
    Signed-off-by: Marc Parisi <ph...@apache.org>
---
 .travis.yml    | 30 ++++++++++++++++++------------
 CMakeLists.txt |  9 +++++++++
 bootstrap.sh   | 19 ++++++++++++++++---
 3 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index be3c2b4..6c7f316 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,10 +14,11 @@
 # limitations under the License.
 
 language: cpp
-cache:
+cache: 
+  ccache: true
   directories:
-  - $HOME/.ccache
   - $HOME/Library/Caches/Homebrew
+  - $TRAVIS_BUILD_DIR/bison-3.0.5
   timeout: 300
 
 env:
@@ -54,6 +55,8 @@ matrix:
         # Establish updated toolchain as default
         - sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
         - sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
+      script:
+        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF .. && cmake --build . --parallel 4   && sudo make test ARGS="-j2 --output-on-failure"
     - os: linux
       dist: trusty
       sudo: required
@@ -82,18 +85,20 @@ matrix:
         # Establish updated toolchain as default
         - sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
         - sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
+      script:
+        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= .. && make -j4 VERBOSE=1  && sudo make test ARGS="-j2 --output-on-failure"
     - os: linux
       name: trusty static build with tests
       dist: trusty
       sudo: required
       script:
-        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= .. && make -j2 VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure"
+        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= .. && make -j4 VERBOSE=1  && sudo make test ARGS="-j2 --output-on-failure"
     - os: linux
       name: xenial shared build with tests
       dist: xenial
       sudo: required
       script:
-        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= .. && make -j2 VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure"
+        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= .. &&  cmake --build . --parallel 4  && sudo make test ARGS="-j4 --output-on-failure"
     - os: linux
       name: debian static package build
       dist: trusty
@@ -101,7 +106,7 @@ matrix:
       services:
         - docker
       script:
-        - mkdir build && cd build && cmake .. && make debian
+        - mkdir -p build && cd build && cmake .. && make debian
     - os: linux
       name: centos static package biuld
       dist: trusty
@@ -109,7 +114,7 @@ matrix:
       services:
         - docker
       script:
-        - mkdir build && cd build && cmake .. && make centos
+        - mkdir -p build && cd build && cmake .. && make centos
     - os: linux
       name: fedora static package build
       dist: trusty
@@ -117,7 +122,7 @@ matrix:
       services:
         - docker
       script:
-        - mkdir build && cd build && cmake .. && make fedora
+        - mkdir -p build && cd build && cmake .. && make fedora
     - os: linux
       name: bionic static package build
       dist: trusty
@@ -125,12 +130,12 @@ matrix:
       services:
         - docker
       script:
-        - mkdir build && cd build && cmake .. && make u18
+        - mkdir -p build && cd build && cmake .. && make u18
     - os: linux
       dist: xenial
       sudo: required
       script:
-        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS=ON .. && make -j2 VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure"
+        - ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS=ON .. &&  cmake --build . --parallel 4  && sudo make test ARGS="-j4 --output-on-failure"
     - os: osx
       osx_image: xcode9.2
       env:
@@ -153,6 +158,8 @@ matrix:
         - package='libpcap'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
         - package='xz'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
         - package='libssh2'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
+      script:
+        - ./bootstrap.sh -e -t && cd build  && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF .. && cmake --build . --parallel 4 && sudo make test ARGS="-j4 --output-on-failure" && make linter
     - os: osx
       osx_image: xcode10
       env:
@@ -175,6 +182,5 @@ matrix:
         - package='libpcap'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
         - package='xz'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
         - package='libssh2'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package}
-
-script:
-  - ./bootstrap.sh -e -t && cd build  && make -j2 VERBOSE=1 && sudo make test ARGS="-j2 --output-on-failure" && make linter && make apache-rat
+      script:
+        - ./bootstrap.sh -e -t && cd build  && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF .. && cmake --build . --parallel 4 && sudo make test ARGS="-j4 --output-on-failure" && make linter
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b820a8a..7e34237 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,6 +60,7 @@ option(BUILD_ROCKSDB "Instructs the build system to use RocksDB from the third p
 option(FORCE_WINDOWS "Instructs the build system to force Windows builds when WIN32 is specified" OFF)
 option(DISABLE_CURL "Disables libCurl Properties." OFF)
 
+option(USE_GOLD_LINKER "Use Gold Linker" OFF)
 
 if(NOT WIN32)
 	if (ENABLE_JNI)
@@ -110,6 +111,14 @@ if(CCACHE_FOUND)
     message("-- Found ccache: ${CCACHE_FOUND}")
 endif(CCACHE_FOUND)
 
+if (UNIX AND USE_GOLD_LINKER AND NOT APPLE )
+  execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
+  if ("${ld_version}" MATCHES "GNU gold")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
+  endif()
+endif()
+
 # check for exec info before we enable the backtrace features.
 CHECK_INCLUDE_FILE("execinfo.h" HAS_EXECINFO)
 if (ENABLE_OPS AND HAS_EXECINFO AND NOT WIN32)
diff --git a/bootstrap.sh b/bootstrap.sh
index e80603d..df553ac 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -40,11 +40,11 @@ CMAKE_OPTIONS_DISABLED=()
 CMAKE_MIN_VERSION=()
 DEPLOY_LIMITS=()
 USER_DISABLE_TESTS="${FALSE}"
-
+USE_NINJA="false"
 DEPENDENCIES=()
 
 . "${script_directory}/bstrp_functions.sh"
-
+SKIP_CMAKE=${FALSE}
 MENU="features"
 GUIDED_INSTALL=${FALSE}
 while :; do
@@ -55,6 +55,9 @@ while :; do
     -s|--skiptests)
       USER_DISABLE_TESTS="${TRUE}"
       ;;
+    -g|--useninja)
+      USE_NINJA="${TRUE}"
+      ;;
     -e|--enableall)
       NO_PROMPT="true"
       FEATURES_SELECTED="true"
@@ -75,6 +78,7 @@ while :; do
     -t|--travis)
       NO_PROMPT="true"
       FEATURES_SELECTED="true"
+      SKIP_CMAKE="${TRUE}"
       ;;
     -p|--package)
       CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
@@ -385,6 +389,11 @@ CMAKE_REVISION=`echo $CMAKE_VERSION | cut -d. -f3`
 
 CMAKE_BUILD_COMMAND="${CMAKE_COMMAND} "
 
+if [ "${USE_NINJA}" = "${TRUE}" ]; then 
+	 echo "use ninja"
+   CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -GNinja "
+fi
+
 build_cmake_command(){
 
   for option in "${OPTIONS[@]}" ; do
@@ -482,7 +491,11 @@ build_cmake_command(){
 build_cmake_command
 
 ### run the cmake command
-${CMAKE_BUILD_COMMAND}
+if [ "${SKIP_CMAKE}" = "${TRUE}" ]; then
+	echo "Not running ${CMAKE_BUILD_COMMAND} "
+else
+	${CMAKE_BUILD_COMMAND}
+fi
 
 if [ "$BUILD" = "true" ]; then
   make -j${CORES}