From 614b1a0aeb426203593d8bf1b68b4d3c51573b7d Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sat, 22 Nov 2025 23:34:32 -0800 Subject: [PATCH 1/5] [CI] Fix ref_llvm and ref_translator in on-push-verification-in-tree task --- .github/workflows/on-push-verification-in-tree.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-push-verification-in-tree.yml b/.github/workflows/on-push-verification-in-tree.yml index 99bafd9c..a3fdc514 100644 --- a/.github/workflows/on-push-verification-in-tree.yml +++ b/.github/workflows/on-push-verification-in-tree.yml @@ -35,9 +35,19 @@ jobs: - name: Checkout opencl-clang sources for action files uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + # This step will fail when the branch naming scheme 'ocl-open-XXX' changes! + - name: Parse LLVM version from branch name + id: check-llvm-version + run: | + BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null + BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push + LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP '\d+') # Eg. 190 for LLVM 19 + LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19 + echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT + - name: Run build-opencl-clang action uses: ./.github/actions/build-opencl-clang with: - ref_llvm: main - ref_translator: main + ref_llvm: release/${{ steps.check-llvm-version.outputs.llvm_version }}.x + ref_translator: llvm_release_${{ steps.check-llvm-version.outputs.llvm_version }}0 ref_opencl-clang: ${{ github.ref }} From 391a3f71fa34f07c1b694212ae47e9a6bcd31bc5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 23 Nov 2025 15:49:06 +0800 Subject: [PATCH 2/5] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/on-push-verification-in-tree.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-push-verification-in-tree.yml b/.github/workflows/on-push-verification-in-tree.yml index a3fdc514..fc81bbdf 100644 --- a/.github/workflows/on-push-verification-in-tree.yml +++ b/.github/workflows/on-push-verification-in-tree.yml @@ -41,7 +41,7 @@ jobs: run: | BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push - LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP '\d+') # Eg. 190 for LLVM 19 + LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19 LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19 echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT From ae7523fe497d028c4a6689fc7d58a2d1a0c9aef4 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sat, 22 Nov 2025 23:53:39 -0800 Subject: [PATCH 3/5] Apply suggestion from @Copilot --- .github/workflows/on-push-verification-in-tree.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/on-push-verification-in-tree.yml b/.github/workflows/on-push-verification-in-tree.yml index fc81bbdf..e66c0984 100644 --- a/.github/workflows/on-push-verification-in-tree.yml +++ b/.github/workflows/on-push-verification-in-tree.yml @@ -42,6 +42,10 @@ jobs: BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19 + if [ -z "$LLVM_VERSION_LONG" ]; then + echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'" + exit 1 + fi LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19 echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT From 1715aa656cf0abc0c34234a895a0ef56fdfa3b20 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 23 Nov 2025 00:09:05 -0800 Subject: [PATCH 4/5] Apply suggestion from @Copilot --- .github/workflows/on-push-verification-in-tree.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-push-verification-in-tree.yml b/.github/workflows/on-push-verification-in-tree.yml index e66c0984..44c89735 100644 --- a/.github/workflows/on-push-verification-in-tree.yml +++ b/.github/workflows/on-push-verification-in-tree.yml @@ -41,12 +41,19 @@ jobs: run: | BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push - LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19 - if [ -z "$LLVM_VERSION_LONG" ]; then + # Extract the padded LLVM version (e.g., 190 for LLVM 19) + LLVM_VERSION_PADDED=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') + if [ -z "$LLVM_VERSION_PADDED" ]; then echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'" exit 1 fi - LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19 + # Extract the actual LLVM version (e.g., 19 from 190) + if [[ "$LLVM_VERSION_PADDED" =~ ^([0-9]+)0$ ]]; then + LLVM_VERSION_SHORT="${BASH_REMATCH[1]}" + else + echo "[OPENCL-CLANG] Error: Unexpected LLVM version format '$LLVM_VERSION_PADDED' from branch name '$BRANCH'" + exit 1 + fi echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT - name: Run build-opencl-clang action From 87a113cc839905a5004bc753286a354f1432b9e0 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 23 Nov 2025 16:11:12 +0800 Subject: [PATCH 5/5] Update .github/workflows/on-push-verification-in-tree.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/on-push-verification-in-tree.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-push-verification-in-tree.yml b/.github/workflows/on-push-verification-in-tree.yml index 44c89735..e70220d5 100644 --- a/.github/workflows/on-push-verification-in-tree.yml +++ b/.github/workflows/on-push-verification-in-tree.yml @@ -42,7 +42,7 @@ jobs: BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push # Extract the padded LLVM version (e.g., 190 for LLVM 19) - LLVM_VERSION_PADDED=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') + LLVM_VERSION_PADDED=$(echo "$BRANCH" | sed -n 's/^ocl-open-\([0-9]\+\)$/\1/p') if [ -z "$LLVM_VERSION_PADDED" ]; then echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'" exit 1