Skip to content

Commit 880eb62

Browse files
committed
Add clang 18 to ci
1 parent bd72e91 commit 880eb62

File tree

3 files changed

+95
-12
lines changed

3 files changed

+95
-12
lines changed

.github/workflows/ci.yml

+86-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24+
- name: ubu22-x86-gcc12-clang-repl-18-cppyy
25+
os: ubuntu-22.04
26+
compiler: gcc-12
27+
clang-runtime: '18'
28+
cling: Off
29+
cppyy: On
30+
coverage: true
31+
- name: ubu22-x86-gcc12-clang-repl-18-xeus-clang-repl
32+
os: ubuntu-22.04
33+
compiler: gcc-12
34+
clang-runtime: '18'
35+
cling: Off
36+
cppyy: On
37+
xeus-clang-repl: On
38+
coverage: true
2439
- name: ubu22-x86-gcc12-clang-repl-17-cppyy
2540
os: ubuntu-22.04
2641
compiler: gcc-12
@@ -70,6 +85,19 @@ jobs:
7085
coverage: true
7186
#Commented out until Ubuntu on arm Github runner becomes available
7287
#os key to be replaced once known
88+
#- name: ubu22-arm-gcc12-clang-repl-18-cppyy
89+
# os: ubuntu-22.04-arm
90+
# compiler: gcc-12
91+
# clang-runtime: '18'
92+
# cling: Off
93+
# cppyy: On
94+
#- name: ubu22-arm-gcc12-clang-repl-18-xeus-clang-repl
95+
# os: ubuntu-22.04-arm
96+
# compiler: gcc-12
97+
# clang-runtime: '18'
98+
# cling: Off
99+
# cppyy: On
100+
# xeus-clang-repl: On
73101
#- name: ubu22-arm-gcc12-clang-repl-17-cppyy
74102
# os: ubuntu-22.04-arm
75103
# compiler: gcc-12
@@ -114,6 +142,12 @@ jobs:
114142
# xeus-clang-repl: On
115143
#FIXME: Windows CppInterOp tests expected to fail
116144
#until https://github.com/compiler-research/CppInterOp/issues/188 is solved
145+
- name: win2022-msvc-clang-repl-18
146+
os: windows-2022
147+
compiler: msvc
148+
clang-runtime: '18'
149+
cling: Off
150+
cppyy: Off
117151
- name: win2022-msvc-clang-repl-17
118152
os: windows-2022
119153
compiler: msvc
@@ -152,6 +186,19 @@ jobs:
152186
# cling: On
153187
# cling-version: '1.0'
154188
# cppyy: On
189+
- name: osx14-arm-clang-clang-repl-18-cppyy
190+
os: macos-14
191+
compiler: clang
192+
clang-runtime: '18'
193+
cling: Off
194+
cppyy: On
195+
- name: osx14-arm-clang-clang-repl-18-xeus-clang-repl
196+
os: macos-14
197+
compiler: clang
198+
clang-runtime: '18'
199+
cling: Off
200+
cppyy: On
201+
xeus-clang-repl: On
155202
- name: osx14-arm-clang-clang-repl-17-cppyy
156203
os: macos-14
157204
compiler: clang
@@ -193,6 +240,19 @@ jobs:
193240
cling-version: '1.0'
194241
cppyy: On
195242
xeus-clang-repl: On
243+
- name: osx13-x86-clang-clang-repl-18-cppyy
244+
os: macos-13
245+
compiler: clang
246+
clang-runtime: '18'
247+
cling: Off
248+
cppyy: On
249+
- name: osx13-x86-clang-clang-repl-18-xeus-clang-repl
250+
os: macos-13
251+
compiler: clang
252+
clang-runtime: '18'
253+
cling: Off
254+
cppyy: On
255+
xeus-clang-repl: On
196256
- name: osx13-x86-clang-clang-repl-17-cppyy
197257
os: macos-13
198258
compiler: clang
@@ -454,8 +514,11 @@ jobs:
454514
cmake --build . --target gtest_main --parallel ${{ env.ncpus }}
455515
else
456516
# Apply patches
457-
git apply -v ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
458-
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
517+
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
518+
if [[ "${llvm_vers}" != "18" ]]; then
519+
git apply -v ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
520+
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
521+
fi
459522
cd build
460523
cmake -DLLVM_ENABLE_PROJECTS="clang;lld" \
461524
-DLLVM_TARGETS_TO_BUILD="WebAssembly;host;NVPTX" \
@@ -526,7 +589,7 @@ jobs:
526589
git apply -v clang16-2-CUDA.patch
527590
git apply -v clang16-3-WeakRef.patch
528591
}
529-
elseif ( "${{ matrix.clang-runtime }}" -imatch "16" )
592+
elseif ( "${{ matrix.clang-runtime }}" -imatch "17" )
530593
{
531594
git apply -v clang17-1-NewOperator.patch
532595
}
@@ -920,6 +983,11 @@ jobs:
920983
fail-fast: false
921984
matrix:
922985
include:
986+
- name: ubu22-x86-gcc12-clang-repl-18-emscripten_wasm
987+
os: ubuntu-22.04
988+
compiler: gcc-12
989+
clang-runtime: '18'
990+
cling: Off
923991
- name: ubu22-x86-gcc12-clang-repl-17-emscripten_wasm
924992
os: ubuntu-22.04
925993
compiler: gcc-12
@@ -936,6 +1004,11 @@ jobs:
9361004
clang-runtime: '13'
9371005
cling: On
9381006
cling-version: '1.0'
1007+
- name: osx14-arm-clang-clang-repl-18-emscripten_wasm
1008+
os: macos-14
1009+
compiler: clang
1010+
clang-runtime: '18'
1011+
cling: Off
9391012
- name: osx14-arm-clang-clang-repl-17-emscripten_wasm
9401013
os: macos-14
9411014
compiler: clang
@@ -952,6 +1025,11 @@ jobs:
9521025
clang-runtime: '13'
9531026
cling: On
9541027
cling-version: '1.0'
1028+
- name: osx13-x86-clang-clang-repl-18-emscripten_wasm
1029+
os: macos-13
1030+
compiler: clang
1031+
clang-runtime: '18'
1032+
cling: Off
9551033
- name: osx13-x86-clang-clang-repl-17-emscripten_wasm
9561034
os: macos-13
9571035
compiler: clang
@@ -1081,8 +1159,11 @@ jobs:
10811159
cmake --build . --target gtest_main --parallel ${{ env.ncpus }}
10821160
else
10831161
# Apply patches
1084-
git apply -v ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
1085-
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
1162+
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
1163+
if [[ "${llvm_vers}" != "18" ]]; then
1164+
git apply -v ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
1165+
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
1166+
fi
10861167
cd build
10871168
cmake -DLLVM_ENABLE_PROJECTS="clang;lld" \
10881169
-DLLVM_TARGETS_TO_BUILD="WebAssembly;host;NVPTX" \

CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
5656
## Define supported version of clang and llvm
5757

5858
set(CLANG_MIN_SUPPORTED 13.0)
59-
set(CLANG_MAX_SUPPORTED "17.0.x")
60-
set(CLANG_VERSION_UPPER_BOUND 17.1.0)
59+
set(CLANG_MAX_SUPPORTED "18.1.x")
60+
set(CLANG_VERSION_UPPER_BOUND 19.0.0)
6161
set(LLVM_MIN_SUPPORTED 13.0)
62-
set(LLVM_MAX_SUPPORTED "17.0.x")
63-
set(LLVM_VERSION_UPPER_BOUND 17.1.0)
62+
set(LLVM_MAX_SUPPORTED "18.1.x")
63+
set(LLVM_VERSION_UPPER_BOUND 19.0.0)
6464

6565
## Set Cmake packages search order
6666

lib/Interpreter/DynamicLibraryManager.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ namespace Cpp {
6969
for (const std::string& P : SysPaths)
7070
addSearchPath(P, /*IsUser*/ false);
7171
}
72-
72+
#if LLVM_VERSION_MAJOR < 18
73+
#define starts_with_insensitive startswith_insensitive
74+
#endif
7375
///\returns substitution of pattern in the front of original with replacement
7476
/// Example: substFront("@rpath/abc", "@rpath/", "/tmp") -> "/tmp/abc"
7577
static std::string substFront(StringRef original, StringRef pattern,
7678
StringRef replacement) {
77-
if (!original.startswith_insensitive(pattern))
79+
if (!original.starts_with_insensitive(pattern))
7880
return original.str();
7981
SmallString<512> result(replacement);
8082
result.append(original.drop_front(pattern.size()));
@@ -300,7 +302,7 @@ namespace Cpp {
300302
// Subst all known linker variables ($origin, @rpath, etc.)
301303
#ifdef __APPLE__
302304
// On MacOS @rpath is preplaced by all paths in RPATH one by one.
303-
if (libStem.startswith_insensitive("@rpath")) {
305+
if (libStem.starts_with_insensitive("@rpath")) {
304306
for (auto& P : RPath) {
305307
std::string result = substFront(libStem, "@rpath", P);
306308
if (isSharedLibrary(result))

0 commit comments

Comments
 (0)