Skip to content

Commit

Permalink
Reduce size of llvm cache by not build webassembly target for llvm<19 (
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbarton authored and aaronj0 committed Nov 29, 2024
1 parent 5ac8e62 commit 435816e
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 103 deletions.
179 changes: 79 additions & 100 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,111 +27,156 @@ jobs:
clang-runtime: '19'
cling: Off
cppyy: On
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly;host;NVPTX"
- name: ubu22-x86-gcc12-clang-repl-18
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '18'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu22-x86-gcc12-clang-repl-17
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '17'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu22-x86-gcc12-clang-repl-16
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '16'
cling: Off
cppyy: On
- name: ubu22-x86-gcc9-clang13-cling
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu22-x86-gcc9-clang18-cling
os: ubuntu-22.04
compiler: gcc-9
clang-runtime: '13'
compiler: gcc-12
clang-runtime: '18'
cling: On
cling-version: '1.0'
cling-version: 'refs/heads/master'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu22-x86-gcc9-clang16-cling
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '16'
cling: On
cling-version: 'v1.1'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: win2022-msvc-clang-repl-19
os: windows-2022
compiler: msvc
clang-runtime: '19'
cling: Off
cppyy: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: win2022-msvc-clang-repl-18
os: windows-2022
compiler: msvc
clang-runtime: '18'
cling: Off
cppyy: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: win2022-msvc-clang-repl-17
os: windows-2022
compiler: msvc
clang-runtime: '17'
cling: Off
cppyy: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx14-arm-clang-clang-repl-19
os: macos-14
compiler: clang
clang-runtime: '19'
cling: Off
cppyy: On
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly;host;NVPTX"
- name: osx14-arm-clang-clang-repl-18
os: macos-14
compiler: clang
clang-runtime: '18'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx14-arm-clang-clang-repl-17
os: macos-14
compiler: clang
clang-runtime: '17'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx14-arm-clang-clang-repl-16
os: macos-14
compiler: clang
clang-runtime: '16'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx14-arm-clang-clang13-cling
os: macos-14
compiler: clang
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx13-x86-clang-clang-repl-19
os: macos-13
compiler: clang
clang-runtime: '19'
cling: Off
cppyy: On
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly;host;NVPTX"
- name: osx13-x86-clang-clang-repl-18
os: macos-13
compiler: clang
clang-runtime: '18'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx13-x86-clang-clang-repl-17
os: macos-13
compiler: clang
clang-runtime: '17'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx13-x86-clang-clang-repl-16
os: macos-13
compiler: clang
clang-runtime: '16'
cling: Off
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: osx13-x86-clang-clang13-cling
os: macos-13
compiler: clang
clang-runtime: '13'
cling: On
cling-version: '1.0'
cppyy: On
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"

steps:
- uses: actions/checkout@v4
Expand All @@ -152,7 +197,7 @@ jobs:
cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
if [[ "$cling_on" == "ON" ]]; then
export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-')
export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git ${{ matrix.cling-version }} | tr '\t' '-')
export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-')
else
export CLING_HASH="Repl"
Expand All @@ -174,7 +219,7 @@ jobs:
if ( "${{ matrix.cling }}" -imatch "On" )
{
$env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} )
$env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git ${{ matrix.cling-version }} )
$env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-"
}
else
Expand Down Expand Up @@ -329,7 +374,7 @@ jobs:
if [[ "${cling_on}" == "ON" ]]; then
git clone https://github.com/root-project/cling.git
cd ./cling
git checkout tags/v${{ matrix.cling-version }}
git checkout ${{ matrix.cling-version }}
cd ..
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
else # repl
Expand All @@ -340,10 +385,10 @@ jobs:
mkdir build
if [[ "${cling_on}" == "ON" ]]; then
cd build
cmake -DLLVM_ENABLE_PROJECTS="clang;lld" \
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects }}" \
-DLLVM_EXTERNAL_PROJECTS=cling \
-DLLVM_EXTERNAL_CLING_SOURCE_DIR=../../cling \
-DLLVM_TARGETS_TO_BUILD="WebAssembly;host;NVPTX" \
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
Expand All @@ -354,11 +399,9 @@ jobs:
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
../llvm
cmake --build . --target lld --parallel ${{ env.ncpus }}
cmake --build . --target clang --parallel ${{ env.ncpus }}
cmake --build . --target cling --parallel ${{ env.ncpus }}
# Now build gtest.a and gtest_main for CppInterOp to run its tests.
cmake --build . --target gtest_main --parallel ${{ env.ncpus }}
else
# Apply patches
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
Expand All @@ -367,8 +410,8 @@ jobs:
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
fi
cd build
cmake -DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_TARGETS_TO_BUILD="WebAssembly;host;NVPTX" \
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" \
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
Expand All @@ -379,7 +422,11 @@ jobs:
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
../llvm
cmake --build . --target clang clang-repl lld --parallel ${{ env.ncpus }}
if [[ "${llvm_vers}" == "16" ]]||[[ "${llvm_vers}" == "17" ]]||[[ "${llvm_vers}" == "18" ]]; then
cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }}
else
cmake --build . --target clang clang-repl lld --parallel ${{ env.ncpus }}
fi
fi
cd ../
rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")
Expand All @@ -393,7 +440,7 @@ jobs:
{
git clone https://github.com/root-project/cling.git
cd ./cling
git checkout tags/v${{ matrix.cling-version }}
git checkout {{ matrix.cling-version }}
cd ..
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
$env:PWD_DIR= $PWD.Path
Expand All @@ -411,10 +458,10 @@ jobs:
if ( "${{ matrix.cling }}" -imatch "On" )
{
cd build
cmake -DLLVM_ENABLE_PROJECTS="clang" `
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" `
-DLLVM_EXTERNAL_PROJECTS=cling `
-DLLVM_EXTERNAL_CLING_SOURCE_DIR="$env:CLING_DIR" `
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" `
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" `
-DCMAKE_BUILD_TYPE=Release `
-DLLVM_ENABLE_ASSERTIONS=ON `
-DCLANG_ENABLE_STATIC_ANALYZER=OFF `
Expand Down Expand Up @@ -446,8 +493,8 @@ jobs:
}
cd build
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
cmake -DLLVM_ENABLE_PROJECTS="clang" `
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" `
cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" `
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" `
-DCMAKE_BUILD_TYPE=Release `
-DLLVM_ENABLE_ASSERTIONS=ON `
-DCLANG_ENABLE_STATIC_ANALYZER=OFF `
Expand Down Expand Up @@ -513,12 +560,19 @@ jobs:
clang-runtime: '16'
cling: Off
cppyy: Off
- name: ubu22-x86-gcc9-clang13-cling-cppyy
- name: ubu22-x86-gcc9-clang18-cling
os: ubuntu-22.04
compiler: gcc-9
clang-runtime: '13'
compiler: gcc-12
clang-runtime: '18'
cling: On
cling-version: '1.0'
cling-version: 'refs/heads/master'
cppyy: On
- name: ubu22-x86-gcc9-clang16-cling
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '16'
cling: On
cling-version: 'v1.1'
cppyy: On
#FIXME: Windows CppInterOp tests expected to fail
#until https://github.com/compiler-research/CppInterOp/issues/188 is solved
Expand Down Expand Up @@ -1108,93 +1162,18 @@ jobs:
clang-runtime: '19'
cling: Off
micromamba_shell_init: bash
- name: ubu22-x86-gcc12-clang-repl-18-emscripten_wasm
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '18'
cling: Off
micromamba_shell_init: bash
- name: ubu22-x86-gcc12-clang-repl-17-emscripten_wasm
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '17'
cling: Off
micromamba_shell_init: bash
- name: ubu22-x86-gcc12-clang-repl-16-emscripten_wasm
os: ubuntu-22.04
compiler: gcc-12
clang-runtime: '16'
cling: Off
micromamba_shell_init: bash
- name: ubu22-x86-gcc9-clang13-cling-emscripten_wasm
os: ubuntu-22.04
compiler: gcc-9
clang-runtime: '13'
cling: On
cling-version: '1.0'
micromamba_shell_init: bash
- name: osx14-arm-clang-clang-repl-19-emscripten_wasm
os: macos-14
compiler: clang
clang-runtime: '19'
cling: Off
micromamba_shell_init: bash
- name: osx14-arm-clang-clang-repl-18-emscripten_wasm
os: macos-14
compiler: clang
clang-runtime: '18'
cling: Off
micromamba_shell_init: bash
- name: osx14-arm-clang-clang-repl-17-emscripten_wasm
os: macos-14
compiler: clang
clang-runtime: '17'
cling: Off
micromamba_shell_init: bash
- name: osx14-arm-clang-clang-repl-16-emscripten_wasm
os: macos-14
compiler: clang
clang-runtime: '16'
cling: Off
micromamba_shell_init: bash
- name: osx14-arm-clang-clang13-cling-emscripten_wasm
os: macos-14
compiler: clang
clang-runtime: '13'
cling: On
cling-version: '1.0'
micromamba_shell_init: bash
- name: osx13-x86-clang-clang-repl-19-emscripten_wasm
os: macos-13
compiler: clang
clang-runtime: '19'
cling: Off
micromamba_shell_init: bash
- name: osx13-x86-clang-clang-repl-18-emscripten_wasm
os: macos-13
compiler: clang
clang-runtime: '18'
cling: Off
micromamba_shell_init: bash
- name: osx13-x86-clang-clang-repl-17-emscripten_wasm
os: macos-13
compiler: clang
clang-runtime: '17'
cling: Off
micromamba_shell_init: bash
- name: osx13-x86-clang-clang-repl-16-emscripten_wasm
os: macos-13
compiler: clang
clang-runtime: '16'
cling: Off
micromamba_shell_init: bash
- name: osx13-x86-clang-clang13-cling-emscripten_wasm
os: macos-13
compiler: clang
clang-runtime: '13'
cling: On
cling-version: '1.0'
micromamba_shell_init: bash

steps:
- uses: actions/checkout@v4
Expand All @@ -1215,7 +1194,7 @@ jobs:
cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
if [[ "$cling_on" == "ON" ]]; then
export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-')
export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git ${{ matrix.cling-version }} | tr '\t' '-')
export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-')
else
export CLING_HASH="Repl"
Expand Down
Loading

0 comments on commit 435816e

Please sign in to comment.