From 408b466b57f4cf0744c2ab3de1c700dc83fc24fc Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Tue, 25 Jun 2019 14:27:26 -0700 Subject: [PATCH 1/3] Modernize Travis and Appveyor configs This PR updates the Travis and Appveyor configs to use more recent toolchain versions, allowing for better C++11 compliance. --- .travis.yml | 50 +++++++++++++++++++------------------------------- appveyor.yml | 12 +++++++----- 2 files changed, 26 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe71962..13f32cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ # Build matrix / environment variables are explained on: # http://about.travis-ci.org/docs/user/build-configuration/ -# This file can be validated on: -# http://lint.travis-ci.org/ -# See also -# http://stackoverflow.com/questions/22111549/travis-ci-with-clang-3-4-and-c11/30925448#30925448 -# to allow C++11, though we are not yet building with -std=c++11 +# This file can be validated on: http://www.yamllint.com/ +# Or using the Ruby based travel command line tool: +# gem install travis --no-rdoc --no-ri +# travis lint .travis.yml language: cpp sudo: false addons: @@ -15,12 +14,10 @@ addons: update: false # do not update homebrew by default apt: sources: - #- ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.5 + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 packages: - #- gcc-4.9 - #- g++-4.9 - - clang-3.5 + - clang-8 - valgrind matrix: allow_failures: @@ -28,21 +25,21 @@ matrix: include: - name: Mac clang meson static release testing os: osx - osx_image: xcode9.4 + osx_image: xcode10.2 compiler: clang - env: - CXX="clang++-3.5" - CC="clang-3.5" + env: + CXX="clang++" + CC="clang" LIB_TYPE=static BUILD_TYPE=release script: ./.travis_scripts/meson_builder.sh - - name: trusty clang meson static release testing + - name: xenial clang meson static release testing os: linux - dist: trusty + dist: xenial compiler: clang - env: - CXX="clang++-3.5" - CC="clang-3.5" + env: + CXX="clang++" + CC="clang" LIB_TYPE=static BUILD_TYPE=release # before_install and install steps only needed for linux meson builds @@ -55,23 +52,14 @@ matrix: os: linux dist: xenial compiler: gcc - env: + env: CXX=g++ CC=gcc DO_Coverage=ON BUILD_TOOL="Unix Makefiles" - BUILD_TYPE=Debug - LIB_TYPE=shared + BUILD_TYPE=Debug + LIB_TYPE=shared DESTDIR=/tmp/cmake_json_cpp script: ./.travis_scripts/cmake_builder.sh -# Valgrind has too many false positives from the python wrapping. Need a good suppression file -# - name: xenial gcc cmake coverage -# os: linux -# dist: xenial -# compiler: gcc -# env: DO_MemCheck=ON CXX=/usr/bin/g++ BUILD_TOOL="Unix Makefiles" BUILD_TYPE=Debug LIB_TYPE=shared DESTDIR=/tmp/cmake_json_cpp -# script: ./.travis_scripts/cmake_builder.sh notifications: email: false - - diff --git a/appveyor.yml b/appveyor.yml index 447a212..daaaeef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,19 +2,21 @@ clone_folder: c:\projects\jsoncpp environment: matrix: - - CMAKE_GENERATOR: Visual Studio 12 2013 - - CMAKE_GENERATOR: Visual Studio 12 2013 Win64 - CMAKE_GENERATOR: Visual Studio 14 2015 - CMAKE_GENERATOR: Visual Studio 14 2015 Win64 + - CMAKE_GENERATOR: Visual Studio 15 2017 + - CMAKE_GENERATOR: Visual Studio 15 2017 Win64 build_script: - cmake --version - cd c:\projects\jsoncpp - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX:PATH=%CD:\=/%/install -DBUILD_SHARED_LIBS:BOOL=ON . - # Use ctest to make a dashboard build ctest -D Experimental(Start|Update|Configure|Build|Test|Coverage|MemCheck|Submit) - #NOTE Testing on window is not yet finished - ctest -C Release -D ExperimentalStart -D ExperimentalConfigure -D ExperimentalBuild -D ExperimentalTest -D ExperimentalSubmit + # Use ctest to make a dashboard build: + # - ctest -D Experimental(Start|Update|Configure|Build|Test|Coverage|MemCheck|Submit) + # NOTE: Testing on window is not yet finished: + # - ctest -C Release -D ExperimentalStart -D ExperimentalConfigure -D ExperimentalBuild -D ExperimentalTest -D ExperimentalSubmit - ctest -C Release -D ExperimentalStart -D ExperimentalConfigure -D ExperimentalBuild -D ExperimentalSubmit - # Final step is to verify that installation succeeds + # Final step is to verify that installation succeeds - cmake --build . --config Release --target install deploy: From c84f2e19c9514c22dfcb3e52c004b62ccb77deb9 Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Tue, 25 Jun 2019 14:40:55 -0700 Subject: [PATCH 2/3] Update travis scripts --- .travis_scripts/cmake_builder.sh | 12 ++++++------ .travis_scripts/travis.before_install.linux.sh | 11 ++++++----- .travis_scripts/travis.before_install.osx.sh | 4 ---- .travis_scripts/travis.install.linux.sh | 2 +- .travis_scripts/travis.install.osx.sh | 4 ---- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.travis_scripts/cmake_builder.sh b/.travis_scripts/cmake_builder.sh index c011878..ccb3331 100755 --- a/.travis_scripts/cmake_builder.sh +++ b/.travis_scripts/cmake_builder.sh @@ -12,10 +12,10 @@ # Optional environmental variables # - DESTDIR <- used for setting the install prefix # - BUILD_TOOL=["Unix Makefile"|"Ninja"] -# - BUILDNAME <-- how to identify this build on the dashboard +# - BUILDNAME <- how to identify this build on the dashboard # - DO_MemCheck <- if set, try to use valgrind -# - DO_Coverage <- if set, try to do dashboard coverage testing -# +# - DO_Coverage <- if set, try to do dashboard coverage testing +# env_set=1 if ${BUILD_TYPE+false}; then @@ -78,7 +78,7 @@ if ! ${DO_MemCheck+false}; then valgrind --version CTEST_TESTING_OPTION="-D ExperimentalMemCheck" else -# - DO_Coverage <- if set, try to do dashboard coverage testing +# - DO_Coverage <- if set, try to do dashboard coverage testing if ! ${DO_Coverage+false}; then export CXXFLAGS="-fprofile-arcs -ftest-coverage" export LDFLAGS="-fprofile-arcs -ftest-coverage" @@ -117,14 +117,14 @@ cd "${_BUILD_DIR_NAME}" ctest -C ${BUILD_TYPE} -D ExperimentalStart -D ExperimentalConfigure -D ExperimentalBuild ${CTEST_TESTING_OPTION} -D ExperimentalSubmit # Final step is to verify that installation succeeds cmake --build . --config ${BUILD_TYPE} --target install - + if [ "${DESTDIR}" != "/usr/local" ]; then ${_BUILD_EXE} install fi cd - if ${CLEANUP+false}; then - echo "Skipping cleanup: build directory will persist." + echo "Skipping cleanup: build directory will persist." else rm -r "${_BUILD_DIR_NAME}" fi diff --git a/.travis_scripts/travis.before_install.linux.sh b/.travis_scripts/travis.before_install.linux.sh index 18e019d..9b556de 100644 --- a/.travis_scripts/travis.before_install.linux.sh +++ b/.travis_scripts/travis.before_install.linux.sh @@ -1,7 +1,8 @@ set -vex -#before_install: pyenv install 3.5.4 && pyenv global 3.5.4 -#before_install: pyenv global 3.6 -# https://docs.travis-ci.com/user/languages/python/ -# "for Trusty, this means 2.7.6 and 3.4.3" -pyenv global 3.6 +# Preinstalled versions of python are dependent on which Ubuntu distribution +# you are running. The below version needs to be updated whenever we roll +# the Ubuntu version used in Travis. +# https://docs.travis-ci.com/user/languages/python/ + +pyenv global 3.7.1 diff --git a/.travis_scripts/travis.before_install.osx.sh b/.travis_scripts/travis.before_install.osx.sh index d7d11a5..5d83c0c 100644 --- a/.travis_scripts/travis.before_install.osx.sh +++ b/.travis_scripts/travis.before_install.osx.sh @@ -1,5 +1 @@ # NOTHING TO DO HERE -# set -vex - -#brew install pyenv -#which pyenv diff --git a/.travis_scripts/travis.install.linux.sh b/.travis_scripts/travis.install.linux.sh index 84c3a61..7c5846f 100644 --- a/.travis_scripts/travis.install.linux.sh +++ b/.travis_scripts/travis.install.linux.sh @@ -1,6 +1,6 @@ set -vex -wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip +wget https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip unzip -q ninja-linux.zip -d build pip3 install meson diff --git a/.travis_scripts/travis.install.osx.sh b/.travis_scripts/travis.install.osx.sh index 1c6c6f0..5d83c0c 100644 --- a/.travis_scripts/travis.install.osx.sh +++ b/.travis_scripts/travis.install.osx.sh @@ -1,5 +1 @@ # NOTHING TO DO HERE -# set -vex - -#python3 -m venv venv -#source venv/bin/activate From 2690bc9a9a9c7b3c80a886948321bc44cfde7654 Mon Sep 17 00:00:00 2001 From: Jordan Bayles Date: Tue, 25 Jun 2019 14:48:40 -0700 Subject: [PATCH 3/3] Update appveyor to use build images --- .travis.yml | 4 ++-- appveyor.yml | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 13f32cc..b649b46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ matrix: LIB_TYPE=static BUILD_TYPE=release script: ./.travis_scripts/meson_builder.sh - - name: xenial clang meson static release testing + - name: Linux xenial clang meson static release testing os: linux dist: xenial compiler: clang @@ -48,7 +48,7 @@ matrix: install: - source ./.travis_scripts/travis.install.${TRAVIS_OS_NAME}.sh script: ./.travis_scripts/meson_builder.sh - - name: xenial gcc cmake coverage + - name: Linux xenial gcc cmake coverage os: linux dist: xenial compiler: gcc diff --git a/appveyor.yml b/appveyor.yml index daaaeef..0b9c8fe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,10 +2,14 @@ clone_folder: c:\projects\jsoncpp environment: matrix: - - CMAKE_GENERATOR: Visual Studio 14 2015 - - CMAKE_GENERATOR: Visual Studio 14 2015 Win64 - - CMAKE_GENERATOR: Visual Studio 15 2017 - - CMAKE_GENERATOR: Visual Studio 15 2017 Win64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CMAKE_GENERATOR: Visual Studio 14 2015 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CMAKE_GENERATOR: Visual Studio 14 2015 Win64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CMAKE_GENERATOR: Visual Studio 15 2017 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CMAKE_GENERATOR: Visual Studio 15 2017 Win64 build_script: - cmake --version