Skip to content

Conversation

@Bill-hbrhbr
Copy link
Collaborator

@Bill-hbrhbr Bill-hbrhbr commented Feb 25, 2025

Description

  • AppleClang-15 has numerous C++20 bugs that are not fixed until AppleClang-16, including:
  • Drop ubuntu-20.04 since it's hard to support C++20 on this platform.
  • Remove the unnecessary tool logging task.
  • Use the latest OS version of each platform for linting:
    • linux: Ubuntu-24.04 Noble
    • darwin: MacOS 15 Sequoia

Note that we cannot do

sudo ln --symbolic --force /opt/homebrew/opt/llvm@16/bin/clang /usr/bin/cc
sudo ln --symbolic --force /opt/homebrew/opt/llvm@16/bin/clang++ /usr/bin/c++

because /usr/bin is strictly protected on MacOS.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Github workflows pass as usual.

Summary by CodeRabbit

Summary by CodeRabbit

  • Tests

    • Improved the configuration for automated unit testing across multiple macOS versions.
    • Enhanced setup procedures, including refined installation steps for essential tools and environment variable management to ensure robust test execution.
  • Chores

    • Updated the automated code quality checks to incorporate new operating system specifications.
    • Streamlined workflows by removing redundant logging to promote a more efficient build process.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2025

Walkthrough

This pull request updates two GitHub workflow configurations. The code linting checks workflow modifies the operating system specifications, replacing older OS identifiers with new versions, and removes the conditional step for coreutils installation and the logging step. In the unit tests workflow, similar changes to the OS matrix are applied, along with the addition of a conditional step for installing clang-16 on macOS 14 and the removal of certain installation commands for Ubuntu.

Changes

Files Change Summary
.github/workflows/code-linting-checks.yaml
.github/workflows/unit-tests.yaml
Updated OS matrix values (replacing “macos-latest” with “macos-15” and “ubuntu-latest” with “ubuntu-24.04”), modified conditional checks for installing coreutils, and removed the logging step.
.github/workflows/unit-tests.yaml Added a conditional step for macOS 14 to install clang-16 and set up environment variables for C and C++ compilers. Removed installation commands for gcc-10 on ubuntu-20.04.

Sequence Diagram(s)

sequenceDiagram
    participant LintJob as Linting Workflow
    participant OSMatrix as OS Matrix
    participant Coreutils as Coreutils Installer

    LintJob->>OSMatrix: Load OS values (macos-15, ubuntu-24.04)
    OSMatrix-->>LintJob: Provide updated OS identifiers
    LintJob->>Coreutils: Check condition (if OS is macos-15)
    Coreutils-->>LintJob: Install coreutils accordingly
Loading
sequenceDiagram
    participant UTJob as Unit Tests Workflow
    participant OSMatrix as OS Matrix
    participant CondSteps as Conditional Steps
    participant Clang as Clang-16 Installer
    participant EnvSetup as Environment Setup
    participant TestRunner as Test Executor

    UTJob->>OSMatrix: Load OS values (macos-14, macos-15)
    OSMatrix-->>UTJob: Return specific OS versions
    alt When OS is macos-14
        UTJob->>CondSteps: Execute conditional steps for macOS 14
        CondSteps->>Clang: Install clang-16 and set compiler env vars
    else When OS is macos-15
        UTJob->>CondSteps: Execute standard conditional steps for macOS 15
    end
    UTJob->>EnvSetup: Source .bashrc to load updated env vars
    EnvSetup-->>TestRunner: Provide updated environment
    UTJob->>TestRunner: Run unit tests
Loading

Possibly Related PRs

Suggested Reviewers

  • davidlion

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22d3089 and da15730.

📒 Files selected for processing (1)
  • .github/workflows/unit-tests.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/unit-tests.yaml

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 generate docstrings to generate docstrings for this 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

@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

🧹 Nitpick comments (2)
.github/workflows/unit-tests.yaml (2)

46-55: Unit Test Execution for macOS-14 with Clang-16
This new step properly sets the environment variables (CC and CXX) to point to LLVM@16's AppleClang-16 binaries and installs the required LLVM version using Homebrew before running the tests. One suggestion is to consider caching the LLVM installation (or checking if it is already installed) to avoid redundant installations in repeated runs, which may improve workflow efficiency.


56-60: Simplify the Test Execution Conditional
The conditional expression if: "false == (matrix.os == 'macos-14')" functions correctly but could be simplified to if: "matrix.os != 'macos-14'" to enhance readability.

Would you like a diff suggestion for this improvement?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7c852f and b2ab238.

📒 Files selected for processing (1)
  • .github/workflows/unit-tests.yaml (2 hunks)
🔇 Additional comments (2)
.github/workflows/unit-tests.yaml (2)

23-27: Matrix Update for OS Compatibility
The OS matrix now includes "macos-14", "macos-15", "ubuntu-22.04", and "ubuntu-24.04", which aligns with the updated testing requirements. Verify that these OS versions meet all test expectations across environments.


42-45: Conditional Coreutils Installation
The conditional check for installing coreutils (if: "matrix.os == 'macos-14' || matrix.os == 'macos-15'") is clear and correctly scoped for both macOS environments.

Copy link

@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

🧹 Nitpick comments (1)
.github/workflows/unit-tests.yaml (1)

57-61: Conditional Expression for Non-macOS-14 Unit Tests

The step for running unit tests on OSes other than macOS-14 uses the condition "false == (matrix.os == 'macos-14')". While functionally correct, consider refactoring this condition for better readability by using a direct inequality comparison (e.g., "matrix.os != 'macos-14'").

Here's a suggested diff:

-      - if: "false == (matrix.os == 'macos-14')"
+      - if: "matrix.os != 'macos-14')"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2ab238 and 6f6acc6.

📒 Files selected for processing (2)
  • .github/workflows/code-linting-checks.yaml (1 hunks)
  • .github/workflows/unit-tests.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/code-linting-checks.yaml
🔇 Additional comments (3)
.github/workflows/unit-tests.yaml (3)

24-27: OS Matrix Update: New Environment Specifications

The updated OS matrix now includes "macos-14", "macos-15", "ubuntu-22.04", and "ubuntu-24.04", which aligns with the new CI requirements outlined in the PR objectives. This ensures testing is performed on the targeted and updated operating systems.


42-47: Dependency Installation on macOS-14: Coreutils and LLVM@16

The conditional installation step for macOS-14 now installs both coreutils and llvm@16. This is appropriate given the move to AppleClang-16 for C++20 support.

Consider verifying that the installation paths and package versions meet pipeline expectations in the CI environment.


48-56: macOS-14 Unit Tests Execution with Clang-16

The unit tests step for macOS-14 now correctly sets the environment variables (CC and CXX) to use the Clang-16 binaries before running task clean and task test-all. This ensures that tests are compiled with the updated AppleClang-16 supporting C++20.

@Bill-hbrhbr Bill-hbrhbr changed the title ci: Upgrade C++ compiler on MacOS Sonoma to AppleClang-16 support C++20 compilation. ci: Upgrade C++ compiler on MacOS Sonoma to AppleClang-16 support C++20 compilation; Drop Ubuntu-Focal 20.04 Feb 25, 2025
@Bill-hbrhbr Bill-hbrhbr changed the title ci: Upgrade C++ compiler on MacOS Sonoma to AppleClang-16 support C++20 compilation; Drop Ubuntu-Focal 20.04 ci: Upgrade C++ compiler on MacOS Sonoma to AppleClang-16 support C++20 compilation; Drop Ubuntu-Focal 20.04 and unused GitHub workflow steps Feb 25, 2025
@Bill-hbrhbr Bill-hbrhbr changed the title ci: Upgrade C++ compiler on MacOS Sonoma to AppleClang-16 support C++20 compilation; Drop Ubuntu-Focal 20.04 and unused GitHub workflow steps ci: Upgrade C++ compiler on MacOS-14 Sonoma to AppleClang-16 support C++20 compilation; Drop Ubuntu-Focal 20.04 and unused GitHub workflow steps Feb 25, 2025
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Copy link

@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

🧹 Nitpick comments (1)
.github/workflows/unit-tests.yaml (1)

49-57: Review YAML Expression in Environment Block.
The multi-line expression for setting environment variables (i.e. overriding CC and CXX for macOS 14) is innovative; however, actionlint flagged an unexpected "{" character. While GitHub Actions expressions can span multiple lines, consider refactoring the expression into a single line to avoid potential parsing issues. For example:

-env: >-
-  ${{
-  'macos-14' == matrix.os
-  && fromJson('{
-  "CC": "/opt/homebrew/opt/llvm@16/bin/clang",
-  "CXX": "/opt/homebrew/opt/llvm@16/bin/clang++"
-  }')
-  || {}
-  }}
+env: ${{ 'macos-14' == matrix.os && fromJson('{"CC": "/opt/homebrew/opt/llvm@16/bin/clang", "CXX": "/opt/homebrew/opt/llvm@16/bin/clang++"}') || {} }}

This simplified format should appease linters like actionlint and ensure correct evaluation.

🧰 Tools
🪛 actionlint (1.7.4)

49-49: got unexpected character '{' while lexing expression, expecting 'a'..'z', 'A'..'Z', '_', '0'..'9', ''', '}', '(', ')', '[', ']', '.', '!', '<', '>', '=', '&', '|', '*', ',', ' '

(expression)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f6acc6 and 5e40ed1.

📒 Files selected for processing (1)
  • .github/workflows/unit-tests.yaml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/unit-tests.yaml

49-49: got unexpected character '{' while lexing expression, expecting 'a'..'z', 'A'..'Z', '_', '0'..'9', ''', '}', '(', ')', '[', ']', '.', '!', '<', '>', '=', '&', '|', '*', ',', ' '

(expression)

🔇 Additional comments (3)
.github/workflows/unit-tests.yaml (3)

24-27: Update OS Matrix to Reflect New Platforms.
The matrix now includes "macos-14" and "macos-15" and retains current Ubuntu versions while dropping "ubuntu-20.04". This update aligns with the PR objectives for improved C++20 support on modern systems.


42-47: Scoped Installation for macOS 14 Dependencies.
The installation step correctly applies only when the OS is "macos-14", ensuring that coreutils and llvm@16 (for C++20 support) are installed where needed. This targeted approach is appropriate.


58-60: Unit Test Commands Seem Correctly Specified.
The commands task clean and task test-all are clearly delineated under the "Run unit tests" step. They should function as expected within the updated workflow context.

Copy link

@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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e40ed1 and c258588.

📒 Files selected for processing (1)
  • .github/workflows/unit-tests.yaml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/unit-tests.yaml

48-48: step must run script with "run" section or run action with "uses" section

(syntax-check)


55-55: step must run script with "run" section or run action with "uses" section

(syntax-check)

🔇 Additional comments (2)
.github/workflows/unit-tests.yaml (2)

23-27: Matrix OS List Updated for Target Platforms.
The OS matrix now includes "macos-14", "macos-15", "ubuntu-22.04", and "ubuntu-24.04", in line with the PR objective to drop Ubuntu 20.04 and prepare for AppleClang-16 support for macOS.


42-47: Correct Conditional Installation Step for macOS 14.
The installation step correctly applies for "macos-14" by installing both coreutils and llvm@16 via Homebrew. Ensure that these commands are idempotent so that re-running the workflow does not produce failures if the dependencies are already present.

Comment on lines 48 to 54
- if: "'macos-14' == matrix.os"
- name: "Run unit tests"
env:
CC: "/opt/homebrew/opt/llvm@16/bin/clang"
CXX: "/opt/homebrew/opt/llvm@16/bin/clang++"
run: "task test-all"

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Merge the Conditional and Execution Details for macOS-14 Unit Tests.
The current configuration splits the if condition onto a separate step from the unit test execution (name, env, and run). This leads to an invalid step as detected by static analysis (actionlint warning on missing a run or uses key). Please merge the condition with the step so that the step is correctly defined.

Suggested diff:

-      - if: "'macos-14' == matrix.os"
-      - name: "Run unit tests"
-        env:
-          CC: "/opt/homebrew/opt/llvm@16/bin/clang"
-          CXX: "/opt/homebrew/opt/llvm@16/bin/clang++"
-        run: "task test-all"
+      - name: "Run unit tests for macos-14"
+        if: "'macos-14' == matrix.os"
+        env:
+          CC: "/opt/homebrew/opt/llvm@16/bin/clang"
+          CXX: "/opt/homebrew/opt/llvm@16/bin/clang++"
+        run: "task test-all"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- if: "'macos-14' == matrix.os"
- name: "Run unit tests"
env:
CC: "/opt/homebrew/opt/llvm@16/bin/clang"
CXX: "/opt/homebrew/opt/llvm@16/bin/clang++"
run: "task test-all"
- name: "Run unit tests for macos-14"
if: "'macos-14' == matrix.os"
env:
CC: "/opt/homebrew/opt/llvm@16/bin/clang"
CXX: "/opt/homebrew/opt/llvm@16/bin/clang++"
run: "task test-all"
🧰 Tools
🪛 actionlint (1.7.4)

48-48: step must run script with "run" section or run action with "uses" section

(syntax-check)

Comment on lines 55 to 57
- if: "false == ('macos-14' == matrix.os)"
- name: "Run unit tests"
run: "task test-all"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Merge the Conditional and Execution Details for Non-macOS-14 Unit Tests.
Similarly, the step for executing unit tests on platforms other than "macos-14" is split into a standalone if condition and a separate step. Merge them into one mapping to avoid YAML syntax errors and satisfy the actionlint requirements.

Suggested diff:

-      - if: "false == ('macos-14' == matrix.os)"
-      - name: "Run unit tests"
-        run: "task test-all"
+      - name: "Run unit tests for non-macos-14"
+        if: "false == ('macos-14' == matrix.os)"
+        run: "task test-all"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- if: "false == ('macos-14' == matrix.os)"
- name: "Run unit tests"
run: "task test-all"
- name: "Run unit tests for non-macos-14"
if: "false == ('macos-14' == matrix.os)"
run: "task test-all"
🧰 Tools
🪛 actionlint (1.7.4)

55-55: step must run script with "run" section or run action with "uses" section

(syntax-check)

kirkrodrigues
kirkrodrigues previously approved these changes Feb 26, 2025
Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

For the PR title, how about:

ci: Use Apple Clang 16 to support C++20 on macOS 14; Drop support for Ubuntu 20.04.

@Bill-hbrhbr Bill-hbrhbr changed the title ci: Upgrade C++ compiler on MacOS-14 Sonoma to AppleClang-16 support C++20 compilation; Drop Ubuntu-Focal 20.04 and unused GitHub workflow steps ci: Use Apple Clang 16 to support C++20 on macOS 14; Drop support for Ubuntu 20.04. Feb 26, 2025
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
@kirkrodrigues kirkrodrigues changed the title ci: Use Apple Clang 16 to support C++20 on macOS 14; Drop support for Ubuntu 20.04. ci: Use Apple Clang 16 to support C++20 on macOS 14; Drop support for Ubuntu 20.04. Feb 26, 2025
@kirkrodrigues kirkrodrigues merged commit d53b826 into y-scope:main Feb 26, 2025
8 checks passed
@Bill-hbrhbr Bill-hbrhbr deleted the add-clang-16-for-macos-14 branch February 26, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants