Skip to content

Conversation

koudis
Copy link
Member

@koudis koudis commented Jul 16, 2025

Summary by CodeRabbit

  • Chores
    • Introduced a new workflow to automatically build and test example projects on Linux, Windows, and macOS platforms.
    • Updated the testing workflow to use version 1.1.0 of the library.
  • Bug Fixes
    • Enabled automatic export of all symbols when building shared libraries on Windows for improved compatibility.

Copy link

coderabbitai bot commented Jul 16, 2025

Walkthrough

A new GitHub Actions workflow named "Examples" was added to automate building and testing example projects on Linux, Windows, and macOS. Additionally, the existing "tests" workflow was updated to use CMLIB_VERSION 1.1.0 instead of 1.0.0 for consistency. The example projects’ CMakeLists.txt files were modified to enable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS on Windows builds.

Changes

File(s) Change Summary
.github/workflows/examples.yml Added a new workflow to build and test example projects on Linux, Windows, and macOS using matrix jobs.
.github/workflows/tests.yml Updated CMLIB_VERSION from 1.0.0 to 1.1.0 for all test jobs.
example/library/CMakeLists.txt, example/library-interface/CMakeLists.txt Added conditional to enable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS when building on Windows.

Poem

In the warren, builds now gleam,
Examples run on every team—
Linux, Mac, and Windows too,
All with cmakelib, shiny and new!
With version bumps and matrix might,
Our code hops forward, day and night.
🐇✨


📜 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 b8eaeb5 and 357135f.

📒 Files selected for processing (4)
  • .github/workflows/examples.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)
  • example/library-interface/CMakeLists.txt (1 hunks)
  • example/library/CMakeLists.txt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • example/library-interface/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/tests.yml
  • example/library/CMakeLists.txt
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
🪛 YAMLlint (1.37.1)
.github/workflows/examples.yml

[error] 14-14: trailing spaces

(trailing-spaces)


[warning] 21-21: wrong indentation: expected 8 but found 10

(indentation)


[warning] 30-30: wrong indentation: expected 6 but found 8

(indentation)

⏰ 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). (2)
  • GitHub Check: test_macos
  • GitHub Check: test_windows
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch build_examples_in_cicd

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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

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

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests 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 (4)
.github/workflows/examples.yml (4)

12-14: Remove trailing whitespace to keep YAML-lint green

Line 14 contains nothing but spaces, triggering trailing-spaces errors.
Delete the line or strip the spaces:

-  
+

18-22: Fix list formatting – mis-indented closing bracket

YAMLlint flags the ] on line 21 (expected 8 but found 10).
Either re-indent or switch to block-style lists for better readability:

-        image: [
-          "test_ubuntu:2404"
-          ]
+        image:
+          - test_ubuntu:2404

28-31: Align container.image indentation

Line 30 is indented two spaces too far (indentation warning). Adjust to match surrounding keys:

-    container:
-        image: ghcr.io/cmakelib/${{ matrix.image }}
+    container:
+      image: ghcr.io/cmakelib/${{ matrix.image }}

61-66: Use canonical PowerShell syntax for env vars and paths

Prefer $Env: (capital E) and Join-Path to avoid quoting/path issues:

-            git clone --branch "v$env:CMLIB_VERSION" https://github.com/cmakelib/cmakelib.git
-            $env:CMLIB_DIR = "$(pwd)/cmakelib"
+            git clone --branch "v$Env:CMLIB_VERSION" https://github.com/cmakelib/cmakelib.git
+            $Env:CMLIB_DIR = Join-Path -Path (Get-Location) -ChildPath 'cmakelib'
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 892cd38 and 36f57dc.

📒 Files selected for processing (2)
  • .github/workflows/examples.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
.github/workflows/tests.yml (1)
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
🪛 YAMLlint (1.37.1)
.github/workflows/examples.yml

[error] 14-14: trailing spaces

(trailing-spaces)


[warning] 21-21: wrong indentation: expected 8 but found 10

(indentation)


[warning] 30-30: wrong indentation: expected 6 but found 8

(indentation)

⏰ 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). (3)
  • GitHub Check: test_windows
  • GitHub Check: test_linux (test_fedora:41)
  • GitHub Check: test_macos
🔇 Additional comments (1)
.github/workflows/tests.yml (1)

12-14: Confirm v1.1.0 tag exists before merging

The workflow now pins CMLIB_VERSION to 1.1.0. If the tag v1.1.0 has not yet been published in the cmakelib repository, every git clone --branch "v${CMLIB_VERSION}" … step will fail and break CI.
Double-check that the tag is live on GitHub, or postpone the merge until it is.

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

🧹 Nitpick comments (1)
.github/workflows/examples.yml (1)

61-66: Use PowerShell-native path handling for CMLIB_DIR

Mixing Unix slashes with PowerShell’s $env: may work but is brittle (e.g., drives other than C:). Prefer Join-Path to construct the path.

-            git clone --branch "v$env:CMLIB_VERSION" https://github.com/cmakelib/cmakelib.git
-            $env:CMLIB_DIR = "$(pwd)/cmakelib"
+            git clone --branch "v$env:CMLIB_VERSION" https://github.com/cmakelib/cmakelib.git
+            $env:CMLIB_DIR = Join-Path -Path (Get-Location) -ChildPath 'cmakelib'
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 36f57dc and 6e4e3f5.

📒 Files selected for processing (1)
  • .github/workflows/examples.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
🪛 YAMLlint (1.37.1)
.github/workflows/examples.yml

[error] 14-14: trailing spaces

(trailing-spaces)


[warning] 21-21: wrong indentation: expected 8 but found 10

(indentation)


[warning] 30-30: wrong indentation: expected 6 but found 8

(indentation)

⏰ 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). (1)
  • GitHub Check: test_windows

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

♻️ Duplicate comments (1)
example/library/CMakeLists.txt (1)

15-17: Same global flag scope caution as noted in library-interface

Applying CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS globally may unintentionally export symbols from future libraries. Consider the per-target approach outlined in the previous comment.

🧹 Nitpick comments (1)
example/library-interface/CMakeLists.txt (1)

16-18: Prefer per-target WINDOWS_EXPORT_ALL_SYMBOLS instead of a global switch

Turning the cache variable on makes every shared library created after this point auto-export its symbols—including any 3rd-party libs pulled in later. If the goal is to affect only testlib-shared, set the property on that target after it is declared:

-IF(CMDEF_OS_WINDOWS)
-    SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
-ENDIF()
+IF(CMDEF_OS_WINDOWS)
+    # After add_library(testlib …)
+    SET_PROPERTY(TARGET testlib-shared PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
+ENDIF()

This keeps symbol visibility predictable and avoids accidental leaks from unrelated libraries.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6e4e3f5 and b8eaeb5.

📒 Files selected for processing (2)
  • example/library-interface/CMakeLists.txt (1 hunks)
  • example/library/CMakeLists.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
example/library-interface/CMakeLists.txt (2)
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMDEF_INSTALL/test_cases/install_related/include_dirs/CMakeLists.txt:0-0
Timestamp: 2025-06-16T19:47:01.662Z
Learning: In the CMDEF_INSTALL system, export destination paths intentionally contain double slashes like `${CMDEF_LIBRARY_INSTALL_DIR}/cmake//` - this is the actual format produced by the implementation, not a formatting error in tests.
example/library/CMakeLists.txt (2)
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMDEF_INSTALL/test_cases/install_related/include_dirs/CMakeLists.txt:0-0
Timestamp: 2025-06-16T19:47:01.662Z
Learning: In the CMDEF_INSTALL system, export destination paths intentionally contain double slashes like `${CMDEF_LIBRARY_INSTALL_DIR}/cmake//` - this is the actual format produced by the implementation, not a formatting error in tests.
Learnt from: koudis
PR: cmakelib/cmakelib-component-cmdef#11
File: test/CMakeLists.txt:9-11
Timestamp: 2025-06-17T22:15:13.853Z
Learning: The cmakelib-component-cmdef project uses a custom testing framework with TEST.cmake and custom macros like TEST_RUN, TEST_RUN_AND_CHECK_OUTPUT rather than CTest. CTest integration is not needed or used in this project.
⏰ 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). (2)
  • GitHub Check: test_windows
  • GitHub Check: test_macos

@koudis koudis force-pushed the build_examples_in_cicd branch from b8eaeb5 to 357135f Compare July 16, 2025 14:52
@koudis koudis merged commit f6e2fc6 into master Jul 18, 2025
20 checks passed
@koudis koudis deleted the build_examples_in_cicd branch August 2, 2025 18:09
@coderabbitai coderabbitai bot mentioned this pull request Aug 22, 2025
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.

1 participant