Skip to content

Commit e6aa09e

Browse files
authored
Merge pull request #181 from OpenBrickProtocolFoundation/ci_fix_macos_compilation
CI: fix MacOS build
2 parents a2bf742 + e4f9072 commit e6aa09e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,32 @@ jobs:
144144
run: |
145145
brew update
146146
brew install llvm@18
147-
echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH
148-
echo "LDFLAGS=-L$(brew --prefix)/opt/llvm/lib -L$(brew --prefix)/opt/llvm/lib/c++ -Wl,-rpath,$(brew --prefix)/opt/llvm/lib/c++" >> "$GITHUB_ENV"
149-
echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm/include" >> "$GITHUB_ENV"
147+
echo "$(brew --prefix)/opt/llvm@18/bin" >> $GITHUB_PATH
148+
echo "LDFLAGS=-L$(brew --prefix)/opt/llvm@18/lib -L$(brew --prefix)/opt/llvm@18/lib/c++ -Wl,-rpath,$(brew --prefix)/opt/llvm@18/lib/c++" >> "$GITHUB_ENV"
149+
echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm@18/include" >> "$GITHUB_ENV"
150150
echo "CC=clang" >> "$GITHUB_ENV"
151151
echo "CXX=clang++" >> "$GITHUB_ENV"
152152
echo "OBJC=clang" >> "$GITHUB_ENV"
153153
echo "CC_LD=lld" >> "$GITHUB_ENV"
154154
echo "CXX_LD=lld" >> "$GITHUB_ENV"
155155
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
156156
157+
- name: Unbreak Python in GHA (MacOS 13 image)
158+
if: matrix.config.os == 'macos' && matrix.config.os-version == 13
159+
run: |
160+
# TODO: remove this, after it works again
161+
# A workaround for "The `brew link` step did not complete successfully" error.
162+
# See e.g. https://github.com/Homebrew/homebrew-core/issues/165793#issuecomment-1991817938
163+
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
164+
sudo rm -rf /Library/Frameworks/Python.framework/
165+
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
166+
157167
- name: Setup meson (MacOS)
158-
if: matrix.config.os == 'macos'
168+
if: matrix.config.os == 'macos'
159169
run: |
160170
brew update
161171
brew install meson
162-
172+
163173
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
164174
- name: Setup meson
165175
if: matrix.config.os != 'macos'

0 commit comments

Comments
 (0)