Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Fix baseline version for llvm abi checks #85166

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

tstellar
Copy link
Collaborator

The baseline version calculations was assuming the minor release would always be 0.

The baseline version calculations was assuming the minor release would
always be 0.
@llvmbot
Copy link
Member

llvmbot commented Mar 14, 2024

@llvm/pr-subscribers-github-workflow

Author: Tom Stellard (tstellar)

Changes

The baseline version calculations was assuming the minor release would always be 0.


Full diff: https://github.com/llvm/llvm-project/pull/85166.diff

1 Files Affected:

  • (modified) .github/workflows/llvm-tests.yml (+15-2)
diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml
index 127628d76f1913..4c6d01a4b801cd 100644
--- a/.github/workflows/llvm-tests.yml
+++ b/.github/workflows/llvm-tests.yml
@@ -42,6 +42,7 @@ jobs:
       BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
       ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
       BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
+      BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
       LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
       LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
       LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
@@ -58,15 +59,27 @@ jobs:
       - name: Setup Variables
         id: vars
         run: |
-          if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 ] || [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
+          # libLLVM:
+          # 18.1.0 we aren't doing ABI checks.
+          # 18.1.1 We want to check 18.1.0.
+          # libclang:
+          # 18.1.0 We want to check 17.0.x
+          # 18.1.1 We want to check 18.1.0
+          if [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
             {
               echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
               echo "ABI_HEADERS=llvm-c"
+              if [ "${{ steps.version.outputs.LLVM_VERSION_MAJOR }}" -le 18 ]; then
+                echo "BASELINE_VERSION_MINOR=0"
+              else
+                echo "BASELINE_VERSION_MINOR=1"
+              fi
             } >> "$GITHUB_OUTPUT"
           else
             {
               echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
               echo "ABI_HEADERS=."
+              echo "BASELINE_VERSION_MINOR=1"
             } >> "$GITHUB_OUTPUT"
           fi
 
@@ -82,7 +95,7 @@ jobs:
         include:
           - name: build-baseline
             llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}
-            ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.0.0
+            ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MINOR }}.0
             repo: llvm/llvm-project
           - name: build-latest
             llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }}

{
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
echo "ABI_HEADERS=llvm-c"
if [ "${{ steps.version.outputs.LLVM_VERSION_MAJOR }}" -le 18 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this, given that we're not going to make changes to older versions anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't.

{
echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
echo "ABI_HEADERS=llvm-c"
echo "ABI_HEADERS=llvm-c"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray trailing whitespace?

# libLLVM:
# 18.1.0 we aren't doing ABI checks.
# 18.1.1 We want to check 18.1.0.
# libclang:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't libclang handled by the separate libclang-abi-tests workflow?

I think you probably meant the LLVM C API rather than libclang here?

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tstellar tstellar merged commit d93363a into llvm:main Mar 19, 2024
4 checks passed
@tstellar tstellar added this to the LLVM 18.X Release milestone Mar 19, 2024
@tstellar
Copy link
Collaborator Author

/cherry-pick d93363a

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Mar 19, 2024
The baseline version calculations was assuming the minor release would
always be 0.

(cherry picked from commit d93363a)
@llvmbot
Copy link
Member

llvmbot commented Mar 19, 2024

/pull-request #85789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants