Skip to content

Conversation

Bill-hbrhbr
Copy link
Contributor

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

Description

  • Import ystdlib-cpp as a git submodule.
  • Add dep download workflow for ystdlib-cpp.
  • Add ystdlib to .clang-format as 3rd party lib includes.
  • Include it via add_subdirectory() in CLP CMakeLists.txt.
  • Update yscope clp developer guide docs on core deps versions.

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

  • ystdlib-cpp can be downloaded and successfully compiled along with clp-core.

Summary by CodeRabbit

  • New Features

    • Introduced a new library dependency, ystdlib-cpp, to expand project capabilities.
  • Chores

    • Enhanced build configuration and dependency management workflows, including checksum verification and test options for ystdlib-cpp.
    • Updated header categorization to recognize the ystdlib library.
  • Documentation

    • Revised dependency listings and version details in the user documentation to include ystdlib-cpp with its GitHub reference.

Copy link
Contributor

coderabbitai bot commented Feb 25, 2025

Walkthrough

This pull request integrates the "ystdlib-cpp" library as a new dependency across the repository. A new submodule entry is added in the repository’s submodule configuration, and the build process is updated in the CMake files to include this dependency. The dependency management tasks are modified to download, validate, and integrate the library, and the project’s formatting configuration and documentation are updated to recognize the new library and adjust related version information.

Changes

File(s) Change Summary
.gitmodules, components/core/submodules/ystdlib-cpp Added the "ystdlib-cpp" submodule with a specified path (components/core/submodules/ystdlib-cpp) and URL; new subproject commit integrated.
components/core/.clang-format Updated the regex pattern for header categorization to include the "ystdlib" library.
components/core/CMakeLists.txt Integrated "ystdlib-cpp" by adding its subdirectory and introduced an option (YSTDLIB_CPP_BUILD_TESTING set to OFF by default) into the build process.
deps-tasks.yml Introduced the G_YSTDLIB_CPP_CHECKSUM_FILE variable and defined a new task for downloading and validating the "ystdlib-cpp" dependency.
docs/src/dev-guide/components-core/index.md Updated the dependency documentation: added a new entry for ystdlib-cpp with its corresponding commit identifier (d1b4ae0).

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant BuildSystem
    participant DependencyManager
    participant GitHubRepo

    Developer->>BuildSystem: Initiate build
    BuildSystem->>DependencyManager: Execute dependency tasks
    DependencyManager->>GitHubRepo: Download "ystdlib-cpp" from repository
    GitHubRepo-->>DependencyManager: Provide submodule repository snapshot
    DependencyManager->>BuildSystem: Validate checksum using G_YSTDLIB_CPP_CHECKSUM_FILE
    BuildSystem->>Developer: Proceed with build including "ystdlib-cpp"
Loading

Possibly related PRs

Suggested reviewers

  • kirkrodrigues
  • LinZhihao-723

📜 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 631144b and e0e4ef6.

📒 Files selected for processing (1)
  • docs/src/dev-guide/components-core/index.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: lint-check (ubuntu-latest)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-13, true)
🔇 Additional comments (1)
docs/src/dev-guide/components-core/index.md (1)

45-45: New Dependency Entry Added

The documentation now correctly includes the ystdlib-cpp dependency in the Source Dependencies section. The formatting is consistent with the other entries, and the commit identifier (d1b4ae0) appears to be documented accurately. Please double-check that this commit hash exactly corresponds to the intended revision for the submodule integration.


🪧 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.

@Bill-hbrhbr Bill-hbrhbr changed the title Refactor(clp): Integrate ystdlib-cpp as a git submodule and migrate to use ystdlib::error_handling::ErrorCode. refactor(clp): Integrate ystdlib-cpp as a git submodule and migrate to use ystdlib::error_handling::ErrorCode. Feb 25, 2025
@Bill-hbrhbr Bill-hbrhbr marked this pull request as ready for review February 25, 2025 12:45
@Bill-hbrhbr Bill-hbrhbr requested a review from a team as a code owner February 25, 2025 12:45
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

🧹 Nitpick comments (1)
components/core/CMakeLists.txt (1)

219-223: New ystdlib-cpp Submodule Integration with BUILD_TESTING Toggle

The submodule for ystdlib-cpp is added here by temporarily disabling tests (using set(BUILD_TESTING OFF)) before including the submodule and then re-enabling testing afterwards. Please verify that this global toggle does not inadvertently affect tests in other parts of the project. It might be beneficial to consider a submodule-specific variable (for example, YSTDLIB_BUILD_TESTING) to localise this behaviour rather than modifying the global BUILD_TESTING flag.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2086223 and f1b3f25.

📒 Files selected for processing (1)
  • components/core/CMakeLists.txt (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: lint-check (ubuntu-latest)
  • GitHub Check: lint-check (macos-latest)
🔇 Additional comments (1)
components/core/CMakeLists.txt (1)

695-696: Linking against the New ystdlib::error_handling Library

The update to include ystdlib::error_handling in the target_link_libraries section reflects the migration of error handling to the new structure. Ensure that all references and dependencies match the symbols provided by the new library and that there are no lingering conflicts with previous error handling components.

Copy link
Member

@LinZhihao-723 LinZhihao-723 left a comment

Choose a reason for hiding this comment

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

We should update deps-tasks.yml as well to include ystdlib-cpp. Check this PR for reference (which added utfcpp): #701

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

🧹 Nitpick comments (1)
deps-tasks.yml (1)

470-499: Ystdlib-CPP Task Definition
A new task definition for ystdlib-cpp has been introduced. It mirrors the structure of similar submodule tasks by setting:

  • internal: true
  • Defining vars for CHECKSUM_FILE and DEST (which uses G_YSTDLIB_CPP_CHECKSUM_FILE and G_CORE_COMPONENT_SUBMODULES_DIR)
  • Listing the required sources (download script and task files)
  • Including a dependency on :init and checksum validation via :utils:validate-checksum
  • Specifying commands that leverage the download-dependency task and then compute the checksum.

Please verify that the SRC_NAME (ystdlib-cpp-95d89d148312c7c447f4164766ad35dd7996b1cc) and SRC_URL (https://github.com/y-scope/ystdlib-cpp/archive/95d89d1.zip) accurately reflect the intended version of the library. If further versioning information is available, consider adding clarifying comments or documentation for future maintainers.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 70b14a4 and 82ac7da.

📒 Files selected for processing (4)
  • .gitmodules (1 hunks)
  • components/core/CMakeLists.txt (2 hunks)
  • components/core/submodules/ystdlib-cpp (1 hunks)
  • deps-tasks.yml (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/core/submodules/ystdlib-cpp
  • .gitmodules
  • components/core/CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: ubuntu-focal-dynamic-linked-bins
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-13, true)
🔇 Additional comments (4)
deps-tasks.yml (4)

23-23: New Checksum Variable Addition
The new variable G_YSTDLIB_CPP_CHECKSUM_FILE is added in the vars section in a style consistent with the existing dependencies. This ensures that the ystdlib-cpp checksum file is tracked during dependency generation.


45-45: Include in Core Task Sources
The G_YSTDLIB_CPP_CHECKSUM_FILE variable is now incorporated into the list of sources for the core task. This inclusion is consistent with similar dependencies, ensuring its checksum is accounted for during the core dependency processing.


62-62: Checksum Command Update
The checksum file for ystdlib-cpp is appended into the cmds list of the core task (i.e. passed to the cat command). Verify that its position in the concatenated list meets the intended build and ordering requirements.


105-105: Internal Dependency Task List Integration
The new task ystdlib-cpp is now added to the all-internal-deps task list. This ensures that the submodule is processed as part of the sequential download and checksum verification steps for internal dependencies.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 635ce2c and f04c65f.

📒 Files selected for processing (2)
  • .github/workflows/clp-core-build-macos.yaml (1 hunks)
  • .github/workflows/clp-core-build.yaml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/clp-core-build.yaml
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/clp-core-build-macos.yaml

73-73: property "os" is not defined in object type {runner: string; use_shared_libs: bool}

(expression)


73-73: property "os" is not defined in object type {runner: string; use_shared_libs: bool}

(expression)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: lint-check (ubuntu-latest)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: build (macos-latest)
  • GitHub Check: lint-check (macos-latest)
🔇 Additional comments (1)
.github/workflows/clp-core-build-macos.yaml (1)

61-65: Approval: Coreutils and Apple Clang 16 Installation Step

This new step correctly installs the necessary dependencies (coreutils and Apple Clang 16) required for macOS builds. The use of the multi-line command with the |- syntax is appropriate.

@Bill-hbrhbr Bill-hbrhbr force-pushed the migrate-error-handling branch from a592641 to 86670f4 Compare March 12, 2025 18:05
Copy link
Member

Choose a reason for hiding this comment

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

Can we only add ystdlib-cpp in this PR and not modify/fix other issues?

Copy link
Member

Choose a reason for hiding this comment

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

This change seems to have not been made even though you resolved it. Did something go wrong?

add_subdirectory(submodules/yaml-cpp EXCLUDE_FROM_ALL)

# Add ystdlib-cpp
option(YSTDLIB_CPP_BUILD_TESTING "" OFF)
Copy link
Member

Choose a reason for hiding this comment

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

No change necessary, just a question for my own understanding.
Using option here someone could override this and build the tests for ystdlib-cpp right? (As opposed to using set which would enforce no tests built without editing the cmake scripts.)

Copy link
Contributor Author

@Bill-hbrhbr Bill-hbrhbr Mar 14, 2025

Choose a reason for hiding this comment

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

set(YSTDLIB_CPP_BUILD_TESTING OFF)
set(YSTDLIB_CPP_BUILD_TESTING ON CACHE BOOL "")
option(YSTDLIB_CPP_BUILD_TESTING "" ON)

Tried this code snippet. Neither cache setting can override the first line. So I guess

set(YSTDLIB_CPP_BUILD_TESTING OFF)

is good

@Bill-hbrhbr Bill-hbrhbr changed the title refactor(clp): Integrate ystdlib-cpp as a git submodule and migrate to use ystdlib::error_handling::ErrorCode. chore(core): Add ystdlib-cpp library as a submodule. Mar 14, 2025
@Bill-hbrhbr Bill-hbrhbr requested a review from davidlion March 15, 2025 08:01
Copy link
Member

@davidlion davidlion left a comment

Choose a reason for hiding this comment

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

@Bill-hbrhbr Bill-hbrhbr requested a review from davidlion March 16, 2025 23:28
Copy link
Member

@LinZhihao-723 LinZhihao-723 left a comment

Choose a reason for hiding this comment

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

The PR title lgtm.

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.

3 participants