<NME> .travis.yml
<BEF> #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License
#

jobs:
  include:
  - os: linux
    dist: xenial
jobs:
  include:
  - compiler: gcc
  - compiler: clang
    # c-threaderciser test hangs on older clang
    env:
    - QPID_PROTON_CMAKE_ARGS='-DENABLE_LINKTIME_OPTIMIZATION=OFF -DTHREADERCISER=ON'
    - QPID_PROTON_CTEST_ARGS='--exclude-regex c-threaderciser'
  - name: static libs
    compiler: gcc
    env:
    - QPID_PROTON_CMAKE_ARGS='-DBUILD_STATIC_LIBS=ON -DTHREADERCISER=ON'
  - name: benchmarks
    compiler: gcc
    env:
    - QPID_PROTON_CMAKE_ARGS='-DENABLE_BENCHMARKS=ON -DRUNTIME_CHECK=OFF -DTHREADERCISER=ON'
    before_install:
    - sudo apt-get install -y libbenchmark-dev
  - name: gcc asan
    before_install:
    - sudo apt-get install -y gcc-10 g++-10
    env:
    - CC=gcc-10
    - CXX=g++-10
    # python-tox-test fails and ruby tests segfault
    - QPID_PROTON_CMAKE_ARGS='-DRUNTIME_CHECK=asan -DENABLE_TOX_TEST=OFF -DTHREADERCISER=ON'
    - QPID_PROTON_CTEST_ARGS='-E ^ruby.*'
  - name: clang asan
    before_install:
    - sudo apt-get install -y clang-11 llvm-11-dev
    env:
    - CC=clang-11
    - CXX=clang++-11
    - QPID_PROTON_CMAKE_ARGS='-DRUNTIME_CHECK=asan -DENABLE_TOX_TEST=OFF -DTHREADERCISER=ON'
    # otherwise, on Travis ldd gives `libclang_rt.asan-x86_64.so => not found` and binaries don't work
    - LD_LIBRARY_PATH=/usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/
  - name: gcc tsan
    before_install:
    - sudo apt-get install -y gcc-10 g++-10
    env:
    - CC=gcc-10
    - CXX=g++-10
    - QPID_PROTON_CMAKE_ARGS='-DRUNTIME_CHECK=tsan -DTHREADERCISER=ON'
    # python-test, python-pep8-test, python-integration-test, and python-tox-test (currently all python tests) segfault
    - QPID_PROTON_CTEST_ARGS="-E 'python.*test'"
  - name: coverage
    dist: bionic
    compiler: gcc
    env:
    - QPID_PROTON_CMAKE_ARGS='-DCMAKE_BUILD_TYPE=Coverage -DTHREADERCISER=ON'
    after_success:
    - bash <(curl -s https://codecov.io/bash)

  - os: osx
    osx_image: xcode12.2
    compiler: clang
    env:
    - PATH="/usr/local/opt/python/libexec/bin:/usr/local/bin:$PATH"
    - PKG_CONFIG_PATH='/usr/local/opt/openssl@1.1/lib/pkgconfig'
    - QPID_PROTON_CMAKE_ARGS='-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DTHREADERCISER=ON'
    # TODO PROTON-2225: c-threaderciser sometimes fails with assertion error
    # python-tox-test segfaults and ruby tests do not start due to dynamic library issues
    - QPID_PROTON_CTEST_ARGS="--exclude-regex 'c-threaderciser|python-tox-test|ruby.*'"

addons:
  # Ubuntu APT dependencies, https://packages.ubuntu.com/
  apt:
    packages:
    - cmake
    - libssl-dev
    - libsasl2-dev
    - sasl2-bin
    - swig
    - python-dev
    - ruby
    - ruby-dev
    - python3-dev
    - python3-pip
    - golang
    - lcov
    - libjsoncpp-dev
  # macOS Homebrew dependencies, https://formulae.brew.sh/
  homebrew:
    packages:
      - jsoncpp
      - libuv
      - swig
# update:true workaround as of Feb. 22/20 as per
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/10
    update: true

before_install:
  # install Valgrind only on Focal. On Xenial, we are getting `Illegal opcode at address 0x5152B15`
  - if [[ "${TRAVIS_DIST}" == "focal" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends install valgrind; fi
  # install Python 3.6.8; Travis has a mechanism for this, but that would activate it in a venv, which older CMake does not deal well with
  - if [[ "${TRAVIS_DIST}" == "bionic" ]]; then curl -sSf --retry 5 -o python-3.6.8.tar.bz2 https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/18.04/x86_64/python-3.6.8.tar.bz2; fi
  - if [[ "${TRAVIS_DIST}" == "bionic" ]]; then sudo tar xjf python-3.6.8.tar.bz2 --directory /; fi
  - if [[ "${TRAVIS_DIST}" == "bionic" ]]; then PATH="/opt/python/3.6.8/bin:${PATH}"; fi

install:
- echo "Using PYTHON=${PYTHON:=python}"
- ${PYTHON} -m pip install --user --upgrade pip
- ${PYTHON} -m pip install --user coverage setuptools wheel tox virtualenv flake8
# PROTON-2125 suppress annoying deprecation warning from Minitest in Ruby tests
- gem install minitest:4.3.2 simplecov:0.18.0 codecov

before_script:
- mkdir build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DPython_EXECUTABLE="$(which ${PYTHON})" ${QPID_PROTON_CMAKE_ARGS}

script:
# travis timeouts a job after 600 s elapses without any new output being printed; use 360 s here to preempt that
- cmake --build . --target install -- -j$(nproc) && eval ctest --timeout 360 -V ${QPID_PROTON_CTEST_ARGS}

<MSG> PROTON-2351: allow Travis based OSX runs not to fail the overall job for now, to help avoid masking issues on other OS runs. GHA MacOS builds will still fail.

<DFF> @@ -18,6 +18,8 @@
 #
 
 jobs:
+  allow_failures:
+  - os: osx
   include:
   - os: linux
     dist: xenial

{'commit': 'diff --git a/.travis.yml b/.travis.yml\nindex 1f20dfa3..b49b97e4 100644\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -18,6 +18,8 @@\n #\n \n jobs:\n+  allow_failures:\n+  - os: osx\n   include:\n   - os: linux\n     dist: xenial\n', 'commit_subject': 'PROTON-2351: allow Travis based OSX runs not to fail the overall job for now, to help avoid masking issues on other OS runs. GHA MacOS builds will still fail.', 'repo_name': 'apache/qpid-proton', 'committer': {'name': 'Robbie Gemmell', 'email': 'e3effdd3cee93432e8c5e3dfcfc99c22847a721e@apache.org', 'time_sec': '1617295572', 'tz_offset': '60', 'date': {'seconds': '1617295572'}}, 'commit_tree': 'c9a6d61220418ed2c4393e12f53311c773c074e7', 'commit_message': 'PROTON-2351: allow Travis based OSX runs not to fail the overall job for now, to help avoid masking issues on other OS runs. GHA MacOS builds will still fail.\n', 'language_name': 'Shell', 'license': 'apache-2.0', 'hunks': '@@ -18,6 +18,8 @@\n #\n \n jobs:\n+  allow_failures:\n+  - os: osx\n   include:\n   - os: linux\n     dist: xenial\n', 'addition_count': 2, 'deletion_count': 0, 'src_file': 'a/.travis.yml', 'tgt_file': 'b/.travis.yml', 'file_extension': '.yml', 'before_file': '#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# "License"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License\n#\n\njobs:\n  include:\n  - os: linux\n    dist: xenial\njobs:\n  include:\n  - compiler: gcc\n  - compiler: clang\n    # c-threaderciser test hangs on older clang\n    env:\n    - QPID_PROTON_CMAKE_ARGS=\'-DENABLE_LINKTIME_OPTIMIZATION=OFF -DTHREADERCISER=ON\'\n    - QPID_PROTON_CTEST_ARGS=\'--exclude-regex c-threaderciser\'\n  - name: static libs\n    compiler: gcc\n    env:\n    - QPID_PROTON_CMAKE_ARGS=\'-DBUILD_STATIC_LIBS=ON -DTHREADERCISER=ON\'\n  - name: benchmarks\n    compiler: gcc\n    env:\n    - QPID_PROTON_CMAKE_ARGS=\'-DENABLE_BENCHMARKS=ON -DRUNTIME_CHECK=OFF -DTHREADERCISER=ON\'\n    before_install:\n    - sudo apt-get install -y libbenchmark-dev\n  - name: gcc asan\n    before_install:\n    - sudo apt-get install -y gcc-10 g++-10\n    env:\n    - CC=gcc-10\n    - CXX=g++-10\n    # python-tox-test fails and ruby tests segfault\n    - QPID_PROTON_CMAKE_ARGS=\'-DRUNTIME_CHECK=asan -DENABLE_TOX_TEST=OFF -DTHREADERCISER=ON\'\n    - QPID_PROTON_CTEST_ARGS=\'-E ^ruby.*\'\n  - name: clang asan\n    before_install:\n    - sudo apt-get install -y clang-11 llvm-11-dev\n    env:\n    - CC=clang-11\n    - CXX=clang++-11\n    - QPID_PROTON_CMAKE_ARGS=\'-DRUNTIME_CHECK=asan -DENABLE_TOX_TEST=OFF -DTHREADERCISER=ON\'\n    # otherwise, on Travis ldd gives `libclang_rt.asan-x86_64.so => not found` and binaries don\'t work\n    - LD_LIBRARY_PATH=/usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/\n  - name: gcc tsan\n    before_install:\n    - sudo apt-get install -y gcc-10 g++-10\n    env:\n    - CC=gcc-10\n    - CXX=g++-10\n    - QPID_PROTON_CMAKE_ARGS=\'-DRUNTIME_CHECK=tsan -DTHREADERCISER=ON\'\n    # python-test, python-pep8-test, python-integration-test, and python-tox-test (currently all python tests) segfault\n    - QPID_PROTON_CTEST_ARGS="-E \'python.*test\'"\n  - name: coverage\n    dist: bionic\n    compiler: gcc\n    env:\n    - QPID_PROTON_CMAKE_ARGS=\'-DCMAKE_BUILD_TYPE=Coverage -DTHREADERCISER=ON\'\n    after_success:\n    - bash <(curl -s https://codecov.io/bash)\n\n  - os: osx\n    osx_image: xcode12.2\n    compiler: clang\n    env:\n    - PATH="/usr/local/opt/python/libexec/bin:/usr/local/bin:$PATH"\n    - PKG_CONFIG_PATH=\'/usr/local/opt/openssl@1.1/lib/pkgconfig\'\n    - QPID_PROTON_CMAKE_ARGS=\'-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DTHREADERCISER=ON\'\n    # TODO PROTON-2225: c-threaderciser sometimes fails with assertion error\n    # python-tox-test segfaults and ruby tests do not start due to dynamic library issues\n    - QPID_PROTON_CTEST_ARGS="--exclude-regex \'c-threaderciser|python-tox-test|ruby.*\'"\n\naddons:\n  # Ubuntu APT dependencies, https://packages.ubuntu.com/\n  apt:\n    packages:\n    - cmake\n    - libssl-dev\n    - libsasl2-dev\n    - sasl2-bin\n    - swig\n    - python-dev\n    - ruby\n    - ruby-dev\n    - python3-dev\n    - python3-pip\n    - golang\n    - lcov\n    - libjsoncpp-dev\n  # macOS Homebrew dependencies, https://formulae.brew.sh/\n  homebrew:\n    packages:\n      - jsoncpp\n      - libuv\n      - swig\n# update:true workaround as of Feb. 22/20 as per\n# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/10\n    update: true\n\nbefore_install:\n  # install Valgrind only on Focal. On Xenial, we are getting `Illegal opcode at address 0x5152B15`\n  - if [[ "${TRAVIS_DIST}" == "focal" ]]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends install valgrind; fi\n  # install Python 3.6.8; Travis has a mechanism for this, but that would activate it in a venv, which older CMake does not deal well with\n  - if [[ "${TRAVIS_DIST}" == "bionic" ]]; then curl -sSf --retry 5 -o python-3.6.8.tar.bz2 https://storage.googleapis.com/travis-ci-language-archives/python/binaries/ubuntu/18.04/x86_64/python-3.6.8.tar.bz2; fi\n  - if [[ "${TRAVIS_DIST}" == "bionic" ]]; then sudo tar xjf python-3.6.8.tar.bz2 --directory /; fi\n  - if [[ "${TRAVIS_DIST}" == "bionic" ]]; then PATH="/opt/python/3.6.8/bin:${PATH}"; fi\n\ninstall:\n- echo "Using PYTHON=${PYTHON:=python}"\n- ${PYTHON} -m pip install --user --upgrade pip\n- ${PYTHON} -m pip install --user coverage setuptools wheel tox virtualenv flake8\n# PROTON-2125 suppress annoying deprecation warning from Minitest in Ruby tests\n- gem install minitest:4.3.2 simplecov:0.18.0 codecov\n\nbefore_script:\n- mkdir build\n- cd build\n- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DPython_EXECUTABLE="$(which ${PYTHON})" ${QPID_PROTON_CMAKE_ARGS}\n\nscript:\n# travis timeouts a job after 600 s elapses without any new output being printed; use 360 s here to preempt that\n- cmake --build . --target install -- -j$(nproc) && eval ctest --timeout 360 -V ${QPID_PROTON_CTEST_ARGS}\n', 'message': 'PROTON-2351: allow Travis based OSX runs not to fail the overall job for now, to help avoid masking issues on other OS runs. GHA MacOS builds will still fail.\n', 'author_name': 'Robbie Gemmell', 'lang': 'travis'}