Skip to content

Commit 0632e90

Browse files
committed
ci: update to llvm 19
also fix macos error in CI
1 parent 801dd49 commit 0632e90

File tree

3 files changed

+87
-14
lines changed

3 files changed

+87
-14
lines changed

.github/patches/gcc_14_2.diff

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From c9e05b03c18e898be604ab90401476e9c473cc52 Mon Sep 17 00:00:00 2001
2+
From: Jonathan Wakely <[email protected]>
3+
Date: Thu, 16 May 2024 17:15:55 +0100
4+
Subject: [PATCH] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator
5+
[PR115119]
6+
7+
libstdc++-v3/ChangeLog:
8+
9+
PR libstdc++/115119
10+
* include/bits/unicode.h (_Iterator::operator++(int)): Fix typo
11+
in increment expression.
12+
* testsuite/ext/unicode/grapheme_view.cc: Check post-increment
13+
on view's iterator.
14+
15+
Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=c9e05b03c18e898be604ab90401476e9c473cc52
16+
Modified paths, to make it work
17+
---
18+
bits/unicode.h | 6 ++++--
19+
1 files changed, 4 insertions(+), 2 deletions(-)
20+
21+
diff --git a/bits/unicode.h b/bits/unicode.h
22+
index 46238143fb61..a14a17c5dfcf 100644
23+
--- a/bits/unicode.h
24+
+++ b/bits/unicode.h
25+
@@ -34,10 +34,12 @@
26+
#include <array>
27+
#include <bit> // bit_width
28+
#include <charconv> // __detail::__from_chars_alnum_to_val_table
29+
+#include <string_view>
30+
#include <cstdint>
31+
#include <bits/stl_algo.h>
32+
#include <bits/stl_iterator.h>
33+
-#include <bits/ranges_base.h>
34+
+#include <bits/ranges_base.h> // iterator_t, sentinel_t, input_range, etc.
35+
+#include <bits/ranges_util.h> // view_interface
36+
37+
namespace std _GLIBCXX_VISIBILITY(default)
38+
{
39+
@@ -802,7 +804,7 @@ inline namespace __v15_1_0
40+
operator++(int)
41+
{
42+
auto __tmp = *this;
43+
- ++this;
44+
+ ++*this;
45+
return __tmp;
46+
}
47+

.github/workflows/build.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,31 @@ jobs:
108108
mingw-w64-${{matrix.config.architecture}}-cmake
109109
git
110110
111-
- name: Setup Clang (Linux)
112-
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true
111+
- name: Setup Clang (Linux) (libc++)
112+
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib
113113
run: |
114114
wget https://apt.llvm.org/llvm.sh
115115
chmod +x llvm.sh
116-
sudo ./llvm.sh 18
117-
sudo apt-get install libc++-18* libc++abi*18* -y --no-install-recommends
118-
echo "CC=clang-18" >> "$GITHUB_ENV"
119-
echo "CXX=clang++-18" >> "$GITHUB_ENV"
120-
echo "OBJC=clang-18" >> "$GITHUB_ENV"
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)
124+
run: |
125+
wget https://apt.llvm.org/llvm.sh
126+
chmod +x llvm.sh
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
121136
122137
- name: Setup GCC (Linux)
123138
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == false
@@ -130,7 +145,8 @@ jobs:
130145
if: matrix.config.os == 'macos'
131146
run: |
132147
brew update
133-
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
134150
echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH
135151
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"
136152
echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm/include" >> "$GITHUB_ENV"
@@ -141,6 +157,16 @@ jobs:
141157
echo "CXX_LD=lld" >> "$GITHUB_ENV"
142158
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
143159
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+
144170
- name: Setup meson (MacOS)
145171
if: matrix.config.os == 'macos'
146172
run: |
@@ -167,7 +193,7 @@ jobs:
167193
choco install pkgconfiglite
168194
echo "PKG_CONFIG_PATH=C:/lib/pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Append
169195
170-
- name: Configure
196+
- name: Configure OOPetris
171197
run: |
172198
cd oopetris
173199
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}/' || ''}}

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
run: |
2929
wget https://apt.llvm.org/llvm.sh
3030
chmod +x llvm.sh
31-
sudo ./llvm.sh 18
32-
sudo apt-get install libc++-18* libc++abi*18* llvm-18 -y --no-install-recommends
33-
echo "CC=clang-18" >> "$GITHUB_ENV"
34-
echo "CXX=clang++-18" >> "$GITHUB_ENV"
31+
sudo ./llvm.sh 19
32+
sudo apt-get install libc++-19* libc++abi*19* llvm-19 -y --no-install-recommends
33+
echo "CC=clang-19" >> "$GITHUB_ENV"
34+
echo "CXX=clang++-19" >> "$GITHUB_ENV"
3535
3636
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
3737
- name: Setup meson
@@ -43,7 +43,7 @@ jobs:
4343
sudo apt-get update
4444
sudo apt-get install ninja-build valgrind gcovr libcriterion-dev libreadline-dev -y --no-install-recommends
4545
46-
- name: Configure
46+
- name: Configure OOPetris
4747
run: |
4848
cd oopetris
4949
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Donly_build_libs=true -Dprefix=/usr

0 commit comments

Comments
 (0)