[ci] Consolidate the OOP-JIT and in-process LLVM caches. #2211
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| schedule: | |
| - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| prepare-dell: | |
| name: Activate self-host infrastructure | |
| runs-on: [self-hosted, spotter] | |
| steps: | |
| - name: Send Magic Packet | |
| env: | |
| TARGET_IP: 192.168.100.30 | |
| MAC_ADDR: a4:bb:6d:51:d5:d2 | |
| # The container has no ping, emulate it. | |
| run: | | |
| # Mask the IP and potential broadcast to keep logs clean | |
| echo "::add-mask::$MAC_ADDR" | |
| echo "::add-mask::$BROADCAST" | |
| echo "::add-mask::$TARGET_IP" | |
| BROADCAST=$(echo $TARGET_IP | sed 's/\.[0-9]*$/ .255/' | tr -d ' ') | |
| PING="timeout 1 bash -c 'cat < /dev/null > /dev/tcp/$TARGET_IP/22' 2>/dev/null" | |
| # Install tool silently | |
| sudo apt-get update -qq && sudo apt-get install -y -qq wakeonlan > /dev/null | |
| # Check if already awake (using the Bash TCP PING variable) | |
| if eval "$PING"; then | |
| echo "Target machine is already awake. Exiting." | |
| exit 0 | |
| fi | |
| # If offline, send WoL | |
| echo "Machine is offline. Sending WoL..." | |
| wakeonlan -i $BROADCAST $MAC_ADDR > /dev/null | |
| # Wait & Verify Loop (checks every 10s for 4 minutes) | |
| echo "Waiting for response (checking Port 22)..." | |
| for i in {1..24}; do | |
| if eval "$PING"; then | |
| echo "Machine is online and SSH is ready." | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done | |
| echo "Error: Target hardware did not respond within the timeout period." | |
| exit 1 | |
| build: | |
| needs: prepare-dell | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| # Default cling version for cling rows; override per-row if a bump is | |
| # needed. The matching root-llvm-tag is pinned via a YAML anchor | |
| # (&root_llvm_tag) on the first cling row and referenced via | |
| # *root_llvm_tag on the rest: the cache key on this job literally | |
| # reads matrix.root-llvm-tag, so the tag must live on the row. | |
| CLING_VERSION: '1.3' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Rows omit fields that match these defaults (applied in | |
| # Build_LLVM and in the setup-python step): | |
| # llvm_enable_projects: "clang" | |
| # llvm_targets_to_build: "host;NVPTX" | |
| # python-version: '3.14' | |
| include: | |
| # Ubuntu Arm | |
| - { name: ubu24-arm-gcc12-llvm22-vg, os: ubuntu-24.04-arm, compiler: gcc-12, clang-runtime: '22', Valgrind: On } | |
| # Ubuntu X86 | |
| - { name: ubu24-x86-gcc12-llvm22, os: ubuntu-24.04, compiler: gcc-12, clang-runtime: '22' } | |
| - { name: ubu24-x86-clang22-llvm22-asan-ubsan, os: ubuntu-24.04, compiler: clang-22, clang-runtime: '22', sanitizer: "Address;Undefined" } | |
| - { name: ubu24-x86-gcc12-llvm21-cppyy-vg, os: ubuntu-24.04, compiler: gcc-12, clang-runtime: '21', cppyy: On, Valgrind: On } | |
| - { name: ubu24-x86-gcc12-llvm22-cppyy, os: ubuntu-24.04, compiler: gcc-12, clang-runtime: '22', cppyy: On } | |
| - { name: ubu24-x86-gcc14-cling-llvm20-cppyy, os: ubuntu-24.04, compiler: gcc-14, clang-runtime: '20', cling: On, cppyy: On, root-llvm-tag: &root_llvm_tag 'cling-llvm20-20260119-01' } | |
| - name: selfh-ubu22-x86-gcc12-llvm22-cuda | |
| os: [self-hosted, cuda, heavy] | |
| compiler: gcc-12 | |
| clang-runtime: '22' | |
| coverage: true | |
| - name: ubu24-x86-gcc12-llvm22-oop-vg | |
| os: ubuntu-24.04 | |
| compiler: gcc-12 | |
| clang-runtime: '22' | |
| oop-jit: On | |
| Valgrind: On | |
| # MacOS Arm | |
| - { name: osx26-arm-clang-llvm22, os: macos-26, compiler: clang, clang-runtime: '22', llvm_targets_to_build: host } | |
| - { name: osx26-arm-clang-llvm21-cppyy, os: macos-26, compiler: clang, clang-runtime: '21', cppyy: On, llvm_targets_to_build: host } | |
| - { name: osx26-arm-clang-cling-llvm20-cppyy, os: macos-26, compiler: clang, clang-runtime: '20', cling: On, cppyy: On, root-llvm-tag: *root_llvm_tag } | |
| - name: osx26-arm-clang-llvm22-oop | |
| os: macos-26 | |
| compiler: clang | |
| clang-runtime: '22' | |
| llvm_targets_to_build: host | |
| oop-jit: On | |
| # MacOS X86 | |
| - { name: osx26-x86-clang-llvm21-cppyy, os: macos-26-intel, compiler: clang, clang-runtime: '21', cppyy: On, llvm_targets_to_build: host } | |
| - { name: osx26-x86-clang-cling-llvm20-cppyy, os: macos-26-intel, compiler: clang, clang-runtime: '20', cling: On, cppyy: On, root-llvm-tag: *root_llvm_tag } | |
| # Windows | |
| - { name: win11-msvc-llvm22, os: windows-11-arm, compiler: msvc, clang-runtime: '22' } | |
| - { name: win2025-msvc-llvm22, os: windows-2025, compiler: msvc, clang-runtime: '22' } | |
| - { name: win2025-msvc-cling-llvm20, os: windows-2025, compiler: msvc, clang-runtime: '20', cling: On, root-llvm-tag: *root_llvm_tag } | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version || '3.14' }} | |
| - name: Save PR Info | |
| uses: ./.github/actions/Miscellaneous/Save_PR_Info | |
| - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build | |
| if: ${{ runner.environment != 'self-hosted' }} | |
| uses: actions/cache/restore@v4 | |
| id: cache | |
| with: | |
| path: | | |
| llvm-project | |
| ${{ matrix.cling=='On' && 'cling' || '' }} | |
| key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}-${{ matrix.root-llvm-tag || 'none' }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}${{ matrix.sanitizer || '' }} | |
| - name: Setup default Build Type | |
| uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type | |
| - name: Setup compiler | |
| uses: ./.github/actions/Miscellaneous/Setup_Compiler | |
| - name: Install dependencies | |
| uses: ./.github/actions/Miscellaneous/Install_Dependencies | |
| - name: Install LLVM-${{ matrix.clang-runtime }} dependencies on self-hosted | |
| if: ${{ runner.environment == 'self-hosted' }} | |
| shell: bash | |
| run: | | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | |
| codename="$(. /etc/os-release && echo $UBUNTU_CODENAME)" | |
| echo "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${{ matrix.clang-runtime }} main" | sudo tee /etc/apt/sources.list.d/llvm.list | |
| sudo apt-get update | |
| sudo apt-get install -y llvm-${{ matrix.clang-runtime }}-dev libclang-${{ matrix.clang-runtime }}-dev clang-${{ matrix.clang-runtime }} libpolly-${{ matrix.clang-runtime }}-dev libzstd-dev | |
| - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} | |
| if: ${{ runner.environment != 'self-hosted' }} | |
| uses: ./.github/actions/Build_LLVM | |
| with: | |
| cache-hit: ${{ steps.cache.outputs.cache-hit }} | |
| - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build | |
| uses: actions/cache/save@v4 | |
| if: ${{ runner.environment != 'self-hosted' && steps.cache.outputs.cache-hit != 'true' }} | |
| with: | |
| path: | | |
| llvm-project | |
| ${{ matrix.cling=='On' && 'cling' || '' }} | |
| key: ${{ steps.cache.outputs.cache-primary-key }} | |
| - name: Install OOP-JIT runtime | |
| # OOP rows used to bake `llvm-jitlink-executor` and | |
| # `orc_rt-<arch>` into the cached LLVM build (under a | |
| # `-oop`-suffixed cache slot). The cache slot is gone, so the | |
| # runtime parts are layered on top from system packages | |
| # instead. Symlinks point at the test binary's expected | |
| # resource-dir layout (`<test-bin-dir>/lib/clang/<major>/lib/ | |
| # <triple>/`) -- that's where clang::IncrementalExecutorBuilder | |
| # looks at runtime, computed from getMainExecutable(). The | |
| # cached LLVM keeps `LLVM_ENABLE_ASSERTIONS=ON`, so the | |
| # in-process JIT compiler still fires its assertions during | |
| # tests; orc_rt and the executor are runtime support, not the | |
| # assertion-rich JIT, so sourcing them from packages doesn't | |
| # change the assertion signal. | |
| if: ${{ matrix.oop-jit == 'On' && runner.environment != 'self-hosted' }} | |
| shell: bash | |
| run: | | |
| set -eu | |
| BIN_DIR="${GITHUB_WORKSPACE}/build/unittests/CppInterOp/bin/${{ env.BUILD_TYPE }}" | |
| # Pre-create the resource-dir layout so symlinks land in | |
| # place before CppInterOp builds the test binary into the | |
| # same directory. | |
| mkdir -p "${BIN_DIR}" | |
| if [[ "${{ runner.os }}" == "Linux" ]]; then | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \ | |
| | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null | |
| codename="$(. /etc/os-release && echo $UBUNTU_CODENAME)" | |
| echo "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${{ matrix.clang-runtime }} main" \ | |
| | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| llvm-${{ matrix.clang-runtime }} \ | |
| libclang-rt-${{ matrix.clang-runtime }}-dev | |
| PFX=/usr/lib/llvm-${{ matrix.clang-runtime }} | |
| mkdir -p "${BIN_DIR}/bin" | |
| ln -sf "${PFX}/bin/llvm-jitlink-executor" "${BIN_DIR}/bin/llvm-jitlink-executor" | |
| RT_SRC="${PFX}/lib/clang/${{ matrix.clang-runtime }}/lib" | |
| RT_DST="${BIN_DIR}/lib/clang/${{ matrix.clang-runtime }}/lib" | |
| for triple_dir in "${RT_SRC}"/*/; do | |
| [[ -d "${triple_dir}" ]] || continue | |
| triple=$(basename "${triple_dir}") | |
| mkdir -p "${RT_DST}/${triple}" | |
| for archive in "${triple_dir}"liborc_rt*.a; do | |
| [[ -f "${archive}" ]] || continue | |
| ln -sf "${archive}" "${RT_DST}/${triple}/$(basename "${archive}")" | |
| done | |
| done | |
| elif [[ "${{ runner.os }}" == "macOS" ]]; then | |
| brew install "llvm@${{ matrix.clang-runtime }}" || brew install llvm | |
| PFX="$(brew --prefix llvm@${{ matrix.clang-runtime }} 2>/dev/null || brew --prefix llvm)" | |
| mkdir -p "${BIN_DIR}/bin" | |
| ln -sf "${PFX}/bin/llvm-jitlink-executor" "${BIN_DIR}/bin/llvm-jitlink-executor" | |
| RT_SRC="${PFX}/lib/clang/${{ matrix.clang-runtime }}/lib/darwin" | |
| RT_DST="${BIN_DIR}/lib/clang/${{ matrix.clang-runtime }}/lib/darwin" | |
| mkdir -p "${RT_DST}" | |
| for archive in "${RT_SRC}"/liborc_rt*.a; do | |
| [[ -f "${archive}" ]] || continue | |
| ln -sf "${archive}" "${RT_DST}/$(basename "${archive}")" | |
| done | |
| fi | |
| - name: Setup code coverage | |
| if: ${{ success() && (matrix.coverage == true) }} | |
| run: | | |
| sudo apt-get install -y lcov | |
| echo "CODE_COVERAGE=1" >> $GITHUB_ENV | |
| echo "BUILD_TYPE=Debug" >> $GITHUB_ENV | |
| - name: Build and test CppInterOp | |
| uses: ./.github/actions/Build_and_Test_CppInterOp | |
| - name: Prepare code coverage report | |
| if: ${{ success() && (matrix.coverage == true) }} | |
| run: | | |
| # Create lcov report | |
| # capture coverage info | |
| vers="${CC#*-}" | |
| lcov --directory build/ --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-${vers} | |
| lcov --remove coverage.info '/usr/*' ${{ github.workspace }}'/llvm-project/*' --ignore-errors unused --output-file coverage.info | |
| lcov --remove coverage.info '${{ github.workspace }}/unittests/*' --ignore-errors unused --output-file coverage.info | |
| lcov --remove coverage.info '${{ github.workspace }}/build/*' --ignore-errors unused --output-file coverage.info | |
| # output coverage data for debugging (optional) | |
| lcov --list coverage.info | |
| rm -rf ./build/ | |
| - name: Upload to codecov.io | |
| if: ${{ success() && (matrix.coverage == true) }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.info | |
| fail_ci_if_error: true | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Build and test cppyy | |
| uses: ./.github/actions/Build_and_Test_cppyy | |
| - name: Show debug info | |
| if: ${{ failure() }} | |
| run: | | |
| export | |
| echo $GITHUB_ENV | |
| - name: Setup tmate session | |
| if: ${{ failure() && runner.debug }} | |
| uses: mxschmitt/action-tmate@v3 | |
| # When debugging increase to a suitable value! | |
| timeout-minutes: 30 | |