@@ -2,7 +2,7 @@ name: Build CI
22
33on :
44 push :
5- branches : [" main" ]
5+ branches : [' main' ]
66 pull_request :
77 workflow_dispatch :
88
@@ -26,14 +26,14 @@ jobs:
2626 os-version : 2022
2727 environment : mingw
2828 architecture : x86_64
29- shell : " msys2 {0}"
29+ shell : ' msys2 {0}'
3030
3131 - name : Windows UCRT Release
3232 os : windows
3333 os-version : 2022
3434 environment : ucrt
3535 architecture : ucrt-x86_64
36- shell : " msys2 {0}"
36+ shell : ' msys2 {0}'
3737
3838 - name : Linux Release
3939 os : ubuntu
@@ -74,17 +74,17 @@ jobs:
7474 steps :
7575 - uses : actions/checkout@v4
7676 with :
77- fetch-depth : " 0 "
77+ fetch-depth : ' 0 '
7878
7979 - uses : actions/checkout@v4
80- name : Checkout OOPetris main repo
80+ name : Checkout OOPetris main repo
8181 with :
82- fetch-depth : " 0 "
82+ fetch-depth : ' 0 '
8383 repository : OpenBrickProtocolFoundation/oopetris
8484 ref : main
8585 path : ./oopetris
8686 submodules : false
87-
87+
8888 - name : Setup MSVC (Windows)
8989 if : matrix.config.os == 'windows' && matrix.config.environment == 'msvc'
9090 uses : TheMrMilchmann/setup-msvc-dev@v3
@@ -107,31 +107,46 @@ jobs:
107107 mingw-w64-${{matrix.config.architecture}}-ca-certificates
108108 mingw-w64-${{matrix.config.architecture}}-cmake
109109 git
110-
111- - name : Setup Clang (Linux)
112- if : matrix.config.os == 'ubuntu' && matrix.config.use-clang == true
110+
111+ - name : Setup Clang (Linux) (libc++)
112+ if : matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib
113+ run : |
114+ wget https://apt.llvm.org/llvm.sh
115+ chmod +x llvm.sh
116+ sudo ./llvm.sh 19
117+ sudo apt-get install libc++-19* libc++abi*19* -y --no-install-recommends
118+ echo "CC=clang-19" >> "$GITHUB_ENV"
119+ echo "CXX=clang++-19" >> "$GITHUB_ENV"
120+ echo "OBJC=clang-19" >> "$GITHUB_ENV"
121+
122+ - name : Setup Clang (Linux) (libstdc++)
123+ if : matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && (! matrix.config.use-clang_stdlib)
113124 run : |
114125 wget https://apt.llvm.org/llvm.sh
115126 chmod +x llvm.sh
116- sudo ./llvm.sh 18
117- sudo apt-get install libc++-18* libc++abi*18* -y
118- echo "CC=clang-18" >> "$GITHUB_ENV"
119- echo "CXX=clang++-18" >> "$GITHUB_ENV"
120- echo "OBJC=clang-18" >> "$GITHUB_ENV"
121-
122-
127+ sudo ./llvm.sh 19
128+ echo "CC=clang-19" >> "$GITHUB_ENV"
129+ echo "CXX=clang++-19" >> "$GITHUB_ENV"
130+ echo "OBJC=clang-19" >> "$GITHUB_ENV"
131+ # Patch the libstd++ library, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115119
132+ # This is a dirty workaround, but it is needed, since gcc 14.2 (where this was patched usptream) is not easily available
133+ # If we use the oracular (Ubuntu 24.10) repos, we could install gcc 14.2, but clang-19 isn't compatible with that
134+ # TODO: remove this, after it works again
135+ sudo patch -p1 /usr/include/c++/14/bits/unicode.h .github/patches/gcc_14_2.diff
136+
123137 - name : Setup GCC (Linux)
124138 if : matrix.config.os == 'ubuntu' && matrix.config.use-clang == false
125139 uses : egor-tensin/setup-gcc@v1
126140 with :
127141 version : 14
128142 platform : x64
129-
143+
130144 - name : Setup Clang (MacOS)
131145 if : matrix.config.os == 'macos'
132146 run : |
133147 brew update
134- brew install llvm@18
148+ # TODO annotate with lld@19, after that is accepted, we don't want to use lld@20 without manually updating it !
149+ brew install llvm@19 lld
135150 echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH
136151 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"
137152 echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm/include" >> "$GITHUB_ENV"
@@ -142,12 +157,22 @@ jobs:
142157 echo "CXX_LD=lld" >> "$GITHUB_ENV"
143158 echo "OBJC_LD=lld" >> "$GITHUB_ENV"
144159
160+ - name : Unbreak Python in GHA (MacOS 13 image)
161+ if : matrix.config.os == 'macos' && matrix.config.os-version == 13
162+ run : |
163+ # TODO: remove this, after it works again
164+ # A workaround for "The `brew link` step did not complete successfully" error.
165+ # See e.g. https://github.com/Homebrew/homebrew-core/issues/165793#issuecomment-1991817938
166+ find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
167+ sudo rm -rf /Library/Frameworks/Python.framework/
168+ brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
169+
145170 - name : Setup meson (MacOS)
146- if : matrix.config.os == 'macos'
171+ if : matrix.config.os == 'macos'
147172 run : |
148173 brew update
149174 brew install meson
150-
175+
151176 # NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
152177 - name : Setup meson
153178 if : matrix.config.os != 'macos'
@@ -158,7 +183,7 @@ jobs:
158183 if : matrix.config.os == 'ubuntu'
159184 run : |
160185 sudo apt-get update
161- sudo apt-get install ninja-build libreadline-dev -y
186+ sudo apt-get install ninja-build libreadline-dev -y --no-install-recommends
162187 sudo pip install meson --break-system-packages
163188
164189 - name : Fix pkg-config (Windows MSVC)
@@ -168,24 +193,24 @@ jobs:
168193 choco install pkgconfiglite
169194 echo "PKG_CONFIG_PATH=C:/lib/pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Append
170195
171- - name : Configure
172- run : |
173- cd oopetris
174- meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }} ${{ (matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )) && '-Dprefix=$RUNNER_TEMP/msys64${MINGW_PREFIX}/' || ''}}
196+ - name : Configure OOPetris
197+ run : |
198+ cd oopetris
199+ meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }} ${{ (matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )) && '-Dprefix=$RUNNER_TEMP/msys64${MINGW_PREFIX}/' || ''}}
175200
176201 - name : Build and install Libs
177202 if : matrix.config.os != 'ubuntu'
178- run : |
179- cd oopetris
180- meson install -C build
203+ run : |
204+ cd oopetris
205+ meson install -C build
181206
182207 - name : Build and install Libs (Linux)
183208 if : matrix.config.os == 'ubuntu'
184- run : |
185- cd oopetris
186- sudo meson install -C build
209+ run : |
210+ cd oopetris
211+ sudo meson install -C build
187212
188213 - name : Build Wrapper
189- run : |
190- meson setup -Dtests=false -Dexample=true build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }}
214+ run : |
215+ meson setup -Dtests=false -Dexample=true build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }}
191216 meson compile -C build
0 commit comments