From 75f859161d51e6fa58d9c738a4fe609175fa9868 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:11:35 +0000 Subject: [PATCH] Reduce size of llvm cache by not build webassembly target for llvm<19 --- .github/workflows/ci.yml | 134 ++++++++++++++------------------------- 1 file changed, 49 insertions(+), 85 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fa32d4c5..293bfd42b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,24 +27,32 @@ 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 + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" - name: ubu22-x86-gcc9-clang13-cling os: ubuntu-22.04 compiler: gcc-9 @@ -52,48 +60,64 @@ jobs: cling: On cling-version: '1.0' 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 @@ -101,30 +125,40 @@ jobs: 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 @@ -132,6 +166,8 @@ jobs: cling: On cling-version: '1.0' cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" steps: - uses: actions/checkout@v4 @@ -340,10 +376,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 \ @@ -354,7 +390,6 @@ 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. @@ -367,8 +402,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 \ @@ -379,7 +414,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 ".") @@ -411,10 +450,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 ` @@ -446,8 +485,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 ` @@ -1108,93 +1147,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