From 60a2d9cc7f93a89c5728f487de990537834d777f Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:55:45 +0000 Subject: [PATCH] Update ci.yml to use MacOS 15 for arm osx jobs (#364) --- .github/workflows/ci.yml | 107 ++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5371c263..7b75a1be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,40 +86,40 @@ jobs: cppyy: Off llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - - name: osx14-arm-clang-clang-repl-19 - os: macos-14 + - name: osx15-arm-clang-clang-repl-19 + os: macos-15 compiler: clang clang-runtime: '19' cling: Off cppyy: On llvm_enable_projects: "clang;lld" llvm_targets_to_build: "WebAssembly;host;NVPTX" - - name: osx14-arm-clang-clang-repl-18 - os: macos-14 + - name: osx15-arm-clang-clang-repl-18 + os: macos-15 compiler: clang clang-runtime: '18' cling: Off cppyy: On llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - - name: osx14-arm-clang-clang-repl-17 - os: macos-14 + - name: osx15-arm-clang-clang-repl-17 + os: macos-15 compiler: clang clang-runtime: '17' cling: Off cppyy: On llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - - name: osx14-arm-clang-clang-repl-16 - os: macos-14 + - name: osx15-arm-clang-clang-repl-16 + os: macos-15 compiler: clang clang-runtime: '16' cling: Off cppyy: On llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - - name: osx14-arm-clang-clang13-cling - os: macos-14 + - name: osx15-arm-clang-clang13-cling + os: macos-15 compiler: clang clang-runtime: '13' cling: On @@ -291,13 +291,31 @@ jobs: echo "CC=gcc-${vers}" >> $GITHUB_ENV echo "CXX=g++-${vers}" >> $GITHUB_ENV else - echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV - #Use clang-15 and clang++-15 compiler that is installed on runner, instead of one - #provided by MacOS (could brew install clang-16/17 to use consistent version - #of clang) - echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV - echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV + export ARCHITECHURE=$(uname -m) + if [[ "$ARCHITECHURE" == "arm64" ]]; then + cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') + if [[ "${cling_on}" == "ON" ]]; then + brew install llvm@15 + brew remove llvm@18 + brew cleanup + #FIXME: Do not believe setting all these environment variables are necessary + # They were set to avoid using Xcodes libc++ and to stop CppInterOp using llvm@18 in tests + echo 'LDFLAGS="-L/opt/homebrew/opt/llvm@15/lib/ -L/opt/homebrew/opt/llvm@15/c++/"' >> $GITHUB_ENV + echo 'CPPFLAGS="-I/opt/homebrew/opt/llvm@15/include"' >> $GITHUB_ENV + echo 'CPATH="/opt/homebrew/include/"' >> $GITHUB_ENV + echo 'LIBRARY_PATH="/opt/homebrew/lib/"' >> $GITHUB_ENV + echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV + echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV + else + echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV + echo "CXX=$(brew --prefix llvm@18)/bin/clang++" >> $GITHUB_ENV + fi + else + echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV + echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV + fi fi + echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV env: compiler: ${{ matrix.compiler }} @@ -345,10 +363,11 @@ jobs: if: ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }} run: | brew update - brew remove ruby@3.0 export ARCHITECHURE=$(uname -m) if [[ "$ARCHITECHURE" != "x86_64" ]]; then brew remove unxip + else + brew remove ruby@3.0 fi # workaround for https://github.com/actions/setup-python/issues/577 for pkg in $(brew list | grep '^python@'); do @@ -585,32 +604,32 @@ jobs: # clang-runtime: '17' # cling: Off # cppyy: On - - name: osx14-arm-clang-clang-repl-19-cppyy - os: macos-14 + - name: osx15-arm-clang-clang-repl-19-cppyy + os: macos-15 compiler: clang clang-runtime: '19' cling: Off cppyy: On - - name: osx14-arm-clang-clang-repl-18-cppyy - os: macos-14 + - name: osx15-arm-clang-clang-repl-18-cppyy + os: macos-15 compiler: clang clang-runtime: '18' cling: Off cppyy: On - - name: osx14-arm-clang-clang-repl-17-cppyy - os: macos-14 + - name: osx15-arm-clang-clang-repl-17-cppyy + os: macos-15 compiler: clang clang-runtime: '17' cling: Off cppyy: On - - name: osx14-arm-clang-clang-repl-16 - os: macos-14 + - name: osx15-arm-clang-clang-repl-16 + os: macos-15 compiler: clang clang-runtime: '16' cling: Off cppyy: Off - - name: osx14-arm-clang-clang13-cling-cppyy - os: macos-14 + - name: osx15-arm-clang-clang13-cling-cppyy + os: macos-15 compiler: clang clang-runtime: '13' cling: On @@ -761,11 +780,29 @@ jobs: echo "CXX=g++-${vers}" >> $GITHUB_ENV else echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV - #Use clang-15 and clang++-15 compiler that is installed on runner, instead of one - #provided by MacOS (could brew install clang-16/17 to use consistent version - #of clang) - echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV - echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV + export ARCHITECHURE=$(uname -m) + if [[ "$ARCHITECHURE" == "arm64" ]]; then + cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') + if [[ "${cling_on}" == "ON" ]]; then + brew install llvm@15 + brew remove llvm@18 + brew cleanup + #FIXME: Do not believe setting all these environment variables are necessary + # They were set to avoid using Xcodes libc++ and to stop CppInterOp using llvm@18 in tests + echo 'LDFLAGS="-L/opt/homebrew/opt/llvm@15/lib/ -L/opt/homebrew/opt/llvm@15/c++/"' >> $GITHUB_ENV + echo 'CPPFLAGS="-I/opt/homebrew/opt/llvm@15/include"' >> $GITHUB_ENV + echo 'CPATH="/opt/homebrew/include/"' >> $GITHUB_ENV + echo 'LIBRARY_PATH="/opt/homebrew/lib/"' >> $GITHUB_ENV + echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV + echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV + else + echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV + echo "CXX=$(brew --prefix llvm@18)/bin/clang++" >> $GITHUB_ENV + fi + else + echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV + echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV + fi fi env: compiler: ${{ matrix.compiler }} @@ -813,9 +850,9 @@ jobs: if: runner.os == 'macOS' run: | brew update --force - brew remove ruby@3.0 export ARCHITECHURE=$(uname -m) if [[ "$ARCHITECHURE" == "x86_64" ]]; then + brew remove ruby@3.0 brew remove swiftlint else brew remove unxip @@ -1149,8 +1186,8 @@ jobs: cling: Off micromamba_shell_init: bash emsdk_ver: "3.1.45" - - name: osx14-arm-clang-clang-repl-19-emscripten_wasm - os: macos-14 + - name: osx15-arm-clang-clang-repl-19-emscripten_wasm + os: macos-15 compiler: clang clang-runtime: '19' cling: Off