Skip to content

Commit 2c11b52

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. LLVM is keg-only now, so we need to add CPPFLAGS / LDFLAGS to the keg subdir inside /usr/local
1 parent 9fd5eb6 commit 2c11b52

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/macos.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ 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:
39-
CPPFLAGS: "-I/usr/local/include"
40-
LDFLAGS: "-L/usr/local/lib"
41+
CPPFLAGS: "-I/usr/local/include -I$(brew --prefix llvm@14)/include"
42+
LDFLAGS: "-L/usr/local/lib -L$(brew --prefix llvm@14)/lib"
4143
MESON_CI_JOBNAME: unittests-appleclang
4244
MESON_UNIT_TEST_BACKEND: ninja
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,20 +71,22 @@ 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
7680
python3 -m pip install cython coverage codecov
7781
- env:
78-
CPPFLAGS: "-I/usr/local/include"
79-
LDFLAGS: "-L/usr/local/lib"
82+
CPPFLAGS: "-I/usr/local/include -I$(brew --prefix llvm@14)/include"
83+
LDFLAGS: "-L/usr/local/lib -L$(brew --prefix llvm@14)/lib"
8084
MESON_ARGS: --unity=${{ matrix.unity }}
8185
CI: 1
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

0 commit comments

Comments
 (0)