Skip to content

Commit f794dee

Browse files
authored
Reduce size of llvm cache by not build webassembly target for llvm<19 (#357)
1 parent 5ac8e62 commit f794dee

File tree

1 file changed

+49
-85
lines changed

1 file changed

+49
-85
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -27,111 +27,147 @@ jobs:
2727
clang-runtime: '19'
2828
cling: Off
2929
cppyy: On
30+
llvm_enable_projects: "clang;lld"
31+
llvm_targets_to_build: "WebAssembly;host;NVPTX"
3032
- name: ubu22-x86-gcc12-clang-repl-18
3133
os: ubuntu-22.04
3234
compiler: gcc-12
3335
clang-runtime: '18'
3436
cling: Off
3537
cppyy: On
38+
llvm_enable_projects: "clang"
39+
llvm_targets_to_build: "host;NVPTX"
3640
- name: ubu22-x86-gcc12-clang-repl-17
3741
os: ubuntu-22.04
3842
compiler: gcc-12
3943
clang-runtime: '17'
4044
cling: Off
4145
cppyy: On
46+
llvm_enable_projects: "clang"
47+
llvm_targets_to_build: "host;NVPTX"
4248
- name: ubu22-x86-gcc12-clang-repl-16
4349
os: ubuntu-22.04
4450
compiler: gcc-12
4551
clang-runtime: '16'
4652
cling: Off
4753
cppyy: On
54+
llvm_enable_projects: "clang"
55+
llvm_targets_to_build: "host;NVPTX"
4856
- name: ubu22-x86-gcc9-clang13-cling
4957
os: ubuntu-22.04
5058
compiler: gcc-9
5159
clang-runtime: '13'
5260
cling: On
5361
cling-version: '1.0'
5462
cppyy: On
63+
llvm_enable_projects: "clang"
64+
llvm_targets_to_build: "host;NVPTX"
5565
- name: win2022-msvc-clang-repl-19
5666
os: windows-2022
5767
compiler: msvc
5868
clang-runtime: '19'
5969
cling: Off
6070
cppyy: Off
71+
llvm_enable_projects: "clang"
72+
llvm_targets_to_build: "host;NVPTX"
6173
- name: win2022-msvc-clang-repl-18
6274
os: windows-2022
6375
compiler: msvc
6476
clang-runtime: '18'
6577
cling: Off
6678
cppyy: Off
79+
llvm_enable_projects: "clang"
80+
llvm_targets_to_build: "host;NVPTX"
6781
- name: win2022-msvc-clang-repl-17
6882
os: windows-2022
6983
compiler: msvc
7084
clang-runtime: '17'
7185
cling: Off
7286
cppyy: Off
87+
llvm_enable_projects: "clang"
88+
llvm_targets_to_build: "host;NVPTX"
7389
- name: osx14-arm-clang-clang-repl-19
7490
os: macos-14
7591
compiler: clang
7692
clang-runtime: '19'
7793
cling: Off
7894
cppyy: On
95+
llvm_enable_projects: "clang;lld"
96+
llvm_targets_to_build: "WebAssembly;host;NVPTX"
7997
- name: osx14-arm-clang-clang-repl-18
8098
os: macos-14
8199
compiler: clang
82100
clang-runtime: '18'
83101
cling: Off
84102
cppyy: On
103+
llvm_enable_projects: "clang"
104+
llvm_targets_to_build: "host;NVPTX"
85105
- name: osx14-arm-clang-clang-repl-17
86106
os: macos-14
87107
compiler: clang
88108
clang-runtime: '17'
89109
cling: Off
90110
cppyy: On
111+
llvm_enable_projects: "clang"
112+
llvm_targets_to_build: "host;NVPTX"
91113
- name: osx14-arm-clang-clang-repl-16
92114
os: macos-14
93115
compiler: clang
94116
clang-runtime: '16'
95117
cling: Off
96118
cppyy: On
119+
llvm_enable_projects: "clang"
120+
llvm_targets_to_build: "host;NVPTX"
97121
- name: osx14-arm-clang-clang13-cling
98122
os: macos-14
99123
compiler: clang
100124
clang-runtime: '13'
101125
cling: On
102126
cling-version: '1.0'
103127
cppyy: On
128+
llvm_enable_projects: "clang"
129+
llvm_targets_to_build: "host;NVPTX"
104130
- name: osx13-x86-clang-clang-repl-19
105131
os: macos-13
106132
compiler: clang
107133
clang-runtime: '19'
108134
cling: Off
109135
cppyy: On
136+
llvm_enable_projects: "clang;lld"
137+
llvm_targets_to_build: "WebAssembly;host;NVPTX"
110138
- name: osx13-x86-clang-clang-repl-18
111139
os: macos-13
112140
compiler: clang
113141
clang-runtime: '18'
114142
cling: Off
115143
cppyy: On
144+
llvm_enable_projects: "clang"
145+
llvm_targets_to_build: "host;NVPTX"
116146
- name: osx13-x86-clang-clang-repl-17
117147
os: macos-13
118148
compiler: clang
119149
clang-runtime: '17'
120150
cling: Off
121151
cppyy: On
152+
llvm_enable_projects: "clang"
153+
llvm_targets_to_build: "host;NVPTX"
122154
- name: osx13-x86-clang-clang-repl-16
123155
os: macos-13
124156
compiler: clang
125157
clang-runtime: '16'
126158
cling: Off
127159
cppyy: On
160+
llvm_enable_projects: "clang"
161+
llvm_targets_to_build: "host;NVPTX"
128162
- name: osx13-x86-clang-clang13-cling
129163
os: macos-13
130164
compiler: clang
131165
clang-runtime: '13'
132166
cling: On
133167
cling-version: '1.0'
134168
cppyy: On
169+
llvm_enable_projects: "clang"
170+
llvm_targets_to_build: "host;NVPTX"
135171

136172
steps:
137173
- uses: actions/checkout@v4
@@ -340,10 +376,10 @@ jobs:
340376
mkdir build
341377
if [[ "${cling_on}" == "ON" ]]; then
342378
cd build
343-
cmake -DLLVM_ENABLE_PROJECTS="clang;lld" \
379+
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects }}" \
344380
-DLLVM_EXTERNAL_PROJECTS=cling \
345381
-DLLVM_EXTERNAL_CLING_SOURCE_DIR=../../cling \
346-
-DLLVM_TARGETS_TO_BUILD="WebAssembly;host;NVPTX" \
382+
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
347383
-DCMAKE_BUILD_TYPE=Release \
348384
-DLLVM_ENABLE_ASSERTIONS=ON \
349385
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
@@ -354,7 +390,6 @@ jobs:
354390
-DLLVM_ENABLE_TERMINFO=OFF \
355391
-DLLVM_ENABLE_LIBXML2=OFF \
356392
../llvm
357-
cmake --build . --target lld --parallel ${{ env.ncpus }}
358393
cmake --build . --target clang --parallel ${{ env.ncpus }}
359394
cmake --build . --target cling --parallel ${{ env.ncpus }}
360395
# Now build gtest.a and gtest_main for CppInterOp to run its tests.
@@ -367,8 +402,8 @@ jobs:
367402
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
368403
fi
369404
cd build
370-
cmake -DLLVM_ENABLE_PROJECTS="clang;lld" \
371-
-DLLVM_TARGETS_TO_BUILD="WebAssembly;host;NVPTX" \
405+
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" \
406+
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
372407
-DCMAKE_BUILD_TYPE=Release \
373408
-DLLVM_ENABLE_ASSERTIONS=ON \
374409
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
@@ -379,7 +414,11 @@ jobs:
379414
-DLLVM_ENABLE_TERMINFO=OFF \
380415
-DLLVM_ENABLE_LIBXML2=OFF \
381416
../llvm
382-
cmake --build . --target clang clang-repl lld --parallel ${{ env.ncpus }}
417+
if [[ "${llvm_vers}" == "16" ]]||[[ "${llvm_vers}" == "17" ]]||[[ "${llvm_vers}" == "18" ]]; then
418+
cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }}
419+
else
420+
cmake --build . --target clang clang-repl lld --parallel ${{ env.ncpus }}
421+
fi
383422
fi
384423
cd ../
385424
rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")
@@ -411,10 +450,10 @@ jobs:
411450
if ( "${{ matrix.cling }}" -imatch "On" )
412451
{
413452
cd build
414-
cmake -DLLVM_ENABLE_PROJECTS="clang" `
453+
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" `
415454
-DLLVM_EXTERNAL_PROJECTS=cling `
416455
-DLLVM_EXTERNAL_CLING_SOURCE_DIR="$env:CLING_DIR" `
417-
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" `
456+
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" `
418457
-DCMAKE_BUILD_TYPE=Release `
419458
-DLLVM_ENABLE_ASSERTIONS=ON `
420459
-DCLANG_ENABLE_STATIC_ANALYZER=OFF `
@@ -446,8 +485,8 @@ jobs:
446485
}
447486
cd build
448487
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
449-
cmake -DLLVM_ENABLE_PROJECTS="clang" `
450-
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" `
488+
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" `
489+
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" `
451490
-DCMAKE_BUILD_TYPE=Release `
452491
-DLLVM_ENABLE_ASSERTIONS=ON `
453492
-DCLANG_ENABLE_STATIC_ANALYZER=OFF `
@@ -1108,93 +1147,18 @@ jobs:
11081147
clang-runtime: '19'
11091148
cling: Off
11101149
micromamba_shell_init: bash
1111-
- name: ubu22-x86-gcc12-clang-repl-18-emscripten_wasm
1112-
os: ubuntu-22.04
1113-
compiler: gcc-12
1114-
clang-runtime: '18'
1115-
cling: Off
1116-
micromamba_shell_init: bash
1117-
- name: ubu22-x86-gcc12-clang-repl-17-emscripten_wasm
1118-
os: ubuntu-22.04
1119-
compiler: gcc-12
1120-
clang-runtime: '17'
1121-
cling: Off
1122-
micromamba_shell_init: bash
1123-
- name: ubu22-x86-gcc12-clang-repl-16-emscripten_wasm
1124-
os: ubuntu-22.04
1125-
compiler: gcc-12
1126-
clang-runtime: '16'
1127-
cling: Off
1128-
micromamba_shell_init: bash
1129-
- name: ubu22-x86-gcc9-clang13-cling-emscripten_wasm
1130-
os: ubuntu-22.04
1131-
compiler: gcc-9
1132-
clang-runtime: '13'
1133-
cling: On
1134-
cling-version: '1.0'
1135-
micromamba_shell_init: bash
11361150
- name: osx14-arm-clang-clang-repl-19-emscripten_wasm
11371151
os: macos-14
11381152
compiler: clang
11391153
clang-runtime: '19'
11401154
cling: Off
11411155
micromamba_shell_init: bash
1142-
- name: osx14-arm-clang-clang-repl-18-emscripten_wasm
1143-
os: macos-14
1144-
compiler: clang
1145-
clang-runtime: '18'
1146-
cling: Off
1147-
micromamba_shell_init: bash
1148-
- name: osx14-arm-clang-clang-repl-17-emscripten_wasm
1149-
os: macos-14
1150-
compiler: clang
1151-
clang-runtime: '17'
1152-
cling: Off
1153-
micromamba_shell_init: bash
1154-
- name: osx14-arm-clang-clang-repl-16-emscripten_wasm
1155-
os: macos-14
1156-
compiler: clang
1157-
clang-runtime: '16'
1158-
cling: Off
1159-
micromamba_shell_init: bash
1160-
- name: osx14-arm-clang-clang13-cling-emscripten_wasm
1161-
os: macos-14
1162-
compiler: clang
1163-
clang-runtime: '13'
1164-
cling: On
1165-
cling-version: '1.0'
1166-
micromamba_shell_init: bash
11671156
- name: osx13-x86-clang-clang-repl-19-emscripten_wasm
11681157
os: macos-13
11691158
compiler: clang
11701159
clang-runtime: '19'
11711160
cling: Off
11721161
micromamba_shell_init: bash
1173-
- name: osx13-x86-clang-clang-repl-18-emscripten_wasm
1174-
os: macos-13
1175-
compiler: clang
1176-
clang-runtime: '18'
1177-
cling: Off
1178-
micromamba_shell_init: bash
1179-
- name: osx13-x86-clang-clang-repl-17-emscripten_wasm
1180-
os: macos-13
1181-
compiler: clang
1182-
clang-runtime: '17'
1183-
cling: Off
1184-
micromamba_shell_init: bash
1185-
- name: osx13-x86-clang-clang-repl-16-emscripten_wasm
1186-
os: macos-13
1187-
compiler: clang
1188-
clang-runtime: '16'
1189-
cling: Off
1190-
micromamba_shell_init: bash
1191-
- name: osx13-x86-clang-clang13-cling-emscripten_wasm
1192-
os: macos-13
1193-
compiler: clang
1194-
clang-runtime: '13'
1195-
cling: On
1196-
cling-version: '1.0'
1197-
micromamba_shell_init: bash
11981162

11991163
steps:
12001164
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)