Skip to content

Commit 6b70ceb

Browse files
authored
Merge pull request #1 from Totto16/update_ci
Update CI
2 parents 30621ff + 0632e90 commit 6b70ceb

File tree

3 files changed

+132
-61
lines changed

3 files changed

+132
-61
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: 59 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build CI
22

33
on:
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

.github/workflows/test.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ name: Test CI
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ['main']
66
pull_request:
77
workflow_dispatch:
88

99
jobs:
1010
test:
11-
name: Run Tests
11+
name: Run Tests
1212
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
16-
fetch-depth: "0"
16+
fetch-depth: '0'
1717

1818
- uses: actions/checkout@v4
1919
name: Checkout OOPetris main repo
2020
with:
21-
fetch-depth: "0"
21+
fetch-depth: '0'
2222
repository: OpenBrickProtocolFoundation/oopetris
2323
ref: main
2424
path: ./oopetris
@@ -28,11 +28,11 @@ 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
33-
echo "CC=clang-18" >> "$GITHUB_ENV"
34-
echo "CXX=clang++-18" >> "$GITHUB_ENV"
35-
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"
35+
3636
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
3737
- name: Setup meson
3838
run: |
@@ -41,20 +41,20 @@ jobs:
4141
- name: Install dependencies
4242
run: |
4343
sudo apt-get update
44-
sudo apt-get install ninja-build valgrind gcovr libcriterion-dev libreadline-dev -y
44+
sudo apt-get install ninja-build valgrind gcovr libcriterion-dev libreadline-dev -y --no-install-recommends
4545
46-
- name: Configure
47-
run: |
48-
cd oopetris
49-
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Donly_build_libs=true -Dprefix=/usr
46+
- name: Configure OOPetris
47+
run: |
48+
cd oopetris
49+
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Donly_build_libs=true -Dprefix=/usr
5050
5151
- name: Build and install Libs
5252
run: |
53-
cd oopetris
54-
sudo meson install -C build
53+
cd oopetris
54+
sudo meson install -C build
5555
5656
- name: Build Wrapper
57-
run: |
57+
run: |
5858
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Dtests=true -Dexample=true -Dprefix=/usr
5959
meson compile -C build
6060
@@ -70,20 +70,19 @@ jobs:
7070
path: ./build/meson-logs/coverage.xml
7171
fail: true
7272
publish: true
73-
coverage-summary-title: "Code Coverage Summary"
73+
coverage-summary-title: 'Code Coverage Summary'
7474
togglable-report: true
7575

7676
- name: Upload test coverage artifacts
7777
uses: actions/upload-artifact@v4
7878
with:
79-
name: Tests coverage artifacts
80-
path: |
81-
./build/meson-logs/coverage.xml
82-
./build/meson-logs/coveragereport/
83-
79+
name: Tests coverage artifacts
80+
path: |
81+
./build/meson-logs/coverage.xml
82+
./build/meson-logs/coveragereport/
8483
8584
- name: Test for leaks with valgrind (Linux)
86-
run: |
87-
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./tests/files/correct.rec
88-
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 cat ./tests/files/example.rec_text | ./build/example/example w ./test.rec
89-
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./test.rec
85+
run: |
86+
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./tests/files/correct.rec
87+
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 cat ./tests/files/example.rec_text | ./build/example/example w ./test.rec
88+
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./test.rec

0 commit comments

Comments
 (0)