Skip to content

Conversation

@Bill-hbrhbr
Copy link
Collaborator

@Bill-hbrhbr Bill-hbrhbr commented Aug 11, 2025

  • Lower LLVM/Apple Clang minimum version from 16 to 15.
  • Remove TraceableException which used C++20 features unsupported by Clang 15.
  • Update yscope-dev-utils to disable clang-tidy checks that require C++20 features unsupported by Clang 15.

Description

With the integration of Velox, which will depend on ystdlib, our minimum compiler requirements must align with Velox's build constraints.

Velox currently requires compiler versions of GNU11, Clang 15 and AppleClang15, so we must relax ystdlib constraints from LLVM/Apple Clang 16 down to 15 as well.

The compiler validation process follows the already approved practice in CLP.

The changes required to make ystdlib work with LLVM/Apple Clang 15 are:

  • Temporarily remove TraceableException from error_handling due to its use of std::source_location
  • Refactor code that uses std::ranges and remove clang tidy check that enforces std::ranges optimizations

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

  • Existing ystdlib unittests for building and installation runs successfully.

Summary by CodeRabbit

  • Breaking Changes

    • Removed a previously public exception type from the error-handling API; related tests were deleted.
  • Chores

    • Centralized compiler version validation with enforced minimums for C++20 compatibility.
    • Updated CI on macOS to rely on system toolchains (LLVM 16 no longer installed).
  • Refactor

    • Replaced ranges-based algorithms with iterator-based equivalents to improve compatibility; no behaviour changes.
  • Tests

    • Updated tests to non-ranges algorithms; removed tests tied to the removed exception type.
  • Documentation

    • Minor wording correction in a comment.

@Bill-hbrhbr Bill-hbrhbr requested a review from a team as a code owner August 11, 2025 11:40
@coderabbitai
Copy link

coderabbitai bot commented Aug 11, 2025

Walkthrough

Centralizes compiler version checks by introducing cmake/Toolchains/utils.cmake with validate_compiler_versions() and invoking it early in CMakeLists.txt; removes previous per-compiler checks. Deletes TraceableException.hpp and its test, updating error_handling CMake to drop the header. Replaces std::ranges usage with iterator-based algorithms in Array and tests. Adjusts CI to stop installing llvm@16; minor comment tweak.

Changes

Cohort / File(s) Summary
Compiler validation centralization & CI
CMakeLists.txt, cmake/Toolchains/utils.cmake, .github/workflows/unit-tests.yaml
Add Toolchains utils include and call validate_compiler_versions(); remove local compiler version checks. New utility enforces min compiler versions (AppleClang/Clang 15, GNU 11). CI stops installing llvm@16 and related env overrides on macOS 14.
Error handling: TraceableException removal
src/ystdlib/error_handling/CMakeLists.txt, src/ystdlib/error_handling/TraceableException.hpp, src/ystdlib/error_handling/test/test_TraceableException.cpp
Remove TraceableException public header and its test; drop it from PUBLIC_HEADERS.
Error handling tests (ranges → iterators/loops)
src/ystdlib/error_handling/test/test_ErrorCode.cpp, src/ystdlib/error_handling/test/types.cpp
Replace std::ranges algorithms with std::any_of and range-based for loops; preserve semantics.
Array and tests (ranges → iterators)
src/ystdlib/containers/Array.hpp, src/ystdlib/containers/test/test_Array.cpp
Switch initializer_list copy to std::copy; rewrite tests to use iterator-based std algorithms and direct iteration instead of ranges/views.
CMake helpers comment tweak
cmake/ystdlib-helpers.cmake
Comment wording: “C++20” token normalization.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CMake
    participant ToolchainUtils as Toolchains/utils.cmake

    User->>CMake: Configure project
    CMake->>ToolchainUtils: include(utils) and call validate_compiler_versions()
    ToolchainUtils-->>CMake: Validate CMAKE_CXX_COMPILER_ID/version
    alt Unsupported or too low
        ToolchainUtils-->>User: FATAL_ERROR
    else Supported
        CMake-->>User: Continue configuration
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • kirkrodrigues
  • davidlion
  • LinZhihao-723
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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: 1

🔭 Outside diff range comments (1)
cmake/ystdlib-helpers.cmake (1)

34-45: Action Required: C++20-only features detected against the new C++17 baseline

A project-wide scan shows real C++20 constructs still in use, so simply lowering to C++17 will break builds. You’ll need to either refactor these to C++17-compatible code or restore C++20 where needed.

Detected C++20-only usage:

  • src/ystdlib/error_handling/utils.hpp
    • std::source_location
  • src/ystdlib/error_handling/ErrorCode.hpp
    • concept + requires
  • src/ystdlib/containers/Array.hpp
    • requires-clause, std::ranges::copy
  • examples/src/linking-tests.cpp
    • std::ranges::equal
  • Multiple test files (e.g. containers/test/test_Array.cpp, error_handling/test)
    • std::ranges algorithms
  • examples/CMakeLists.txt:
    • target_compile_features(linking-tests PRIVATE cxx_std_20)

Next steps:

  • Refactor or remove C++20-only APIs (concepts, ranges, source_location) to target C++17, or
  • Revert the C++17 downgrade for targets that require C++20 (adjust add_cpp_library or per-target CMake settings)
  • Clean up any remaining cxx_std_20 flags in CMakeLists.txt
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ede2e5 and ce7241c.

📒 Files selected for processing (5)
  • CMakeLists.txt (2 hunks)
  • cmake/ystdlib-helpers.cmake (5 hunks)
  • src/ystdlib/error_handling/CMakeLists.txt (0 hunks)
  • src/ystdlib/error_handling/TraceableException.hpp (0 hunks)
  • src/ystdlib/error_handling/test/test_TraceableException.cpp (0 hunks)
💤 Files with no reviewable changes (3)
  • src/ystdlib/error_handling/CMakeLists.txt
  • src/ystdlib/error_handling/test/test_TraceableException.cpp
  • src/ystdlib/error_handling/TraceableException.hpp
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-06-06T15:01:53.987Z
Learnt from: PacificViking
PR: y-scope/ystdlib-cpp#65
File: CMakeLists.txt:87-88
Timestamp: 2025-06-06T15:01:53.987Z
Learning: The y-scope/ystdlib-cpp project uses lowercase `ystdlib_` prefix for project-specific CMake variables (e.g., `ystdlib_VERSION`, `ystdlib_BUILD_TESTING`, `ystdlib_INSTALL_CONFIG_DIR`) following the current naming convention standards.

Applied to files:

  • CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build-ystdlib-cpp (macos-15, release)
  • GitHub Check: build-ystdlib-cpp (macos-14, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, debug)
  • GitHub Check: build-ystdlib-cpp (macos-14, debug)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (4)
cmake/ystdlib-helpers.cmake (1)

90-90: Correct propagation of C++17 via target_compile_features

Using cxx_std_17 on INTERFACE (header-only), PUBLIC (non-interface), and PRIVATE (tests) is the right approach to enforce the minimum standard on consumers and tests.

Also applies to: 101-101, 156-156

CMakeLists.txt (3)

13-19: C++17 shift and compiler minima update LGTM

Aligns with Velox constraints; GNU stays at 11, AppleClang/Clang lowered to 15. Comment link to C++17 support is helpful.


78-78: Unified test target now enforces C++17 — good

Test aggregate target correctly switched to cxx_std_17.


16-19: CI Configurations Already Support Clang ≥15

The GitHub workflows install and run:

  • On macos-14: brew install llvm@16 and point CC/CXX to clang-16 (≥15).
  • On macos-15: the default Xcode toolchain includes AppleClang 15.x.

No further CI/toolchain changes are needed to satisfy the new minimum of Clang/AppleClang 15+. 🎉

@Bill-hbrhbr Bill-hbrhbr changed the title build(cpp): Remove TraceableException and downgrade C++ standard requirement from C++20 to C++17. build(cpp): Remove TraceableException and relax (Apple)Clang compiler version requirements from 16 to 15. Aug 12, 2025
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: 4

🔭 Outside diff range comments (1)
CMakeLists.txt (1)

63-63: Inconsistent C++ standard requirement

The CMakeLists.txt still uses cxx_std_20 on line 63, which contradicts the PR objective of downgrading to C++17. This inconsistency could cause build failures or unexpected behaviour.

-    target_compile_features(${UNIFIED_UNIT_TEST_TARGET} PRIVATE cxx_std_20)
+    target_compile_features(${UNIFIED_UNIT_TEST_TARGET} PRIVATE cxx_std_17)
♻️ Duplicate comments (1)
cmake/ystdlib-helpers.cmake (1)

117-117: Inconsistent C++ standard comment - should reference C++17

The comment mentions "C++20" but according to the PR objectives, the C++ standard requirement is being downgraded to C++17. This creates confusion as the comment doesn't match the intended standard change.

-# Adds a C++20 test executable named `unit-test-NAME` that will be built with `SOURCES` and linked
+# Adds a C++17 test executable named `unit-test-NAME` that will be built with `SOURCES` and linked
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce7241c and 292e6de.

📒 Files selected for processing (4)
  • CMakeLists.txt (1 hunks)
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake (1 hunks)
  • cmake/Toolchains/utils.cmake (1 hunks)
  • cmake/ystdlib-helpers.cmake (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-06-06T15:01:53.987Z
Learnt from: PacificViking
PR: y-scope/ystdlib-cpp#65
File: CMakeLists.txt:87-88
Timestamp: 2025-06-06T15:01:53.987Z
Learning: The y-scope/ystdlib-cpp project uses lowercase `ystdlib_` prefix for project-specific CMake variables (e.g., `ystdlib_VERSION`, `ystdlib_BUILD_TESTING`, `ystdlib_INSTALL_CONFIG_DIR`) following the current naming convention standards.

Applied to files:

  • cmake/ystdlib-helpers.cmake
  • CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, debug)
  • GitHub Check: build-ystdlib-cpp (macos-14, debug)
  • GitHub Check: build-ystdlib-cpp (macos-14, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, debug)
🔇 Additional comments (5)
cmake/Toolchains/llvm-clang-15-toolchain.cmake (1)

13-15: Fix line continuation formatting

The line continuation backslash should be at the end of line 13, not at the beginning of line 14. This violates proper CMake formatting conventions.

-        "Failed to locate LLVM v15 using Homebrew. Please ensure llvm@15 is installed: 'brew \
-        install llvm@15'"
+        "Failed to locate LLVM v15 using Homebrew. Please ensure llvm@15 is installed: 'brew \
+install llvm@15'"
⛔ Skipped due to learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr maintains a maximum line length of 100 characters in CMake files and uses backslash line continuations to maintain this limit.
CMakeLists.txt (2)

3-6: LGTM - Proper pre-project toolchain setup

The placement of toolchain setup before the project() call is correct and follows CMake best practices. The conditional comment about top-level projects is also helpful.


10-10: LGTM - Post-project compiler validation

Compiler validation after the project() call is appropriately placed since compiler information is only available after project initialization.

cmake/Toolchains/utils.cmake (2)

1-2: Update comment to reflect C++17 requirement

The comment references C++20 features, but according to the PR objectives, the project is downgrading to C++17. This creates confusion about the actual requirements.

-# This file contains utility functions for setting up toolchains and validating toolchain versions
-# to ensure compatibility with the C++20 features required by the project.
+# This file contains utility functions for setting up toolchains and validating toolchain versions
+# to ensure compatibility with the C++17 features required by the project.

24-28: Update function comment to reflect C++17 requirement

The function comment still references C++20 features, which is inconsistent with the PR objective of downgrading to C++17.

-# Checks if the compiler ID and version meet the minimum requirements to support C++20 features
+# Checks if the compiler ID and version meet the minimum requirements to support C++17 features
 # required by the project:
 # - AppleClang: version 15+
 # - Clang: version 15+
 # - GNU: version 11+

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

🔭 Outside diff range comments (3)
src/ystdlib/error_handling/test/types.cpp (1)

64-68: Avoid default lambda capture and pass the element by const reference

This prevents accidental captures and avoids copying each element during the predicate call. No behaviour change.

-            return std::any_of(
-                    cFailureConditions.cbegin(),
-                    cFailureConditions.cend(),
-                    [&](auto failure_condition) -> bool { return condition == failure_condition; }
-            );
+            return std::any_of(
+                    cFailureConditions.cbegin(),
+                    cFailureConditions.cend(),
+                    [&condition](auto const& failure_condition) -> bool {
+                        return condition == failure_condition;
+                    }
+            );
src/ystdlib/containers/Array.hpp (2)

108-112: Outdated TODO references removed TraceableException. Update the comment.

The TODO suggests switching to TraceableException, which this PR removes. Please align the comment with the new exception policy to avoid reintroducing the deprecated type.

Proposed update:

-            // TODO: Add ErrorCode class for `stdexcept` errors and switch to use TraceableException
+            // TODO: Introduce an ErrorCode for `stdexcept` errors if needed; TraceableException has been removed.

48-49: Consider marking move operations noexcept.

Declaring the move ctor/assign as noexcept improves interoperability with standard containers and communicates strong move guarantees (unique_ptr already provides noexcept moves).

Proposed change:

-    Array(Array&&) = default;
-    auto operator=(Array&&) -> Array& = default;
+    Array(Array&&) noexcept = default;
+    auto operator=(Array&&) noexcept -> Array& = default;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 292e6de and fa39bd8.

📒 Files selected for processing (5)
  • .github/workflows/unit-tests.yaml (1 hunks)
  • src/ystdlib/containers/Array.hpp (1 hunks)
  • src/ystdlib/containers/test/test_Array.cpp (7 hunks)
  • src/ystdlib/error_handling/test/test_ErrorCode.cpp (1 hunks)
  • src/ystdlib/error_handling/test/types.cpp (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}

⚙️ CodeRabbit Configuration File

  • Prefer false == <expression> rather than !<expression>.

Files:

  • src/ystdlib/containers/Array.hpp
  • src/ystdlib/error_handling/test/test_ErrorCode.cpp
  • src/ystdlib/error_handling/test/types.cpp
  • src/ystdlib/containers/test/test_Array.cpp
🧠 Learnings (2)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.358Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-03-27T22:57:03.031Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-27T22:57:03.031Z
Learning: In unit tests for ystdlib-cpp, `REQUIRE_FALSE` is preferred over `REQUIRE(!condition)` for its explicit nature when checking that conditions are false.

Applied to files:

  • src/ystdlib/error_handling/test/test_ErrorCode.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build-ystdlib-cpp (macos-15, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, debug)
  • GitHub Check: build-ystdlib-cpp (macos-14, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, debug)
  • GitHub Check: build-ystdlib-cpp (macos-14, debug)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (10)
.github/workflows/unit-tests.yaml (2)

46-46: Step name update aligns with relaxed compiler policy

Renaming to reference LLVM Clang 15 (for Velox) is consistent with the project’s new minimum compiler requirement and helps future readers understand the rationale.


45-50: CMake toolchain selection verified
We confirmed that in CMakeLists.txt:

  • setup_toolchains() is called on line 6, before project() on line 8.
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake explicitly sets
    CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the brew-installed LLVM 15 binaries.

As a result, CMake deterministically picks LLVM 15 without any CC/CXX overrides.

If you’d still like to ensure non-CMake steps (e.g. direct clang calls) use the brew LLVM 15, you can prepend its bin to PATH:

-      - if: "'macos-14' == matrix.os"
-        name: "Install macOS 14 deps: coreutils (for md5sum) and LLVM Clang 15 (for Velox)"
-        run: |-
-          brew install coreutils
-          brew install llvm@15
+      - if: "'macos-14' == matrix.os"
+        name: "Install macOS 14 deps: coreutils (for md5sum) and LLVM Clang 15 (for Velox)"
+        run: |-
+          brew update
+          brew install coreutils
+          brew install llvm@15
+          echo "$(brew --prefix llvm@15)/bin" >> "$GITHUB_PATH"
src/ystdlib/containers/Array.hpp (1)

36-41: Switch to std::copy is appropriate for Clang 15 (ranges-free) while preserving semantics.

This keeps the same behaviour but avoids ranges dependencies that are shaky on Clang 15/libc++. LGTM.

src/ystdlib/containers/test/test_Array.cpp (7)

68-74: Good replacement of ranges::equal with iterator-based std::equal and a comparator.

This preserves the original semantics without ranges and is portable to Clang 15.


93-93: Iterator-based equality check is correct and clearer for Clang 15.

Comparing both ranges explicitly via 4-iterator overload ensures equal length and contents. LGTM.


102-104: Copy and equality checks without ranges are correct.

Using std::copy and std::equal over begin/end is the right call here. LGTM.


114-119: Move test remains sound after switching to std::equal.

The 4-iterator overload is appropriate and keeps the same verification semantics. LGTM.


153-155: Replacing ranges::for_each with std::for_each is correct.

The lambda checks default zero-initialisation for fundamental types; matches Array’s constructor behaviour. LGTM.


168-168: Iterator-based sequence comparison is equivalent and portable.

Dropping ranges here aligns with the toolchain requirements. LGTM.


184-190: Comparator-based std::equal is a faithful replacement and clearer than transformed views.

Readability improves and it avoids ranges dependencies while preserving behaviour. LGTM.

@Bill-hbrhbr Bill-hbrhbr changed the title build(cpp): Remove TraceableException and relax (Apple)Clang compiler version requirements from 16 to 15. build(cmake): Lower LLVM/Apple Clang minimum version from 16 to 15 for Velox compatibility; Add toolchain file for LLVM Clang 15 on macOS 14. Aug 12, 2025
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: 5

♻️ Duplicate comments (1)
src/ystdlib/error_handling/test/test_ErrorCode.cpp (1)

55-57: Use REQUIRE_FALSE for explicit negative assertion (team preference)

Per retrieved team learnings, prefer explicit negative assertions in tests. Replace the inequality check with REQUIRE_FALSE for clarity.

-    for (auto const& none_failure_condition : cNoneFailureConditions) {
-        REQUIRE(failure_error_code != none_failure_condition);
-    }
+    for (auto const& none_failure_condition : cNoneFailureConditions) {
+        REQUIRE_FALSE(failure_error_code == none_failure_condition);
+    }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa39bd8 and f6df622.

📒 Files selected for processing (3)
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake (1 hunks)
  • cmake/Toolchains/utils.cmake (1 hunks)
  • src/ystdlib/error_handling/test/test_ErrorCode.cpp (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}

⚙️ CodeRabbit Configuration File

  • Prefer false == <expression> rather than !<expression>.

Files:

  • src/ystdlib/error_handling/test/test_ErrorCode.cpp
🧠 Learnings (5)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.358Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-03-27T22:57:03.031Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-27T22:57:03.031Z
Learning: In unit tests for ystdlib-cpp, `REQUIRE_FALSE` is preferred over `REQUIRE(!condition)` for its explicit nature when checking that conditions are false.

Applied to files:

  • src/ystdlib/error_handling/test/test_ErrorCode.cpp
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/llvm-clang-15-toolchain.cmake
  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr maintains a maximum line length of 100 characters in CMake files and uses backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/llvm-clang-15-toolchain.cmake
  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-08-12T18:00:59.358Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.358Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.

Applied to files:

  • cmake/Toolchains/utils.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: build-ystdlib-cpp (macos-14, debug)
  • GitHub Check: build-ystdlib-cpp (macos-14, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, debug)
  • GitHub Check: build-ystdlib-cpp (macos-15, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, debug)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (2)
src/ystdlib/error_handling/test/test_ErrorCode.cpp (1)

52-54: LGTM: Switched to range-based for loop for clarity

This improves readability over the previous algorithm-based approach in tests. Nice cleanup.

cmake/Toolchains/utils.cmake (1)

37-41: Intentional exclusion of MSVC in validate_compiler_versions
The validate_compiler_versions function in cmake/Toolchains/utils.cmake only handles AppleClang, Clang and GNU – all other compilers (including MSVC) hit the FATAL_ERROR. This matches our project policy (C++20 support on Clang/AppleClang ≥15 and GNU ≥11). No change is required.

If Windows/MSVC support is needed in future, please add an elseif("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}") branch with the minimum version (e.g. MSVC ≥ 19.36 with /std:c++20).

@Bill-hbrhbr Bill-hbrhbr changed the title build(cmake): Lower LLVM/Apple Clang minimum version from 16 to 15 for Velox compatibility; Add toolchain file for LLVM Clang 15 on macOS 14. build(cmake): Update compiler requirements for Velox compatibility: Aug 13, 2025
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

♻️ Duplicate comments (2)
cmake/Toolchains/llvm-clang-15-toolchain.cmake (1)

23-27: Fix multi-line FATAL_ERROR formatting (avoid extra space, preserve readability)

The current split into two quoted strings yields a double space between 'brew and install. Use a bracket argument to preserve formatting and avoid accidental spacing issues.

Apply this diff:

-    message(
-        FATAL_ERROR
-        "Failed to locate LLVM v15 using Homebrew. Please ensure llvm@15 is installed: 'brew"
-        " install llvm@15'"
-    )
+    message(
+        FATAL_ERROR
+        [=[
+Failed to locate LLVM v15 using Homebrew. Please ensure llvm@15 is installed:
+'brew install llvm@15'
+        ]=]
+    )
cmake/Toolchains/utils.cmake (1)

14-20: Prefer CMAKE_CURRENT_LIST_DIR for robust relative pathing (optional)

Using CMAKE_CURRENT_LIST_DIR makes the toolchain file path independent of the including directory. You’ve set the cache type to FILEPATH (great); swapping to LIST_DIR would further harden this.

-            set(CMAKE_TOOLCHAIN_FILE
-                "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/llvm-clang-15-toolchain.cmake"
+            set(CMAKE_TOOLCHAIN_FILE
+                "${CMAKE_CURRENT_LIST_DIR}/llvm-clang-15-toolchain.cmake"
                 CACHE FILEPATH
                 "Toolchain file"
             )
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f6df622 and 3d288e1.

📒 Files selected for processing (3)
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake (1 hunks)
  • cmake/Toolchains/utils.cmake (1 hunks)
  • tools/yscope-dev-utils (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.401Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/llvm-clang-15-toolchain.cmake
  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr maintains a maximum line length of 100 characters in CMake files and uses backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/llvm-clang-15-toolchain.cmake
  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-08-12T18:00:59.401Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.401Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.

Applied to files:

  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-06-06T15:01:53.987Z
Learnt from: PacificViking
PR: y-scope/ystdlib-cpp#65
File: CMakeLists.txt:87-88
Timestamp: 2025-06-06T15:01:53.987Z
Learning: The y-scope/ystdlib-cpp project uses lowercase `ystdlib_` prefix for project-specific CMake variables (e.g., `ystdlib_VERSION`, `ystdlib_BUILD_TESTING`, `ystdlib_INSTALL_CONFIG_DIR`) following the current naming convention standards.

Applied to files:

  • cmake/Toolchains/utils.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, release)
  • GitHub Check: build-ystdlib-cpp (macos-14, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, debug)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (7)
tools/yscope-dev-utils (2)

1-1: Submodule bump looks aligned with the PR’s Clang 15 objective.

Updating yscope-dev-utils here makes sense given the intent to relax clang-tidy checks for Clang/AppleClang 15. No issues with the pointer update itself.


1-1: Clang-tidy configuration correctly relaxes checks for Clang/AppleClang 15

The exported .clang-tidy in tools/yscope-dev-utils@e121a57 disables the modernize-use-ranges check (and other heavy rules) specifically to maintain compatibility with C++20 on Clang 15:

  • Disabled checks in exports/lint-configs/.clang-tidy:
    • -modernize-use-ranges
    • -bugprone-easily-swappable-parameters
    • -portability-template-virtual-member-function
    • -readability-identifier-length
    • -readability-named-parameter
    • -readability-simplify-boolean-expr

The in-file comment explicitly cites Clang 15 support for disabling ranges. No further changes are required.

cmake/Toolchains/llvm-clang-15-toolchain.cmake (3)

6-11: Good safety check helper for toolchain binaries

Validates existence and propagates variables cleanly. Using a helper keeps call sites concise.


15-21: Brew prefix discovery is fine for macOS-only usage

The Homebrew lookup is straightforward and appropriate for this macOS-specific toolchain file.


30-33: Setting compilers/ar/ranlib via validated paths looks solid

Given the upfront existence checks, assigning these variables here is reliable for the toolchain context.

cmake/Toolchains/utils.cmake (2)

24-36: Compiler minimums align with your stated C++20 baseline

Minimum versions for AppleClang/Clang 15 and GNU 11 reflect the project’s C++20 requirements. No issues.


42-47: Good fatal message; formatting avoids backslash continuations

Splitting the message across arguments avoids the backslash pitfall and stays within line-length preferences.

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: 3

🔭 Outside diff range comments (1)
.github/workflows/unit-tests.yaml (1)

50-56: Run unit tests only on debug matrix to avoid redundant work on release

You always run debug tests even for the release matrix. Gate the tests by build_type to save CI time.

Apply this diff:

-      - name: "Run unit tests and examples"
+      - name: "Run unit tests and examples"
         # Currently unit tests rely on cassert and fail to compile in release mode.
         run: |-
-          task test:run-debug
+          if [ "${{ matrix.build_type }}" = "debug" ]; then
+            task test:run-debug
+          fi
           task examples:build-${{matrix.build_type}}
           ./build/examples/${{matrix.build_type}}/linking-tests
♻️ Duplicate comments (3)
.github/workflows/unit-tests.yaml (1)

45-49: LGTM: simplify macOS 14 setup by dropping LLVM 16 install

Relying on the runner’s built-in AppleClang 15 and only installing coreutils is correct for macOS 14.

cmake/Toolchains/llvm-clang-15-toolchain.cmake (1)

22-27: Use a bracketed multi-line string for the fatal message (cleaner, no awkward quoting)

Improves readability and avoids accidental formatting issues.

Apply this diff:

 if(NOT 0 EQUAL BREW_RESULT)
     message(
         FATAL_ERROR
-        "Failed to locate LLVM v15 using Homebrew. Please ensure llvm@15 is installed: 'brew"
-        " install llvm@15'"
+        [=[
+Failed to locate LLVM v15 using Homebrew. Please ensure llvm@15 is installed:
+'brew install llvm@15'
+        ]=]
     )
 endif()
cmake/Toolchains/utils.cmake (1)

1-6: Add include guard to prevent redefinition on multiple includes

Prevents accidental re-inclusion and function redefinition.

Apply this diff:

 # This file contains utility functions for setting up toolchains and validating toolchain versions
 # to ensure compatibility with the C++20 features required by the project.
 
+include_guard(GLOBAL)
+
 # Sets up the appropriate toolchain file based on the host system.
 function(setup_toolchains)
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3d288e1 and ed0ea67.

📒 Files selected for processing (3)
  • .github/workflows/unit-tests.yaml (1 hunks)
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake (1 hunks)
  • cmake/Toolchains/utils.cmake (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.401Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-08-12T18:00:59.401Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.401Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.

Applied to files:

  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/utils.cmake
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr maintains a maximum line length of 100 characters in CMake files and uses backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/utils.cmake
  • cmake/Toolchains/llvm-clang-15-toolchain.cmake
📚 Learning: 2025-06-06T15:01:53.987Z
Learnt from: PacificViking
PR: y-scope/ystdlib-cpp#65
File: CMakeLists.txt:87-88
Timestamp: 2025-06-06T15:01:53.987Z
Learning: The y-scope/ystdlib-cpp project uses lowercase `ystdlib_` prefix for project-specific CMake variables (e.g., `ystdlib_VERSION`, `ystdlib_BUILD_TESTING`, `ystdlib_INSTALL_CONFIG_DIR`) following the current naming convention standards.

Applied to files:

  • cmake/Toolchains/utils.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: build-ystdlib-cpp (macos-14, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, debug)
🔇 Additional comments (1)
cmake/Toolchains/utils.cmake (1)

29-49: Compiler version validation aligns with stated C++20 floor

The per-compiler minimums (AppleClang/Clang 15, GNU 11) match the project’s C++20 support policy. Messaging is clear and actionable.

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 & body, how about:

build(cmake): Lower minimum Clang version for Velox compatibility:
- Lower LLVM/Apple Clang minimum version from 16 to 15.
- Remove `TraceableException` which used C++20 features unsupported by Clang 15.
- Update `yscope-dev-utils` to disable `clang-tidy` checks that require C++20 features unsupported by Clang 15.

@Bill-hbrhbr Bill-hbrhbr changed the title build(cmake): Update compiler requirements for Velox compatibility: build(cmake): Lower minimum Clang version for Velox compatibility: Aug 17, 2025
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: 1

♻️ Duplicate comments (1)
cmake/Toolchains/utils.cmake (1)

1-3: Add an include guard to prevent redefinition on multiple includes

Cheap safety against accidental double-inclusion.

Apply this diff:

 # This file contains utility functions for validating toolchain versions to ensure compatibility
 # with the C++20 features required by the project.
 
+include_guard(GLOBAL)
+
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ed0ea67 and 9ef42c1.

📒 Files selected for processing (3)
  • .github/workflows/unit-tests.yaml (1 hunks)
  • CMakeLists.txt (1 hunks)
  • cmake/Toolchains/utils.cmake (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.401Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.
📚 Learning: 2025-08-12T18:00:59.401Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#72
File: cmake/Toolchains/utils.cmake:30-41
Timestamp: 2025-08-12T18:00:59.401Z
Learning: The ystdlib-cpp project maintains C++20 support and requires minimum compiler versions of Clang 15, Apple Clang 15, and GNU 11 to ensure compatibility with all C++20 features used in the codebase.

Applied to files:

  • cmake/Toolchains/utils.cmake
  • CMakeLists.txt
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr uses a maximum line length of 100 characters in CMake files and prefers to use backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-02-28T05:04:33.616Z
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#32
File: CMakeLists.txt:0-0
Timestamp: 2025-02-28T05:04:33.616Z
Learning: Bill-hbrhbr maintains a maximum line length of 100 characters in CMake files and uses backslash line continuations to maintain this limit.

Applied to files:

  • cmake/Toolchains/utils.cmake
📚 Learning: 2025-06-06T15:01:53.987Z
Learnt from: PacificViking
PR: y-scope/ystdlib-cpp#65
File: CMakeLists.txt:87-88
Timestamp: 2025-06-06T15:01:53.987Z
Learning: The y-scope/ystdlib-cpp project uses lowercase `ystdlib_` prefix for project-specific CMake variables (e.g., `ystdlib_VERSION`, `ystdlib_BUILD_TESTING`, `ystdlib_INSTALL_CONFIG_DIR`) following the current naming convention standards.

Applied to files:

  • cmake/Toolchains/utils.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, debug)
  • GitHub Check: build-ystdlib-cpp (ubuntu-24.04, release)
  • GitHub Check: build-ystdlib-cpp (macos-15, release)
  • GitHub Check: build-ystdlib-cpp (ubuntu-22.04, release)
  • GitHub Check: build-ystdlib-cpp (macos-14, release)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: lint-check (macos-15)
🔇 Additional comments (6)
.github/workflows/unit-tests.yaml (2)

46-46: Step name simplification looks good

Name is concise and clear.


51-52: Formatting nit resolved

Thanks for adding the empty line before the comment to match the guideline.

cmake/Toolchains/utils.cmake (2)

7-13: Version matrix aligns with stated C++20 baseline

AppleClang/Clang ≥ 15 and GNU ≥ 11 matches your documented C++20 support stance.


19-25: Good fatal error messaging

Splitting the message avoids stray backslashes and keeps line length reasonable.

CMakeLists.txt (2)

8-8: Including Toolchains/utils via CMAKE_MODULE_PATH is correct

The module path prepend ensures findability of cmake/Toolchains/utils.cmake.


11-11: validate_compiler_versions() placement is correct

Called after project(... LANGUAGES CXX), so compiler ID/version variables are available. Centralizing validation here is cleaner than per-file checks.

Comment on lines 45 to 49
- if: "'macos-14' == matrix.os"
name: "Install macOS 14 deps: coreutils (for md5sum) and Apple Clang 16 (for C++20)"
name: "Install coreutils (for md5sum)"
run: |-
brew install coreutils
brew install llvm@16
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Ensure md5sum is on PATH after installing coreutils on macOS

Homebrew’s coreutils installs md5sum under gnubin (not on PATH by default). If any step calls md5sum, it will fail unless you add gnubin to PATH or use gmd5sum explicitly.

Apply this diff to export gnubin to PATH robustly:

-        run: |-
-          brew install coreutils
+        run: |-
+          brew install coreutils
+          # Ensure md5sum is available on PATH (coreutils installs it under gnubin).
+          echo "$(brew --prefix coreutils)/libexec/gnubin" >> "$GITHUB_PATH"

To verify whether md5sum (or gmd5sum) is actually used in the repo:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Searching for md5sum usage..."
rg -n -C2 -g '!**/node_modules/**' -P '\b(g?md5sum)\b' || echo "No md5sum usage found."

Length of output: 200


No md5sum usage detected – coreutils install step may be unnecessary

I searched the repo for any invocations of md5sum or gmd5sum and found none. As a result:

  • You can safely remove the macOS brew install coreutils step if it’s not actually used.
  • If you prefer to keep installing coreutils “just in case,” append its gnubin directory to your PATH to future-proof against any calls to md5sum:
    - if: "'macos-14' == matrix.os"
      name: Install coreutils (for md5sum)
      run: |-
        brew install coreutils
        echo "$(brew --prefix coreutils)/libexec/gnubin" >> "$GITHUB_PATH"
🤖 Prompt for AI Agents
.github/workflows/unit-tests.yaml around lines 45 to 49: the workflow installs
coreutils on macOS even though no md5sum usage was found; either remove this
macOS-specific brew install step entirely (delete those lines) or keep the
install but append the coreutils gnubin directory to the PATH by adding a
command after brew install that writes the gnubin path to GITHUB_PATH so future
invocations of md5sum (or other GNU tools) resolve correctly.

@Bill-hbrhbr Bill-hbrhbr merged commit 9ed78cd into y-scope:main Aug 17, 2025
12 checks passed
@Bill-hbrhbr Bill-hbrhbr deleted the velox-downgrade-cpp17 branch August 17, 2025 17:42
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