Skip to content

Commit 66d94e7

Browse files
committed
ci: Fix llvm detection on macOS CI
Downgrade to LLVM-14 from LLVM-15 which is somewhat broken when using static linking at present: Homebrew/discussions#3666 (comment) We can't use LLVM's lld instead of ld on macOS because we don't detect it as an Apple linker and pass --as-needed etc to it. Even when that is fixed and we set -lto_library etc correctly, the linker just hangs. LLVM@14 is keg-only, so we need to add CPPFLAGS / LDFLAGS to the keg subdir inside /usr/local The LLVM@15 test is shared-only now and moved to the qt4 macOS job.
1 parent a58315a commit 66d94e7

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

.github/workflows/macos.yml

+27-12
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
- run: |
3535
python -m pip install --upgrade pip
3636
python -m pip install pytest pytest-xdist pytest-subtests jsonschema coverage codecov
37-
- run: brew install pkg-config ninja llvm qt@5
37+
# Use llvm-14 for now to fix llvm framework static tests, see
38+
# https://github.com/Homebrew/discussions/discussions/3666#discussioncomment-3681821
39+
- run: brew install pkg-config ninja llvm@14 qt@5
3840
- env:
3941
CPPFLAGS: "-I/usr/local/include"
4042
LDFLAGS: "-L/usr/local/lib"
@@ -43,7 +45,7 @@ jobs:
4345
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
4446
run: |
4547
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
46-
export PATH="$HOME/tools:/usr/local/opt/qt@5/bin:$PATH:$(brew --prefix llvm)/bin"
48+
export PATH="$HOME/tools:/usr/local/opt/qt@5/bin:$PATH:$(brew --prefix llvm@14)/bin"
4749
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH"
4850
./tools/run_with_cov.py ./run_unittests.py
4951
- name: Upload coverage report
@@ -69,7 +71,9 @@ jobs:
6971
- uses: actions/checkout@v2
7072
# use python3 from homebrew because it is a valid framework, unlike the actions one:
7173
# https://github.com/actions/setup-python/issues/58
72-
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 python3 boost-python3 gtk-doc
74+
# Use llvm-14 for now to fix llvm framework static tests, see
75+
# https://github.com/Homebrew/discussions/discussions/3666#discussioncomment-3681821
76+
- run: brew install pkg-config ninja llvm@14 qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 python3 boost-python3 gtk-doc
7377
- run: |
7478
python3 -m pip install --upgrade setuptools
7579
python3 -m pip install --upgrade pip
@@ -82,37 +86,48 @@ jobs:
8286
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
8387
run: |
8488
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
85-
export PATH="$HOME/tools:/usr/local/opt/qt@5/bin:$PATH:$(brew --prefix llvm)/bin"
89+
export PATH="$HOME/tools:/usr/local/opt/qt@5/bin:$PATH:$(brew --prefix llvm@14)/bin"
8690
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH"
8791
export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"
8892
./tools/run_with_cov.py ./run_project_tests.py --backend=ninja
8993
- name: Upload coverage report
9094
run: ./ci/upload_cov.sh "appleclang [project tests; unity=${{ matrix.unity }}]"
9195

92-
Qt4macos:
96+
Qt4_LLVM15_macos:
9397
runs-on: macos-latest
9498
steps:
9599
- uses: actions/checkout@v2
96100
- uses: actions/setup-python@v2
97101
with:
98102
python-version: '3.x'
99103
- run: python -m pip install -e .
100-
- run: brew install pkg-config ninja gcc
104+
- run: brew install pkg-config ninja gcc llvm
101105
- run: brew tap cartr/qt4
102106
- run: brew install qt@4
103107
- run: brew link qt@4
104-
# qt4 tap seems to be broken
108+
# qt4 tap seems to be broken
105109
- run: ln -sfn /usr/local/Cellar/qt@4/4.8.7_6.reinstall /usr/local/Cellar/qt@4/4.8.7_6
106-
- run: meson setup "test cases/frameworks/4 qt" build -Drequired=qt4
107-
- run: meson compile -C build
110+
- run: meson setup "test cases/frameworks/4 qt" build_qt -Drequired=qt4
111+
- run: meson compile -C build_qt
108112
- uses: actions/upload-artifact@v1
109113
if: failure()
110114
with:
111115
name: Qt4_Mac_build
112-
path: build/meson-logs/meson-log.txt
113-
- run: meson test -C build -v
116+
path: build_qt/meson-logs/meson-log.txt
117+
- run: meson test -C build_qt -v
114118
- uses: actions/upload-artifact@v1
115119
if: failure()
116120
with:
117121
name: Qt4_Mac_test
118-
path: build/meson-logs/testlog.txt
122+
path: build_qt/meson-logs/testlog.txt
123+
# llvm-15 is broken, due to which static linking doesn't work
124+
# https://github.com/mesonbuild/meson/pull/10879#issuecomment-1264524936
125+
- run: |
126+
export PATH="$PATH:$(brew --prefix llvm)/bin"
127+
meson setup "test cases/frameworks/15 llvm" build_llvm -Dlink-static=false -Dmethod=config-tool
128+
- run: meson compile -C build_llvm
129+
- uses: actions/upload-artifact@v1
130+
if: failure()
131+
with:
132+
name: LLVM15_Mac_build
133+
path: build_llvm/meson-logs/meson-log.txt

0 commit comments

Comments
 (0)