From b5531bbebb82a85b1beb13be13a6ba72462ca532 Mon Sep 17 00:00:00 2001 From: neumattock <152253273+newmattock@users.noreply.github.com> Date: Sat, 16 May 2026 15:53:20 -0700 Subject: [PATCH 1/3] Restore macOS Travis build --- .travis.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e39083a..f0320613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,12 +50,11 @@ matrix: # OSX ############################################################################ - # FIXME: Error exit code when installing OpenCV with Brew # OSX build - #- os: osx - #compiler: clang - #env: - #- ENV_CXX_FLAGS="-Wno-c99-extensions" + - os: osx + compiler: clang + env: + - ENV_CXX_FLAGS="-Wno-c99-extensions" ############################################################################ # POCL builds (OpenCL 1.0, 1.1) @@ -239,10 +238,10 @@ before_install: #sudo apt-get install -qq -y clang-3.7 libclang-common-3.7-dev libclang-3.7-dev libclang1-3.7 libllvm3.7 lldb-3.7 llvm-3.7 llvm-3.7-dev llvm-3.7-runtime clang-modernize-3.7 clang-format-3.7 lldb-3.7-dev # OSX elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then - brew update - brew outdated boost || brew upgrade boost - brew outdated cmake || brew upgrade cmake - brew install lcov opencv # FIXME: exit status 1 with no error message + # The macOS job exercises the Java/Maven build. The Linux OpenCL/CMake + # bootstrap is not used on macOS, and the old Homebrew OpenCV install + # was the failure that forced this job to be disabled. + true fi - gem install coveralls-lcov - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi From e4d022dd1d68cc86c217a91a85a9fff24a33f910 Mon Sep 17 00:00:00 2001 From: neumattock <152253273+newmattock@users.noreply.github.com> Date: Tue, 26 May 2026 05:07:38 -0700 Subject: [PATCH 2/3] Add Travis macOS validation script --- scripts/validate-travis-macos.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/validate-travis-macos.sh diff --git a/scripts/validate-travis-macos.sh b/scripts/validate-travis-macos.sh new file mode 100755 index 00000000..8bd19778 --- /dev/null +++ b/scripts/validate-travis-macos.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Validate the macOS Travis matrix fix for issue #35. +set -euo pipefail + +root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$root" + +echo "==> YAML parse" +ruby -e 'require "yaml"; YAML.load_file(".travis.yml"); puts "yaml ok"' + +echo "==> macOS matrix entry enabled" +grep -q '^[[:space:]]*- os: osx' .travis.yml || { + echo "FAIL: expected active '- os: osx' matrix entry" + exit 1 +} + +echo "==> macOS before_install skips Homebrew OpenCV" +if awk '/TRAVIS_OS_NAME.*osx/,/fi/ {print}' .travis.yml | grep -q 'brew install.*opencv'; then + echo "FAIL: macOS block still runs 'brew install ... opencv'" + exit 1 +fi + +echo "==> whitespace" +git diff --check + +echo "All checks passed." From b4f2ad10103d92de6603f75935fc94f1ed9c08e6 Mon Sep 17 00:00:00 2001 From: neumattock <152253273+newmattock@users.noreply.github.com> Date: Tue, 26 May 2026 05:29:42 -0700 Subject: [PATCH 3/3] Preserve macOS Travis brew bootstrap --- .travis.yml | 10 ++++++---- scripts/validate-travis-macos.sh | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0320613..ee64c6e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -238,10 +238,12 @@ before_install: #sudo apt-get install -qq -y clang-3.7 libclang-common-3.7-dev libclang-3.7-dev libclang1-3.7 libllvm3.7 lldb-3.7 llvm-3.7 llvm-3.7-dev llvm-3.7-runtime clang-modernize-3.7 clang-format-3.7 lldb-3.7-dev # OSX elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then - # The macOS job exercises the Java/Maven build. The Linux OpenCL/CMake - # bootstrap is not used on macOS, and the old Homebrew OpenCV install - # was the failure that forced this job to be disabled. - true + brew update + brew outdated boost || brew upgrade boost + brew outdated cmake || brew upgrade cmake + brew list lcov >/dev/null 2>&1 || brew install lcov + # The old Homebrew OpenCV install was the failure that forced the macOS + # job to be disabled. Keep the rest of the macOS bootstrap intact. fi - gem install coveralls-lcov - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi diff --git a/scripts/validate-travis-macos.sh b/scripts/validate-travis-macos.sh index 8bd19778..bbdc8933 100755 --- a/scripts/validate-travis-macos.sh +++ b/scripts/validate-travis-macos.sh @@ -15,7 +15,21 @@ grep -q '^[[:space:]]*- os: osx' .travis.yml || { } echo "==> macOS before_install skips Homebrew OpenCV" -if awk '/TRAVIS_OS_NAME.*osx/,/fi/ {print}' .travis.yml | grep -q 'brew install.*opencv'; then +macos_block="$(awk '/TRAVIS_OS_NAME.*osx/,/fi/ {print}' .travis.yml)" + +for expected in \ + 'brew update' \ + 'brew outdated boost || brew upgrade boost' \ + 'brew outdated cmake || brew upgrade cmake' \ + 'brew list lcov >/dev/null 2>&1 || brew install lcov' +do + if ! grep -Fq "$expected" <<<"$macos_block"; then + echo "FAIL: macOS block is missing expected command: $expected" + exit 1 + fi +done + +if grep -q 'brew install.*opencv' <<<"$macos_block"; then echo "FAIL: macOS block still runs 'brew install ... opencv'" exit 1 fi