Multiple os: and osx_version: replicates linux entries in build matrix:

Hi,

I’m trying to test builds across linux, mutliple GCC versions, and OSX, gcc and clang versions.

I have the following .travis.yml config, which generates all my entries, but also generates double the required entries for linux, as osx_image is done for os: osx and os: linux.

This looks like a bug to me.

language: cpp
cache: ccache
dist: xenial

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
      - llvm-toolchain-xenial-3.6
      - llvm-toolchain-xenial-3.7
      - llvm-toolchain-xenial-3.8
      - llvm-toolchain-xenial-3.9
      - llvm-toolchain-xenial-4.0
      - llvm-toolchain-xenial-5.0
      - llvm-toolchain-xenial-6.0
      - llvm-toolchain-xenial-7
      - llvm-toolchain-xenial-8
      - sourceline: 'ppa:jonathonf/meson'
      - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main'
        key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
    packages:
      - cmake
      - ninja-build
      - libgl1-mesa-dev
      - g++-5
      - g++-6
      - g++-7
      - g++-8
      - g++-9
      - gcc-5
      - gcc-6
      - gcc-7
      - gcc-8
      - gcc-9
      - clang-3.6
      - clang-3.7
      - clang-3.8
      - clang-3.9
      - clang-4.0
      - clang-5.0
      - clang-6.0
      - clang-7
      - clang-8
  homebrew:
    packages:
      - cmake
      - ccache
      - ninja
      - gcc@5
      - gcc@6
      - gcc@7
      - gcc@8
      - gcc@9
    update: true

os:
  - linux
  - osx

osx_image:
  - xcode9.4
  - xcode10.2

env:
  - MATRIX_EVAL="export CC=gcc-5 && export CXX=g++-5"
  - MATRIX_EVAL="export CC=gcc-6 && export CXX=g++-6"
  - MATRIX_EVAL="export CC=gcc-7 && export CXX=g++-7"
  - MATRIX_EVAL="export CC=gcc-8 && export CXX=g++-8"
  - MATRIX_EVAL="export CC=gcc-9 && export CXX=g++-9"
  - MATRIX_EVAL="export CC=clang-3.6 && export CXX=clang++-3.6"
  - MATRIX_EVAL="export CC=clang-3.7 && export CXX=clang++-3.7"
  - MATRIX_EVAL="export CC=clang-3.8 && export CXX=clang++-3.8"
  - MATRIX_EVAL="export CC=clang-3.9 && export CXX=clang++-3.9"
  - MATRIX_EVAL="export CC=clang-4.0 && export CXX=clang++-4.0"
  - MATRIX_EVAL="export CC=clang-5.0 && export CXX=clang++-5.0"
  - MATRIX_EVAL="export CC=clang-6.0 && export CXX=clang++-6.0"
  - MATRIX_EVAL="export CC=clang-7 && export CXX=clang++-7"
  - MATRIX_EVAL="export CC=clang-8 && export CXX=clang++-8"
  - MATRIX_EVAL=""

matrix:
  exclude:
    - os: osx
      env: MATRIX_EVAL="export CC=clang-3.6 && export CXX=clang++-3.6"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-3.7 && export CXX=clang++-3.7"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-3.8 && export CXX=clang++-3.8"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-3.9 && export CXX=clang++-3.9"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-4.0 && export CXX=clang++-4.0"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-5.0 && export CXX=clang++-5.0"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-6.0 && export CXX=clang++-6.0"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-7 && export CXX=clang++-7"
    - os: osx
      env: MATRIX_EVAL="export CC=clang-8 && export CXX=clang++-8"
    - os: linux
      env: MATRIX_EVAL=""
    - os: osx
      osx_image: xcode9.4
      env: MATRIX_EVAL="export CC=gcc-5 && export CXX=g++-5"

before_install:
    - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then wget https://launchpad.net/ubuntu/+source/ccache/3.7.1-1/+build/16720092/+files/ccache_3.7.1-1_amd64.deb && sudo dpkg -i ccache_3.7.1-1_amd64.deb; fi
    - eval "${MATRIX_EVAL}"

script:
  - |
    mkdir -p build && cd build && \
    export PATH=\"$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}')\" && \
    cmake -GNinja -DRUN_LONG_TESTS=OFF -DRUN_SHORT_TESTS=ON .. && \
    travis_wait 90 ninja -v && \
    cd ANTS-build && ctest

1 Like

My build output:
https://travis-ci.org/gdevenyi/ANTs/builds/552319994

As you can see, the build matrix has entries twice, once for osx_image: xcode9.4, and once for osx_image: xcode10.2.

Of course, osx_image shouldn’t be expanded across linux at all, it should be nested in os: osx, but that doens’t seem to be allowed.

It looks like https://github.com/travis-ci/travis-yml is the module responsible for matrix expansion.

It is not. The app that’s responsible is not open source at the moment.

1 Like
Imprint