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

feat: support clang 19 #36

Merged
merged 3 commits into from
Sep 23, 2024
Merged

feat: support clang 19 #36

merged 3 commits into from
Sep 23, 2024

Conversation

shenxianpeng
Copy link
Contributor

@shenxianpeng shenxianpeng commented Sep 17, 2024

closes #35

Summary by CodeRabbit

  • New Features

    • Added support for Clang version 19 in build and test workflows.
    • Updated the README to reflect support for OS version 19 across platforms.
  • Documentation

    • Revised the supported OS/Version table in the README to include Clang version 19.

@shenxianpeng shenxianpeng added the enhancement New feature or request label Sep 17, 2024
Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The changes involve updates to the build and test workflows in GitHub Actions, specifically adding support for Clang version 19. The .github/workflows/build-amd64.yml and .github/workflows/test.yml files have been modified to include this new version in their respective matrices. Additionally, the README.md file has been updated to reflect the inclusion of Clang version 19 in the supported OS/Version table.

Changes

Files Change Summary
.github/workflows/build-amd64.yml, .github/workflows/test.yml Updated clang-version matrix to include version 19, expanding the range of supported Clang versions.
README.md Updated the supported OS/Version table to include support for OS version 19.

Assessment against linked issues

Objective Addressed Explanation
support clang 19.1.0 (#35)

🐰 In the meadow, we hop with glee,
Clang version nineteen, oh what a spree!
With workflows updated, our code shall shine,
A table in README, all versions align.
Let's celebrate with a joyful cheer,
For every new feature, we hold so dear! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7e589c5 and fe415f5.

Files selected for processing (1)
  • .github/workflows/build-amd64.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build-amd64.yml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
README.md (1)

11-15: LGTM! Consider adding a note about Clang 19.1.0.

The table has been correctly updated to include support for Clang 19 across all platforms. This accurately reflects the PR objectives and maintains consistency with the existing format.

Consider adding a note below the table mentioning the specific version (19.1.0) that has been added, as mentioned in the linked issue. This would provide more precise information for users. For example:

Note: Version 19 refers to Clang 19.1.0. For more details, see the [official release announcement](https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.0).
.github/workflows/test.yml (1)

Line range hint 31-66: Consider refactoring repeated download and check process

The current implementation repeats the process of downloading, verifying, and checking the version for each Clang tool (clang-format, clang-tidy, clang-query, clang-apply-replacements). To improve maintainability and reduce the risk of inconsistencies, consider refactoring this repeated code into a reusable step or job.

Here's a suggested approach:

  1. Create a reusable job or step that takes the tool name as an input.
  2. Use this reusable component for each Clang tool.

Example refactor:

jobs:
  download-and-check:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        clang-version: [ 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16, 17, 18, 19 ]
        os: [ ubuntu-latest, macos-latest, windows-latest ]
        tool: [ clang-format, clang-tidy, clang-query, clang-apply-replacements ]
        include:
          - os: ubuntu-latest
            bin_pattern: linux-amd64
            checksum_pattern: linux-amd64
          - os: macos-latest
            bin_pattern: macosx-amd64
            checksum_pattern: macosx-amd64
          - os: windows-latest
            bin_pattern: windows-amd64.exe
            checksum_pattern: windows-amd64
      fail-fast: false
    env:
      GH_TOKEN: ${{ secrets.TOKEN }}
      bin_suffix: '${{ matrix.clang-version }}_${{ matrix.bin_pattern }}'
      checksum_suffix: '${{ matrix.clang-version }}_${{ matrix.checksum_pattern }}.sha512sum'
    steps:
      - uses: actions/checkout@v4
      - name: Download and check ${{ matrix.tool }}
        shell: bash
        run: |
          gh release download ${{ inputs.tag }} --pattern '${{ matrix.tool }}-${{ env.bin_suffix }}'
          gh release download ${{ inputs.tag }} --pattern '${{ matrix.tool }}-${{ env.checksum_suffix }}'
          echo "== Output ${{ matrix.tool }} checksum"
          cat ${{ matrix.tool }}-${{ env.checksum_suffix }}
          chmod +x ${{ matrix.tool }}-${{ env.bin_suffix }}
          echo "== Output ${{ matrix.tool }} version"
          ./${{ matrix.tool }}-${{ env.bin_suffix }} --version

This refactored version uses a matrix strategy to iterate over the different Clang tools, reducing code duplication and making it easier to add or modify tools in the future.

.github/workflows/build-amd64.yml (1)

Line range hint 1-190: Consider monitoring build performance and artifact sizes.

While the changes to add Clang 19 support are appropriate, it's important to be aware of potential impacts on the workflow:

  1. Build times might increase due to the addition of a new Clang version to the matrix.
  2. The total size of artifacts produced by the workflow may increase.

I recommend monitoring the workflow runs after these changes to ensure:

  • Build times remain within acceptable limits.
  • The total size of artifacts doesn't exceed GitHub's storage limits for Actions.

If issues arise, consider strategies like parallelizing builds or optimizing artifact retention.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 58f8f2a and 7e589c5.

Files selected for processing (3)
  • .github/workflows/build-amd64.yml (2 hunks)
  • .github/workflows/test.yml (1 hunks)
  • README.md (1 hunks)
Additional comments not posted (3)
.github/workflows/test.yml (1)

17-17: LGTM: Addition of Clang 19 aligns with PR objectives

The inclusion of Clang version 19 in the test matrix is consistent with the pull request's objective to support Clang 19. This change ensures that the project will be tested against the latest Clang version across all supported operating systems.

To ensure full compatibility, let's verify that all necessary changes have been made:

.github/workflows/build-amd64.yml (2)

83-83: Please clarify the reason for updating compiler paths.

The paths for g++-11 and gcc-11 in MACOS_CMAKE_ARGS have been updated to use explicit paths (/opt/homebrew/bin/). While this change ensures the correct compiler versions are used, it's not directly related to supporting Clang 19.

Could you please provide more context on why this change was necessary? Additionally, consider adding a comment in the workflow file to explain the reason for using these specific paths, which will help with future maintenance.

To ensure these paths are correct on the macOS runner, we can run:

#!/bin/bash
# Check if the specified compiler paths exist on the macOS runner
if [ "$(uname)" == "Darwin" ]; then
  ls -l /opt/homebrew/bin/g++-11 /opt/homebrew/bin/gcc-11
  /opt/homebrew/bin/g++-11 --version
  /opt/homebrew/bin/gcc-11 --version
else
  echo "This check is only relevant on macOS runners."
fi

22-22: LGTM: Clang 19 support added correctly.

The changes appropriately add support for Clang 19:

  1. Version 19 is correctly added to the clang-version list.
  2. A new entry for version 19 is added to the include section with the correct release version.

These changes align well with the PR objective to support Clang 19.

To confirm the correct release version, let's check the official LLVM releases:

Also applies to: 25-26

Verification successful

Clang 19 Release Version Confirmed

The latest Clang 19 release version (llvmorg-19.1.0) matches the version specified in the include section of .github/workflows/build-amd64.yml.

These changes correctly add support for Clang 19 as intended.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the latest Clang 19 release version
curl -s https://api.github.com/repos/llvm/llvm-project/releases | grep -m 1 '"tag_name": "llvmorg-19' | cut -d '"' -f 4

Length of output: 135


Script:

#!/bin/bash
# Verify the latest Clang 19 release version on Linux
curl -s https://api.github.com/repos/llvm/llvm-project/releases | grep -m 1 '"tag_name": "llvmorg-19' | cut -d '"' -f 4

Length of output: 136

@shenxianpeng
Copy link
Contributor Author

shenxianpeng commented Sep 23, 2024

The PR tested failed, but I will merge it just for testing on master branch.

@shenxianpeng shenxianpeng merged commit 8cef426 into master Sep 23, 2024
2 of 44 checks passed
@shenxianpeng shenxianpeng deleted the patch-1 branch September 23, 2024 10:00
shenxianpeng added a commit that referenced this pull request Sep 23, 2024
@shenxianpeng
Copy link
Contributor Author

Revert this PR 0a573d5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support clang 19.1.0
1 participant