From bf6f03d1546ee47cce1e9a92a7f168beb5dea068 Mon Sep 17 00:00:00 2001 From: makslevental Date: Fri, 7 Nov 2025 20:19:18 -0800 Subject: [PATCH] [LLVM] parameterize LLVM commit --- .github/workflows/build_llvm.yml | 16 +++++++++++++++- scripts/clean_gh_releases.py | 12 +++++++++++- scripts/cmake/llvm_cache.cmake | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_llvm.yml b/.github/workflows/build_llvm.yml index f1b52caf..80032603 100644 --- a/.github/workflows/build_llvm.yml +++ b/.github/workflows/build_llvm.yml @@ -18,6 +18,11 @@ on: description: 'Run the build with a tmate session ONLY in case of failure' required: false default: false + llvm_commit: + description: 'llvm commit to build' + type: string + required: false + default: '' pull_request: paths: - ".github/actions/setup_base" @@ -133,12 +138,21 @@ jobs: run: | export LLVM_SOURCE_DIR="$PWD/third_party/llvm-project" + + if [ x"${{ inputs.llvm_commit }}" != x"" ]; then + pushd $LLVM_SOURCE_DIR + git fetch --unshallow + git reset --hard "${{ inputs.llvm_commit }}" + popd + fi + export LLVM_BUILD_DIR="$PWD/llvm-build" # double nested so that upload artifacts uploads a folder export LLVM_INSTALL_DIR="$PWD/llvm-install/llvm-install" ccache -z - $python3_command -m pip install -r third_party/llvm-project/mlir/python/requirements.txt + + $python3_command -m pip install PyYAML nanobind pybind11 numpy if [[ "${{ matrix.arch }}" == "wasm32-wasi" ]]; then scripts/build_llvm_wasi.sh diff --git a/scripts/clean_gh_releases.py b/scripts/clean_gh_releases.py index 9a496c82..70e430b0 100644 --- a/scripts/clean_gh_releases.py +++ b/scripts/clean_gh_releases.py @@ -1,4 +1,5 @@ import os +import re import time from github import Github @@ -19,6 +20,13 @@ # -H "X-GitHub-Api-Version: 2022-11-28" \ # /repos/llvm/eudsl/releases +skip = [ + # last commit before typed-pointers in MLIR is removed + "35ca64989" +] + +skip_re = re.compile("|".join(skip)) + n_deleted = 0 for rel in [ # llvm @@ -26,7 +34,7 @@ # eudsl 253847293, # mlir-python-bindings - 253847610 + 253847610, ]: for _ in range(100): n_deleted = 0 @@ -34,6 +42,8 @@ release = repo.get_release(rel) assets = release.get_assets() for ass in assets: + if skip_re.search(ass.name): + continue if ass.created_at.date() < thirty_days_ago: print(ass.name) assert ass.delete_asset() diff --git a/scripts/cmake/llvm_cache.cmake b/scripts/cmake/llvm_cache.cmake index 7cce7756..0e2ed62b 100644 --- a/scripts/cmake/llvm_cache.cmake +++ b/scripts/cmake/llvm_cache.cmake @@ -108,7 +108,7 @@ set(LLVM_MlirDevelopment_DISTRIBUTION_COMPONENTS mlir-libraries mlir-linalg-ods-yaml-gen mlir-opt - mlir-python-sources + # mlir-python-sources mlir-reduce mlir-tblgen mlir-translate