-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an example of including UnoDB as a CMake subdirectory #633
Conversation
WalkthroughThis pull request reorganizes the build and CI configuration for the project. Multiple CI workflows (CircleCI, GitHub Actions for various environments) now include conditional steps to handle example builds only when sanitizer flags are disabled. The order of submodule checkout has been updated, and new dependencies for testing and benchmarking are installed. Additionally, CMake configurations across the main project, examples, and tests are streamlined. A new CMakePresets.json file has also been introduced to facilitate managing varied build configurations. Changes
Possibly related PRs
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
.circleci/config.yml
(2 hunks).github/workflows/build.yml
(3 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).gitignore
(1 hunks)CMakeLists.txt
(5 hunks)README.md
(2 hunks)examples/CMakeLists.txt
(1 hunks)test/CMakeLists.txt
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md
[formatting] ~67-~67: Consider inserting a comma after an introductory phrase for better readability.
Context: ...ct, ON
if you work on UnoDB itself. In this case the vendored development dependencies...
(IN_THAT_CASE_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (35)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: SonarCloud
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
🔇 Additional comments (18)
.gitignore (1)
49-49
: LGTM!Appropriate addition to ignore the compile commands database for the examples build directory.
examples/CMakeLists.txt (2)
8-10
: LGTM! Well-structured project configuration.Good practice to include version, description, and homepage URL in the project configuration.
15-17
: Verify package version compatibility.The find_package commands don't specify version requirements. Consider adding minimum version requirements to ensure compatibility.
Run this script to check the minimum required versions used in the main UnoDB CMakeLists.txt:
test/CMakeLists.txt (1)
29-30
: LGTM! Improved Google Test dependency management.Good improvement to use namespaced targets (GTest::) instead of raw targets. This is a CMake best practice that provides better dependency management and clarity.
Also applies to: 36-36, 43-44
.github/workflows/ubuntu-20.04.yml (1)
205-208
: LGTM! Well-organized build directory structure.Good practice to create separate build directories for the main project and examples.
.circleci/config.yml (1)
70-118
: LGTM! Well-structured example build configuration.The changes appropriately handle:
- Conditional example building when sanitizers are disabled
- Compiler-specific configurations for both Linux and macOS
- Proper package installation and build directory setup
Also applies to: 215-241
CMakeLists.txt (4)
348-350
: LGTM! Well-structured conditional target addition.The conditional check for
Microsoft.GSL::GSL
target prevents conflicts when UnoDB is included as a subdirectory in projects that already have GSL configured.
384-392
: LGTM! Well-structured conditional Google Test integration.The changes demonstrate good CMake practices:
- Prevents duplicate target definitions
- Properly handles Windows-specific settings with
gtest_force_shared_crt
- Correctly manages compiler flags using the ADD_CXX_FLAGS_FOR_SUBDIR macro
394-418
: LGTM! Well-structured Google Benchmark integration.The changes demonstrate excellent CMake practices:
- Prevents duplicate target definitions
- Properly configures benchmark options (testing and installation)
- Handles LTO configuration comprehensively based on build type and compiler
- Correctly manages compiler flags using the ADD_CXX_FLAGS_FOR_SUBDIR macro
512-515
: LGTM! Well-structured benchmark compile definitions.The conditional compile definitions for the benchmark target are properly scoped and handle GCC debug mode correctly.
.github/workflows/build.yml (4)
289-289
: LGTM! Proper submodules handling.Setting
submodules: false
in the initial checkout aligns with making the dependencies optional.
359-365
: LGTM! Proper macOS dependencies setup.The dependencies setup for macOS examples is well-structured with correct package names and proper conditions.
367-370
: LGTM! Well-structured build environment setup.The creation of separate build directories for the main project and examples is clean and well-organized.
371-420
: LGTM! Well-structured CMake configuration for examples.The configuration:
- Properly handles different compilers and their versions
- Correctly sets up LLVM toolchain for Release builds
- Has appropriate conditions for skipping builds with sanitizers
.github/workflows/old-compilers.yml (4)
449-449
: LGTM! Consistent submodules handling.Setting
submodules: false
matches the changes in build.yml and aligns with making dependencies optional.
488-493
: Package name typos already reported.The same package name typos exist here as in build.yml.
495-498
: LGTM! Consistent build environment setup.The creation of separate build directories matches the structure in build.yml.
499-531
: LGTM! Consistent CMake configuration for examples.The configuration matches the structure in build.yml with appropriate conditions for skipping builds with sanitizers.
6872415
to
5092fb9
Compare
There was a problem hiding this 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
♻️ Duplicate comments (1)
.github/workflows/build.yml (1)
343-349
:⚠️ Potential issueFix package name typos in apt-get install command.
The package names contain typos:
-sudo apt-get install -y libmsgsl-dev libgtest-dev libbencmark-dev +sudo apt-get install -y libmsgsl-dev libgtest-dev libbenchmark-dev
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
.circleci/config.yml
(2 hunks).github/workflows/build.yml
(3 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).gitignore
(1 hunks)CMakeLists.txt
(5 hunks)README.md
(2 hunks)examples/CMakeLists.txt
(1 hunks)test/CMakeLists.txt
(1 hunks)
🔇 Additional comments (13)
.gitignore (1)
49-49
: LGTM!Appropriate addition to ignore the compile commands JSON file in the examples directory.
examples/CMakeLists.txt (2)
1-20
: LGTM! Well-structured CMake configuration.The conversion to a top-level CMake script is well done, with clear project metadata and proper package dependencies.
32-34
: Consider adding error handling for example execution.The example targets are executed directly without checking their exit status.
test/CMakeLists.txt (1)
29-30
: LGTM! Good modernization of CMake targets.The update to use namespaced GTest targets (
GTest::gtest_main
,GTest::gmock_main
) follows CMake best practices.Also applies to: 36-36, 43-44
.github/workflows/ubuntu-20.04.yml (2)
198-202
: Fix package name typo.The package name contains a typo: 'libbencmark-dev' should be 'libbenchmark-dev'.
205-241
: LGTM! Well-structured workflow for examples.The workflow correctly handles example builds when sanitizers are disabled, with proper environment setup and build steps.
.circleci/config.yml (2)
70-118
: LGTM! Well-structured Linux example configuration.The Linux example build setup is properly configured with correct dependency installation and build steps.
215-241
: LGTM! Well-structured macOS example configuration.The macOS example build setup correctly uses Homebrew for dependencies and maintains consistency with the Linux configuration.
README.md (1)
39-39
: LGTM: CMake version update matches implementation.The minimum CMake version requirement of 3.16 aligns with the changes in CMakeLists.txt.
.github/workflows/old-compilers.yml (1)
495-498
: LGTM: Two-phase build setup looks good.The workflow correctly implements a two-phase build strategy:
- First phase builds examples using system-provided dependencies
- Second phase builds UnoDB itself using submodules
This demonstrates both usage patterns effectively.
Also applies to: 499-524, 525-531
.github/workflows/build.yml (1)
359-365
: LGTM: macOS dependency setup looks good.The macOS-specific package installation using Homebrew is correct and includes all necessary dependencies.
CMakeLists.txt (2)
348-350
: LGTM: Conditional subdirectory additions are well-implemented.The changes correctly implement conditional subdirectory additions for GSL, Google Test, and Google Benchmark. This allows UnoDB to:
- Use existing targets when available from the parent project
- Fall back to bundled versions when needed
The implementation follows CMake best practices for dependency management.
Also applies to: 384-392, 394-418
512-515
: LGTM: Conditional compile definitions are properly scoped.The compile definitions for the benchmark target are correctly wrapped in a conditional block to avoid modifying targets from the parent project.
5092fb9
to
34e417a
Compare
✅ Actions performedFull review triggered. |
9cc1ce4
to
d86fe48
Compare
There was a problem hiding this 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.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
.circleci/config.yml
(2 hunks).github/workflows/build.yml
(3 hunks).github/workflows/msvc-build.yml
(0 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).gitignore
(1 hunks)CMakeLists.txt
(5 hunks)README.md
(2 hunks)examples/CMakeLists.txt
(1 hunks)test/CMakeLists.txt
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/msvc-build.yml
⏰ Context from checks skipped due to timeout of 90000ms (20)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
🔇 Additional comments (22)
.gitignore (1)
49-49
: LGTM!Appropriate addition to ignore the compile commands database in the examples directory, consistent with the existing ignore pattern for the root directory.
examples/CMakeLists.txt (2)
1-10
: LGTM!Clear project setup with appropriate documentation explaining this is a top-level CMake script demonstrating UnoDB integration.
32-34
: Consider adding error handling for example execution.The example targets are executed directly without checking their exit status.
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'test/CMakeLists.txt (1)
29-30
: LGTM! Good modernization of CMake targets.Excellent update to use modern CMake namespaced targets (GTest::) consistently across all test-related targets.
Also applies to: 36-36, 43-44
.github/workflows/ubuntu-20.04.yml (1)
198-202
: Fix package name typo.The package name contains a typo: 'libmsgsl-dev' should be 'libmsgsl-dev'.
- run: sudo apt-get install -y libmsgsl-dev libgtest-dev libbenchmark-dev + run: sudo apt-get install -y libmsgsl-dev libgtest-dev libbenchmark-dev.circleci/config.yml (1)
70-118
: LGTM! Well-structured example setup.The example setup is well-organized and consistently implemented for both Linux and macOS builds. The conditional logic for sanitizer checks is clear and maintainable.
Also applies to: 215-241
CMakeLists.txt (5)
348-350
: LGTM! Well-structured conditional dependency inclusion.The conditional check for Microsoft.GSL::GSL target before adding the subdirectory follows CMake best practices for optional dependencies.
384-392
: LGTM! Proper handling of Google Test for Windows builds.Good practice to:
- Preserve the Windows-specific setting for shared CRT
- Apply sanitizer flags before adding the subdirectory
- Restore flags after adding the subdirectory
394-418
: LGTM! Comprehensive Google Benchmark configuration.Well-structured configuration that:
- Disables unnecessary features (testing, installation)
- Handles LTO appropriately for different build types and compilers
- Properly manages compiler flags
512-515
: LGTM! Conditional compile definitions for benchmark target.The compile definitions are now properly guarded to avoid modifying an existing target.
738-738
: LGTM! Simplified valgrind dependencies.Removed valgrind_examples dependency as it's now handled separately in the examples directory.
README.md (3)
39-39
: LGTM! Updated minimum CMake version requirement.The minimum CMake version has been updated to 3.16, which aligns with the features used in the build system.
44-47
: LGTM! Clear documentation of optional dependencies.The documentation now correctly describes GSL, Google Test, and Google Benchmark as optional git submodules that can be provided by the parent project.
70-74
: LGTM! Clear standalone build instructions.The instructions for standalone builds are now clearer about when submodules are required and what features are enabled.
.github/workflows/old-compilers.yml (4)
449-449
: LGTM! Disabled initial submodule checkout.Correctly disables submodule checkout initially to test example builds without vendored dependencies.
488-493
: LGTM! Proper dependency setup for examples.Dependencies are installed only when sanitizers are not enabled, which is correct as examples should be built with system-provided dependencies.
494-520
: LGTM! Well-structured CMake configuration for examples.The configuration properly:
- Creates a separate build directory for examples
- Sets up compiler-specific flags and tools
- Handles both GCC and Clang builds
521-527
: LGTM! Clean separation of example and main builds.Good practice to:
- Build examples first without submodules
- Then checkout submodules for the main build
Also applies to: 528-530
.github/workflows/build.yml (4)
289-289
: LGTM! Disabled initial submodule checkout.Correctly disables submodule checkout initially to test example builds without vendored dependencies.
343-349
: LGTM! Platform-aware dependency setup.Well-structured platform-specific dependency installation:
- Linux uses apt-get for package installation
- macOS uses brew for package installation
- Both are properly conditioned on sanitizer and analysis flags
Also applies to: 359-365
366-406
: LGTM! Comprehensive CMake configuration for examples.The configuration properly handles:
- Platform-specific compiler setup
- Build type configuration
- LLVM toolchain setup for clang builds
- macOS-specific settings
407-414
: LGTM! Clean separation of example and main builds.Good practice to:
- Build examples first without submodules
- Then checkout submodules for the main build
Also applies to: 415-417
d86fe48
to
512fc0b
Compare
There was a problem hiding this 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.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
.circleci/config.yml
(2 hunks).github/workflows/build.yml
(3 hunks).github/workflows/msvc-build.yml
(0 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(1 hunks).gitignore
(1 hunks)CMakeLists.txt
(5 hunks)README.md
(2 hunks)examples/CMakeLists.txt
(1 hunks)test/CMakeLists.txt
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/msvc-build.yml
🔇 Additional comments (22)
.gitignore (1)
49-49
: LGTM!Good addition to ignore the compilation database in the examples directory, consistent with the existing entry for the root directory.
examples/CMakeLists.txt (2)
33-35
: 🧹 Nitpick (assertive)Consider adding error handling for example execution.
The example targets are executed directly without checking their exit status. Consider wrapping them in a script that checks return values.
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'Likely invalid or redundant comment.
15-18
: 🧹 Nitpick (assertive)Add version constraints for dependencies.
While finding the required packages is good, consider adding version requirements to ensure compatibility.
-find_package(Microsoft.GSL REQUIRED) -find_package(GTest REQUIRED) -find_package(benchmark REQUIRED) +find_package(Microsoft.GSL 4.0 REQUIRED) +find_package(GTest 1.14 REQUIRED) +find_package(benchmark 1.8 REQUIRED)Likely invalid or redundant comment.
test/CMakeLists.txt (1)
29-30
: LGTM! Good use of namespaced targets.The changes correctly update the library linkage to use namespaced targets (
GTest::gtest_main
andGTest::gmock_main
) instead of bare library names. This is a CMake best practice that ensures proper target propagation.Also applies to: 36-36, 43-44
.github/workflows/ubuntu-20.04.yml (1)
203-204
: LGTM! Explicit build directory handling.Good practice to explicitly create and change to the build directory, making the workflow more reliable and easier to understand.
.circleci/config.yml (2)
70-118
: LGTM! Well-structured conditional example builds for Linux.Good implementation of conditional example builds when sanitizers are disabled. The setup properly handles:
- Build environment creation
- Dependency installation
- CMake configuration with compiler-specific settings
215-241
: LGTM! Well-structured conditional example builds for macOS.Good implementation of conditional example builds for macOS, following the same pattern as Linux. The setup correctly:
- Creates build environment
- Installs macOS-specific dependencies using brew
- Configures CMake appropriately
CMakeLists.txt (5)
348-350
: LGTM! Good improvement to GSL dependency handling.The conditional check ensures GSL is only added as a subdirectory if not already provided by the parent project, improving flexibility when UnoDB is used as a CMake subdirectory.
384-392
: LGTM! Well-structured Google Test integration.The changes properly handle:
- Conditional inclusion of Google Test
- Windows-specific CRT settings
- Compilation flags management
394-418
: LGTM! Comprehensive Google Benchmark setup.The implementation properly handles:
- Conditional inclusion of Google Benchmark
- Optimization of build by disabling unnecessary features
- Careful management of LTO support across different build configurations
512-515
: LGTM! Safe handling of benchmark compile definitions.The conditional check prevents modifying compile definitions of a potentially parent-owned benchmark target.
738-738
: LGTM! Appropriate update to valgrind target dependencies.Removed valgrind_examples dependency to align with the separation of examples into their own CMake project.
.github/workflows/old-compilers.yml (3)
449-449
: LGTM! Appropriate update to checkout behavior.Disabled automatic submodule initialization to support optional dependencies when used as a subdirectory.
488-493
: Fix package name typos in apt-get install command.The package names contain typos:
-sudo apt-get install libmsgsl-dev libgtest-dev libbencmark-dev +sudo apt-get install libmsgsl-dev libgtest-dev libbenchmark-dev
494-520
: LGTM! Well-structured CMake configuration for examples.The configuration properly handles different compilers and build types while maintaining consistent paths and flags.
.github/workflows/build.yml (4)
289-289
: LGTM! Consistent checkout behavior.Matches the submodule handling in old-compilers.yml.
343-349
: Fix package name typos in apt-get install command.The package names contain typos:
-sudo apt-get install libmsgsl-dev libgtest-dev libbencmark-dev +sudo apt-get install libmsgsl-dev libgtest-dev libbenchmark-dev
359-365
: LGTM! Good cross-platform support for examples.Properly handles macOS-specific package installation using brew.
366-406
: LGTM! Excellent cross-platform CMake configuration.The configuration comprehensively handles:
- Multiple compiler types
- Platform-specific settings
- Build type variations
README.md (3)
39-39
: LGTM! Appropriate CMake version requirement.The minimum CMake version of 3.16 aligns with the project's needs.
44-47
: LGTM! Clear dependency documentation.The updated section clearly explains the optional nature of the dependencies and their relationship with parent projects.
70-74
: LGTM! Clear build instructions.The documentation clearly explains when and why submodules are required, and the implications of the STANDALONE option.
52ee611
to
e6c3056
Compare
There was a problem hiding this 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 (3)
examples/CMakeLists.txt (3)
2-2
: 🧹 Nitpick (assertive)Consider increasing the minimum CMake version requirement.
The current minimum version (3.16) is from December 2019. Consider using a more recent version (e.g., 3.20) to access newer CMake features and improvements.
16-18
: 🧹 Nitpick (assertive)Consider version constraints for dependencies.
While finding the required packages is good, consider adding version requirements to ensure compatibility.
33-35
: 🧹 Nitpick (assertive)Consider adding error handling for example execution.
The example targets are executed directly without checking their exit status. Consider wrapping them in a script that checks return values.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
.circleci/config.yml
(2 hunks).github/workflows/build.yml
(3 hunks).github/workflows/msvc-build.yml
(0 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(1 hunks).gitignore
(1 hunks)CMakeLists.txt
(7 hunks)README.md
(2 hunks)examples/CMakeLists.txt
(1 hunks)test/CMakeLists.txt
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/msvc-build.yml
🔇 Additional comments (12)
.gitignore (1)
49-49
: LGTM!Appropriate addition to ignore the compile commands database in the examples directory.
test/CMakeLists.txt (1)
29-30
: LGTM! Improved CMake target usage.Good improvement using modern CMake practices with namespaced targets for Google Test dependencies.
Also applies to: 36-36, 43-44
.github/workflows/ubuntu-20.04.yml (1)
203-204
: LGTM! Improved workflow organization.Good consolidation of build directory creation with the CMake configuration step.
.circleci/config.yml (1)
70-118
: LGTM! Well-structured example build configuration for Linux.Good implementation of conditional example builds with proper dependency management and build isolation.
CMakeLists.txt (5)
350-352
: LGTM! Well-implemented conditional GSL integration.The condition correctly checks for the existence of the GSL target before adding the subdirectory, allowing UnoDB to use GSL provided by the parent project.
386-394
: LGTM! Well-implemented conditional Google Test integration.The implementation:
- Correctly checks for GTest target existence
- Properly handles Windows CRT settings
- Maintains consistent build flags
396-420
: LGTM! Well-implemented conditional Google Benchmark integration.The implementation:
- Correctly checks for benchmark target existence
- Properly handles testing and installation settings
- Includes well-conditioned LTO support
- Maintains consistent build flags
514-517
: LGTM! Proper handling of benchmark compile definitions.The condition correctly prevents modifying the benchmark target when it's provided by the parent project.
757-764
: LGTM! Well-implemented conditional test and benchmark directory additions.The implementation:
- Correctly conditions subdirectory additions on target existence
- Provides helpful error messages for standalone builds
- Includes appropriate informational messages for non-standalone builds
Also applies to: 771-778
.github/workflows/build.yml (1)
343-351
: LGTM! Well-structured workflow changes for building examples.The implementation:
- Properly sets up dependencies for both Linux and macOS
- Includes well-conditioned CMake configuration
- Maintains consistent build flags across platforms
Also applies to: 361-367, 368-408, 409-416
.github/workflows/old-compilers.yml (1)
488-495
: LGTM! Consistent workflow changes for building examples.The implementation maintains consistency with build.yml while properly handling example builds for older compilers.
Also applies to: 496-522, 523-529
README.md (1)
39-39
: LGTM! Clear and accurate documentation updates.The changes properly document:
- Updated CMake version requirement
- Optional nature of bundled dependencies
- Updated standalone build instructions
Also applies to: 44-47, 70-74
26a38a6
to
43c944f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.
Actionable comments posted: 1
🛑 Comments failed to post (1)
CMakeLists.txt (1)
421-422:
⚠️ Potential issueFix invalid generator expression syntax.
The generator expression is malformed and causing build failures. The condition is missing between
<
and:
.Apply this fix:
- target_compile_definitions(benchmark PUBLIC - "$<${is_gxx_not_release_standalone}:_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC>") + target_compile_definitions(benchmark PUBLIC + "$<$<BOOL:${is_gxx_not_release_standalone}>:_GLIBCXX_DEBUG;_GLIBCXX_DEBUG_PEDANTIC>")The fix:
- Adds the missing
$<BOOL:...>
condition- Separates multiple definitions with semicolons
📝 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.target_compile_definitions(benchmark PUBLIC "$<$<BOOL:${is_gxx_not_release_standalone}>:_GLIBCXX_DEBUG;_GLIBCXX_DEBUG_PEDANTIC>")
🧰 Tools
🪛 GitHub Actions: sonarcloud
[error] 421-421: Invalid generator expression: $<:_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC>
🪛 GitHub Actions: CodeQL
[error] 421-421: Error evaluating generator expression: $<:_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC>. Expression did not evaluate to a known generator expression
[warning] Manually-specified variables were not used by the project: BUILD_DOCS, BUILD_DOCUMENTATION, CATKIN_ENABLE_TESTING
🪛 GitHub Actions: experimental-build
[error] 421-421: Invalid generator expression: '$<:_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC>' in target_compile_definitions
🪛 GitHub Actions: msvc-build
[error] 421-421: Error evaluating generator expression: $<:_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC>
[error] Building standalone configuration but no Google Test found - have you initialized git submodules?
e471de6
to
9eda75e
Compare
There was a problem hiding this 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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
.circleci/config.yml
(2 hunks).github/workflows/build.yml
(3 hunks).github/workflows/msvc-build.yml
(0 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(1 hunks)CMakeLists.txt
(9 hunks)README.md
(2 hunks)examples/CMakeLists.txt
(1 hunks)test/CMakeLists.txt
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/msvc-build.yml
🔇 Additional comments (27)
examples/CMakeLists.txt (3)
15-18
: Consider adding version requirements for dependencies.While finding the required packages is good, consider adding version requirements to ensure compatibility.
-find_package(Microsoft.GSL REQUIRED) -find_package(GTest) -find_package(benchmark) +find_package(Microsoft.GSL 4.0 REQUIRED) +find_package(GTest 1.14) +find_package(benchmark 1.8)
33-35
: Consider adding error handling for example execution.The example targets are executed directly without checking their exit status.
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
4-7
: LGTM: Clear documentation of the file's purpose.The comment clearly explains that this is a top-level CMake script demonstrating UnoDB integration.
test/CMakeLists.txt (1)
29-30
: LGTM: Improved CMake target usage.The changes properly use modern CMake namespaced targets for GTest dependencies, which is the recommended approach.
Also applies to: 36-36, 43-44
.github/workflows/ubuntu-20.04.yml (1)
203-204
: LGTM: Improved build directory handling.Moving the build directory creation into the Configure CMake step improves organization and reduces script complexity.
.circleci/config.yml (3)
70-118
: LGTM: Well-structured example build configuration.The conditional block properly handles example builds when sanitizers are disabled, with appropriate dependency management and build steps.
215-241
: LGTM: Consistent macOS configuration.The macOS configuration mirrors the Linux setup while accounting for platform-specific package management.
84-85
:⚠️ Potential issueFix package name for Microsoft GSL.
The package name should be
libmsgsl-dev
.- sudo apt-get install -y libmsgsl-dev libgtest-dev \ - libgmock-dev + sudo apt-get install -y microsoft-gsl-dev libgtest-dev \ + libgmock-devLikely invalid or redundant comment.
README.md (2)
44-47
: LGTM: Clear documentation of dependency options.The documentation clearly explains that dependencies can be provided either as git submodules or by the parent project.
70-74
: 🧹 Nitpick (assertive)Consider improving the STANDALONE option documentation.
The explanation of the STANDALONE option and its implications could be clearer.
- if you work on UnoDB itself. In this case, the vendored development - dependencies must be present, i.e. `git submodule update --init --recursive`. - It will enable extra global debug checks that require entire programs to be - compiled with them. Currently, this consists of the libstdc++ debug mode. The - default is `OFF`. + if you work on UnoDB itself. When ON: + * The vendored development dependencies must be initialized using + `git submodule update --init --recursive` + * Extra global debug checks are enabled that require entire programs to be + compiled with them (currently, this consists of the libstdc++ debug mode) + The default is `OFF`.Likely invalid or redundant comment.
.github/workflows/old-compilers.yml (5)
449-449
: LGTM: Disabling initial submodule checkoutThe change to disable submodule checkout during the initial checkout is correct, as submodules are checked out later when needed.
488-495
: LGTM: Conditional installation of example dependenciesThe dependencies for examples are correctly installed only when sanitizers are disabled, which is appropriate as sanitizer builds don't need these dependencies.
496-522
: LGTM: Well-structured CMake configuration for examplesThe configuration correctly:
- Creates a separate build directory for examples
- Sets up compiler variables based on compiler type
- Configures LLVM toolchain for Clang release builds
523-529
: LGTM: Appropriate build configuration for examplesThe build step correctly uses parallel builds (-j3) and is properly conditioned on sanitizer flags.
530-532
: LGTM: Appropriate timing for submodule checkoutEnabling submodule checkout at this point is correct, as it's needed for the main build.
.github/workflows/build.yml (6)
289-289
: LGTM: Consistent submodule checkout configurationThe change to disable initial submodule checkout matches the configuration in old-compilers.yml.
343-351
: LGTM: Comprehensive conditional dependency setup for LinuxThe dependencies for examples are correctly installed with appropriate conditions for sanitizers, static analysis, and coverage flags.
361-367
: LGTM: Appropriate dependency setup for macOSThe dependencies are correctly installed using brew with proper conditions for sanitizers, static analysis, and coverage flags.
409-416
: LGTM: Appropriate build configuration for examplesThe build step correctly uses parallel builds (-j3) and is properly conditioned on all relevant flags.
417-419
: LGTM: Consistent submodule checkout timingEnabling submodule checkout at this point matches the configuration in old-compilers.yml.
426-427
: LGTM: Standard build directory setupThe build directory creation is correctly placed before CMake configuration.
CMakeLists.txt (6)
4-5
: LGTM: Added header check capabilityIncluding CheckIncludeFile is appropriate for the header availability checks used later.
350-352
: LGTM: Proper handling of GSL dependencyThe conditional inclusion of GSL prevents double inclusion when UnoDB is used as a subdirectory.
424-433
: LGTM: Proper Google Test integrationThe Google Test configuration correctly:
- Prevents double inclusion
- Handles Windows-specific settings
- Manages compiler flags appropriately
491-492
: LGTM: Correct DeepState path configurationThe source and binary directory paths are correctly specified relative to the CMake context.
520-526
: LGTM: Proper handling of third-party includesUsing SYSTEM for benchmark include directories is the correct approach to suppress warnings from third-party headers.
625-625
: LGTM: Appropriate visibility for compile definitionsChanging the compile definitions from PRIVATE to PUBLIC is correct as these definitions need to be available to library consumers.
b3558a9
to
43934df
Compare
b89b3b6
to
3b66ddd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🔭 Outside diff range comments (3)
.github/workflows/valgrind.yml (1)
48-48
: 🧹 Nitpick (assertive)Adjust parallel job count for better resource utilization.
Using a fixed
-j3
value is suboptimal. Use$(nproc)
to scale with available cores.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
36-42
: 🛠️ Refactor suggestionUse a more robust approach for Python binary removal.
The current approach of removing specific Python binaries is brittle. Use
brew unlink [email protected]
instead.- rm '/usr/local/bin/2to3-3.11' - rm '/usr/local/bin/idle3.11' - rm '/usr/local/bin/pydoc3.11' - rm '/usr/local/bin/python3.11' - rm '/usr/local/bin/python3.11-config' + brew unlink [email protected] || true brew update brew install boost cppcheck.github/workflows/ubuntu-20.04.yml (1)
221-225
: 🧹 Nitpick (assertive)Use array for CMake arguments.
The CMake command line is hard to maintain. Use an array to build the command.
- cmake -B build "$GITHUB_WORKSPACE" -DSTANDALONE=ON \ - "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" \ - "-DSANITIZE_ADDRESS=${SANITIZE_ADDRESS}" \ - "-DSANITIZE_THREAD=${SANITIZE_THREAD}" \ - "-DSANITIZE_UB=${SANITIZE_UB}" "${EXTRA_CMAKE_ARGS[@]}" + CMAKE_ARGS=( + -B build + "$GITHUB_WORKSPACE" + -DSTANDALONE=ON + "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" + "-DSANITIZE_ADDRESS=${SANITIZE_ADDRESS}" + "-DSANITIZE_THREAD=${SANITIZE_THREAD}" + "-DSANITIZE_UB=${SANITIZE_UB}" + ) + cmake "${CMAKE_ARGS[@]}" "${EXTRA_CMAKE_ARGS[@]}"
♻️ Duplicate comments (8)
.github/workflows/examples.yml (1)
52-52
: 🧹 Nitpick (assertive)Adjust parallel job count for better resource utilization.
Using a fixed
-j3
value is suboptimal.- run: make -j3 -k examples + run: make -j$(($(nproc) / 2)) -k examples- run: make -j3 -k valgrind_examples + run: make -j$(($(nproc) / 2)) -k valgrind_examplesAlso applies to: 56-56
examples/CMakeLists.txt (3)
40-42
: 🛠️ Refactor suggestionAdd error handling for example execution.
The example targets are executed without checking their exit status.
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
2-2
: 🧹 Nitpick (assertive)Increase minimum CMake version requirement.
The current minimum version (3.16) is from December 2019. Use a more recent version (e.g., 3.20) to access newer CMake features and improvements.
-cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.20)
17-22
: 🧹 Nitpick (assertive)Add version requirements for dependencies.
The find_package calls should specify minimum version requirements to ensure compatibility.
- find_package(GTest) - find_package(benchmark) + find_package(GTest 1.14 REQUIRED) + find_package(benchmark 1.8 REQUIRED).github/workflows/msvc-build.yml (1)
61-63
: 🧹 Nitpick (assertive)Optimize checkout strategy.
The checkout step with
submodules: false
followed by later submodule initialization is inefficient.- - uses: actions/checkout@v4 - with: - submodules: false + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset).circleci/config.yml (2)
198-223
:⚠️ Potential issueFix CMake path for macOS examples.
The CMake command uses an incorrect path to the source directory:
- cmake ../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE + cmake ../../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE
70-101
: 🧹 Nitpick (assertive)Extract compiler version setup into variables.
The compiler version setup is duplicated between examples and main build. Extract the versions into variables at the top of the file:
+readonly GCC_VERSION=13 +readonly CLANG_VERSION=19 if [[ $COMPILER == "gcc" ]]; then - V=13 - export CC=gcc-$V - export CXX=g++-$V + export CC=gcc-$GCC_VERSION + export CXX=g++-$GCC_VERSION elif [[ $COMPILER == "clang" ]]; then - V=19 - export CC=clang-$V - export CXX=clang++-$V + export CC=clang-$CLANG_VERSION + export CXX=clang++-$CLANG_VERSION fiCMakeLists.txt (1)
452-463
: 🧹 Nitpick (assertive)Add comment explaining GTest target condition.
The condition for building GTest is not immediately obvious. Add a comment explaining why we check for both STANDALONE and existing target:
+ # Build GTest if we're in standalone mode or if the parent project hasn't already provided it if (STANDALONE OR NOT TARGET GTest::gtest_main)
🧰 Tools
🪛 GitHub Actions: experimental-build
[error] 457-457: Unknown CMake command "ADD_CXX_FLAGS_FOR_SUBDIR".
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(4 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(5 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: experimental-build
examples/CMakeLists.txt
[error] 457-457: Unknown CMake command "ADD_CXX_FLAGS_FOR_SUBDIR".
CMakeLists.txt
[error] 457-457: Unknown CMake command "ADD_CXX_FLAGS_FOR_SUBDIR".
test/CMakeLists.txt
[error] 457-457: Unknown CMake command "ADD_CXX_FLAGS_FOR_SUBDIR".
🔇 Additional comments (9)
.github/workflows/feature-matrix-build.yml (2)
34-34
: Smart conditional submodule checkout.Good use of conditional submodule checkout based on test/benchmark requirements.
51-51
: 🧹 Nitpick (assertive)Adjust parallel job count for better resource utilization.
Using a fixed
-j3
value is suboptimal.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/codeql-analysis.yml (1)
52-52
: 🧹 Nitpick (assertive)Adjust parallel job count for better resource utilization.
Using a fixed
-j3
value is suboptimal.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
54-54
: 🧹 Nitpick (assertive)Adjust parallel job count for better resource utilization.
Using a fixed
-j3
value is suboptimal.- run: make -j3 -k + run: make -j$(($(sysctl -n hw.ncpu) / 2)) -k.github/workflows/examples.yml (1)
37-39
:❓ Verification inconclusive
Use version constraints for dependencies.
Installing dependencies without version constraints could lead to unexpected behavior.
🏁 Script executed:
#!/bin/bash # Check available versions of dependencies apt-cache policy libgtest-dev libgmock-dev libbenchmark-devLength of output: 161
Manual Verification Needed: Add Version Constraints to Dependency Installations
The current workflow at
.github/workflows/examples.yml
(lines 37-39) installs several dependencies without locking their versions, which might lead to unpredictable behavior when package versions change. Our attempt to verify available versions viaapt-cache
failed due to the command not being found. Please manually verify on an environment whereapt-cache
(or a suitable alternative) is available and update the workflow to include explicit version constraints.
- File:
.github/workflows/examples.yml
(lines 37-39)- Action: Update dependency installation commands to specify exact versions.
- Note: The absence of
apt-cache
output necessitates manual verification to determine appropriate version constraints for dependencies likelibgtest-dev
,libgmock-dev
, andlibbenchmark-dev
..circleci/config.yml (1)
31-32
: LGTM! Dependencies properly configured for examples.The added dependencies (Google Test, Google Mock, Google Benchmark) are correctly specified and align with the PR's objective to enhance UnoDB integration.
.github/workflows/build.yml (1)
19-19
: LGTM! Secure permissions configuration.Empty permissions object follows the principle of least privilege, ensuring the workflow only has necessary access.
.github/workflows/old-compilers.yml (1)
17-17
: LGTM! Security and build improvements.
- Empty permissions object follows security best practices
- Using CMake's -B flag is cleaner than mkdir + cd
Also applies to: 513-513
CMakeLists.txt (1)
767-767
:❓ Verification inconclusive
Verify valgrind coverage after dependency removal.
The valgrind target no longer depends on valgrind_benchmarks and valgrind_examples. Ensure this doesn't miss critical memory leak checks.
🏁 Script executed:
#!/bin/bash # Description: Check for any valgrind-related targets that might need to be included echo "=== Searching for valgrind targets ===" rg "add_.*target.*valgrind" -A 2 -B 2 echo -e "\n=== Checking for memory leak tests ===" rg "leak.*check|valgrind.*memory" -g "CMakeLists.txt" -A 2 -B 2Length of output: 2347
Ensure comprehensive memory leak testing despite the simplified valgrind target.
The update in CMakeLists.txt now defines the main target as:
add_custom_target(valgrind)
This change removes its dependencies on valgrind_benchmarks and valgrind_examples. Although our search confirms that memory leak options (e.g.,
--leak-check=full
) are still configured and that dedicated targets (like valgrind_examples, valgrind_benchmarks, valgrind_tests, etc.) exist, you must verify that these specialized targets are invoked as needed within your testing workflows (CI and manual runs). In short, ensure that simplifying the main target doesn’t inadvertently omit critical memory leak checks.
3b66ddd
to
d1e0c16
Compare
There was a problem hiding this 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 (3)
.github/workflows/valgrind.yml (1)
48-48
: 🧹 Nitpick (assertive)Optimize build parallelism.
Replace hardcoded job count with dynamic CPU core detection.
- run: make -j3 -k + run: make -j$(nproc) -k.github/workflows/experimental-build.yml (2)
36-40
: 🛠️ Refactor suggestionReplace manual Python symlink removal.
Manual removal of Python symlinks is brittle and may break with Python version updates.
- rm '/usr/local/bin/2to3-3.11' - rm '/usr/local/bin/idle3.11' - rm '/usr/local/bin/pydoc3.11' - rm '/usr/local/bin/python3.11' - rm '/usr/local/bin/python3.11-config' + find /usr/local/bin -type l -name '*3.11*' -delete
55-55
:⚠️ Potential issueRemove continue-on-error.
Using continue-on-error masks build failures and may hide critical issues.
- continue-on-error: true
♻️ Duplicate comments (5)
.github/workflows/examples.yml (1)
52-52
: 🧹 Nitpick (assertive)Optimize build parallelism.
Replace hardcoded job count with dynamic CPU core detection.
- run: make -j3 -k examples + run: make -j$(nproc) -k examples - run: make -j3 -k valgrind_examples + run: make -j$(nproc) -k valgrind_examplesAlso applies to: 56-56
.circleci/config.yml (2)
219-219
:⚠️ Potential issueFix the CMake configuration path for macOS examples.
The CMake command uses a relative path that assumes a specific directory structure. Use the workspace root:
- cmake ../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE + cmake "$GITHUB_WORKSPACE/examples" -DCMAKE_BUILD_TYPE=$BUILD_TYPE
83-91
: 🧹 Nitpick (assertive)Extract compiler versions into variables.
Hardcoded compiler versions make maintenance harder. Consider extracting them into variables at the top of the file:
+ readonly GCC_VERSION=13 + readonly CLANG_VERSION=19 if [[ $COMPILER == "gcc" ]]; then - V=13 + V=$GCC_VERSION export CC=gcc-$V export CXX=g++-$V elif [[ $COMPILER == "clang" ]]; then - V=19 + V=$CLANG_VERSION export CC=clang-$V export CXX=clang++-$V fiCMakeLists.txt (2)
453-464
: 🧹 Nitpick (assertive)Add a comment explaining the GTest target condition.
The condition for building GTest is not immediately obvious. Add a comment explaining why we check for both STANDALONE and existing target:
+ # Build GTest if we're in standalone mode or if the parent project hasn't already provided it if (STANDALONE OR NOT TARGET GTest::gtest_main)
525-553
: 🧹 Nitpick (assertive)Extract LTO configuration into a separate function.
The LTO configuration logic is complex and would be more maintainable as a separate function:
+ function(configure_benchmark_lto) + if(NOT IPO_SUPPORTED) + return() + endif() + + if(is_debug) + message(STATUS "Disabling LTO for Google Benchmark due to debug build") + return() + endif() + + if(is_apple_clang) + message(STATUS "Disabling LTO for Google Benchmark because Apple clang is not supported") + return() + endif() + + set(BENCHMARK_ENABLE_LTO ON CACHE BOOL "Enabling LTO for Google Benchmark" FORCE) + message(STATUS "Enabling LTO for Google Benchmark") + endfunction() if(STANDALONE OR NOT TARGET benchmark::benchmark) set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Suppressing Google Benchmark tests" FORCE) set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Suppressing Google Benchmark installation" FORCE) - if(IPO_SUPPORTED) - if(is_debug) - message(STATUS "Disabling LTO for Google Benchmark due to debug build") - elseif(is_apple_clang) - message(STATUS "Disabling LTO for Google Benchmark because Apple clang is not supported") - else() - set(BENCHMARK_ENABLE_LTO ON CACHE BOOL "Enabling LTO for Google Benchmark" FORCE) - message(STATUS "Enabling LTO for Google Benchmark") - endif() - endif() + configure_benchmark_lto()
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(4 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(5 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (40)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
🔇 Additional comments (19)
.github/workflows/feature-matrix-build.yml (1)
51-51
: 🧹 Nitpick (assertive)Optimize build parallelism.
Replace hardcoded job count with dynamic CPU core detection.
- run: make -j3 -k + run: make -j$(nproc) -k.github/workflows/codeql-analysis.yml (1)
52-52
: 🧹 Nitpick (assertive)Optimize build parallelism.
Replace hardcoded job count with dynamic CPU core detection.
- run: make -j3 -k + run: make -j$(nproc) -kexamples/CMakeLists.txt (2)
39-43
: Add error handling for example execution.The example targets are still executed directly without checking their exit status.
Apply this diff to add error handling:
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
45-46
: Use list() for Valgrind command arguments.Define Valgrind command arguments using CMake list() for better maintainability.
Apply this diff:
-set(VALGRIND_COMMAND "valgrind" "--error-exitcode=1" "--leak-check=full" - "--trace-children=yes" "-v") +list(APPEND VALGRIND_COMMAND + "valgrind" + "--error-exitcode=1" + "--leak-check=full" + "--trace-children=yes" + "-v" +)examples/CMakePresets.json (2)
24-27
: Add explicit compiler flags for clang-cl.The clang-cl configuration could benefit from explicit compiler flags.
Apply this diff:
"cacheVariables": { "CMAKE_C_COMPILER": "clang-cl", - "CMAKE_CXX_COMPILER": "clang-cl" + "CMAKE_CXX_COMPILER": "clang-cl", + "CMAKE_C_FLAGS": "-m64", + "CMAKE_CXX_FLAGS": "-m64 -fno-delayed-template-parsing" },
83-108
: LGTM!The build configurations are well-structured and correctly linked to their configure presets.
test/CMakeLists.txt (3)
29-30
: Add version check for GTest.While the namespace update is good, add a version check to ensure compatibility.
Apply this diff:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(db_test_utils PUBLIC unodb GTest::gtest_main GTest::gmock_main)
36-37
: Add version check for GTest.Add a version check to ensure compatibility.
Apply this diff:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(qsbr_test_utils PUBLIC GTest::gtest_main)
43-44
: Add version check for GTest.Add a version check to ensure compatibility.
Apply this diff:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries("${TARGET}" PRIVATE unodb_qsbr unodb_test GTest::gtest_main).github/workflows/msvc-build.yml (3)
17-24
: Use JSON arrays for preset lists.The multiline string format for presets is error-prone.
Apply this diff:
- EXAMPLE_PRESETS: >- - msvc-debug - msvc-release - msvc-llvm-debug - msvc-llvm-release + EXAMPLE_PRESETS: '["msvc-debug", "msvc-release", "msvc-llvm-debug", "msvc-llvm-release"]'
61-64
: Consider combining checkout steps.The workflow has two separate checkout steps that could be combined for better efficiency.
Apply this diff:
- - uses: actions/checkout@v4 - with: - submodules: false - # ... example steps ... - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset)
79-87
: LGTM!The CMake configuration for examples is well-structured and correctly implemented.
.github/workflows/ubuntu-20.04.yml (1)
221-225
: LGTM!The CMake configuration with build directory is well-structured and correctly implemented.
.circleci/config.yml (2)
31-32
: LGTM! Dependencies properly configured.The addition of Google Test, Google Mock, and Google Benchmark packages aligns with the PR's objective to enhance UnoDB integration within CMake projects.
70-77
: LGTM! Well-structured conditional block for examples.The conditional block properly handles example builds when sanitizers are disabled.
.github/workflows/build.yml (1)
19-19
: LGTM! Secure permissions configuration.Empty permissions object follows the principle of least privilege.
.github/workflows/old-compilers.yml (1)
17-17
: LGTM! Consistent permissions configuration.Empty permissions object matches the configuration in build.yml.
CMakeLists.txt (2)
406-407
: LGTM! Well-designed dependency handling.The condition properly handles both standalone builds and integration scenarios by checking for either STANDALONE mode or missing dependency targets.
768-768
: LGTM! Simplified valgrind target.The valgrind target is now more flexible, allowing individual components to add their own dependencies as needed.
d1e0c16
to
8056a55
Compare
There was a problem hiding this 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 (5)
.github/workflows/feature-matrix-build.yml (2)
49-50
: 🧹 Nitpick (assertive)Remove redundant working-directory.
The working-directory is unnecessary since CMake already specifies the build directory with
-B build
.- working-directory: ${{github.workspace}}/build run: make -j3 -k
50-50
: 🧹 Nitpick (assertive)Optimize make job count.
Using a fixed number of jobs (-j3) might not be optimal for all environments.
- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/valgrind.yml (1)
47-52
: 🧹 Nitpick (assertive)Optimize build configuration.
Multiple improvements can be made to the build steps:
- Remove redundant working-directory
- Optimize make job count
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/codeql-analysis.yml (1)
51-52
: 🧹 Nitpick (assertive)Optimize build configuration.
For consistency with other workflows:
- Remove redundant working-directory
- Optimize make job count
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
53-54
: 🧹 Nitpick (assertive)Optimize build configuration for macOS.
For consistency with other workflows:
- Remove redundant working-directory
- Optimize make job count using macOS-compatible command
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(sysctl -n hw.ncpu) / 2)) -k
♻️ Duplicate comments (4)
.github/workflows/valgrind.yml (1)
36-36
: 🧹 Nitpick (assertive)Use apt instead of snap for valgrind.
Snap is unnecessary when valgrind is available in apt repositories.
- sudo snap install --classic valgrind + sudo apt-get install -y valgrind.github/workflows/examples.yml (1)
37-39
: 🧹 Nitpick (assertive)Consolidate package installation commands.
Multiple apt-get and snap commands can be consolidated into a single apt-get command.
- sudo apt-get install -y libboost-dev libc6-dev-i386 libc6-dbg \ - libgtest-dev libgmock-dev libbenchmark-dev - sudo snap install --classic valgrind + sudo apt-get install -y \ + libboost-dev \ + libc6-dev-i386 \ + libc6-dbg \ + libgtest-dev \ + libgmock-dev \ + libbenchmark-dev \ + valgrind.circleci/config.yml (2)
70-101
: 🧹 Nitpick (assertive)Extract compiler version variables.
The compiler version setup is correct but could be more maintainable.
Apply this diff to improve maintainability:
if [[ $COMPILER == "gcc" ]]; then - V=13 + GCC_VERSION=13 - export CC=gcc-$V - export CXX=g++-$V + export CC=gcc-$GCC_VERSION + export CXX=g++-$GCC_VERSION elif [[ $COMPILER == "clang" ]]; then - V=19 + CLANG_VERSION=19 - export CC=clang-$V - export CXX=clang++-$V + export CC=clang-$CLANG_VERSION + export CXX=clang++-$CLANG_VERSION fi
198-224
:⚠️ Potential issueFix the CMake configuration path for macOS examples.
The CMake command uses an incorrect path to the source directory.
Apply this diff to fix the path:
- cmake ../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE + cmake ../../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(4 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(5 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
🔇 Additional comments (10)
examples/CMakeLists.txt (2)
39-43
: Add error handling for example execution.The example targets are executed directly without checking their exit status.
Apply this diff to add error handling:
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
45-46
: Use list() for Valgrind command arguments.Define Valgrind command arguments using CMake list() for better maintainability.
Apply this diff to use list():
-set(VALGRIND_COMMAND "valgrind" "--error-exitcode=1" "--leak-check=full" - "--trace-children=yes" "-v") +list(APPEND VALGRIND_COMMAND + "valgrind" + "--error-exitcode=1" + "--leak-check=full" + "--trace-children=yes" + "-v" +)examples/CMakePresets.json (1)
21-33
: Add explicit compiler flags for clang-cl.The clang-cl configuration could benefit from explicit compiler flags.
Apply this diff to add explicit flags:
"cacheVariables": { "CMAKE_C_COMPILER": "clang-cl", - "CMAKE_CXX_COMPILER": "clang-cl" + "CMAKE_CXX_COMPILER": "clang-cl", + "CMAKE_C_FLAGS": "-m64", + "CMAKE_CXX_FLAGS": "-m64 -fno-delayed-template-parsing" },test/CMakeLists.txt (1)
29-30
: Add version check for GTest.While the namespace update is good, add a version check to ensure compatibility.
Apply this diff to add version check:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(db_test_utils PUBLIC unodb GTest::gtest_main GTest::gmock_main).github/workflows/msvc-build.yml (2)
17-24
: Use JSON arrays for preset lists.The multiline string format for presets is error-prone.
Apply this diff to use JSON arrays:
- EXAMPLE_PRESETS: >- - msvc-debug - msvc-release - msvc-llvm-debug - msvc-llvm-release + EXAMPLE_PRESETS: '["msvc-debug", "msvc-release", "msvc-llvm-debug", "msvc-llvm-release"]'
61-64
: Combine checkout steps.The workflow has two separate checkout steps that could be combined for better efficiency.
Apply this diff to combine checkout steps:
- - uses: actions/checkout@v4 - with: - submodules: false - # ... example steps ... - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset)Also applies to: 98-101
.github/workflows/ubuntu-20.04.yml (1)
206-220
: Extract compiler versions into variables.The compiler versions are hardcoded. Extract them into variables at the workflow level for easier maintenance.
Apply this diff to extract compiler versions:
env: DEFAULT_SANITIZE_ADDRESS: OFF DEFAULT_SANITIZE_THREAD: OFF DEFAULT_SANITIZE_UB: OFF + GCC_VERSION: "13" + CLANG_VERSION: "19" jobs: build: steps: - name: Configure CMake (examples) run: | if [[ $COMPILER == "gcc" ]]; then - export CC="gcc-${VERSION}" - export CXX="g++-${VERSION}" + export CC="gcc-${GCC_VERSION}" + export CXX="g++-${GCC_VERSION}" else - export CC="clang-${VERSION}" - export CXX="clang++-${VERSION}" + export CC="clang-${CLANG_VERSION}" + export CXX="clang++-${CLANG_VERSION}" fi.circleci/config.yml (1)
31-32
: LGTM! Proper dependency setup for examples.The installation of Google Test, Google Mock, and Google Benchmark system packages aligns with the PR objective of using system-provided dependencies.
.github/workflows/build.yml (1)
19-19
: LGTM! Explicit permissions declaration.Empty permissions object follows security best practices by explicitly declaring no permissions are needed.
.github/workflows/old-compilers.yml (1)
513-519
: LGTM! Proper CMake command structure.The CMake command properly uses the -B flag and maintains consistent argument ordering.
8056a55
to
bc16bbf
Compare
There was a problem hiding this 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 (4)
.github/workflows/feature-matrix-build.yml (2)
48-50
: 🧹 Nitpick (assertive)Remove redundant working-directory specification.
Since you're using
cmake -B build
, the working-directory specification is unnecessary.- working-directory: ${{github.workspace}}/build run: make -j3 -k
50-50
: 🧹 Nitpick (assertive)Optimize build parallelism.
Using a fixed job count may not be optimal across different runners.
- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
36-42
: 🧹 Nitpick (assertive)Consolidate Python cleanup.
The Python binary removal can be simplified using a pattern.
- rm '/usr/local/bin/2to3-3.11' - rm '/usr/local/bin/idle3.11' - rm '/usr/local/bin/pydoc3.11' - rm '/usr/local/bin/python3.11' - rm '/usr/local/bin/python3.11-config' + rm /usr/local/bin/*3.11*CMakeLists.txt (1)
1-11
:⚠️ Potential issueFix CMake command order.
Move
cmake_minimum_required()
beforeproject()
to ensure proper CMake initialization and version compatibility.Apply this diff:
# Copyright 2019-2025 Laurynas Biveinis -cmake_minimum_required(VERSION 3.16) - # Set to new once Boost 1.70 is the minimum oldest version if(POLICY CMP0167) cmake_policy(SET CMP0167 OLD) endif() +cmake_minimum_required(VERSION 3.16) + project(unodb VERSION 0.1 DESCRIPTION "unodb key-value store library" HOMEPAGE_URL "https://github.com/laurynas-biveinis/unodb" LANGUAGES CXX)
♻️ Duplicate comments (12)
.github/workflows/valgrind.yml (1)
36-36
: 🧹 Nitpick (assertive)Use apt instead of snap for valgrind.
Valgrind is available in apt repositories, making snap installation unnecessary.
- sudo snap install --classic valgrind + sudo apt-get install -y valgrind.github/workflows/examples.yml (2)
37-39
: 🧹 Nitpick (assertive)Consolidate package installation.
Multiple package installation commands can be consolidated.
- sudo apt-get install -y libboost-dev libc6-dev-i386 libc6-dbg \ - libgtest-dev libgmock-dev libbenchmark-dev - sudo snap install --classic valgrind + sudo apt-get install -y \ + libboost-dev \ + libc6-dev-i386 \ + libc6-dbg \ + libgtest-dev \ + libgmock-dev \ + libbenchmark-dev \ + valgrind
51-56
: 🧹 Nitpick (assertive)Optimize build configuration.
Consistent with other workflows, optimize the build configuration.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k examples + run: make -j$(($(nproc) / 2)) -k examples - working-directory: ${{github.workspace}}/build - run: make -j3 -k valgrind_examples + run: make -j$(($(nproc) / 2)) -k valgrind_examplesexamples/CMakeLists.txt (4)
12-14
:⚠️ Potential issueDefault TESTS and BENCHMARKS options to OFF.
These options default to ON which means they'll try to find GTest and benchmark packages by default. This could fail if these packages aren't available in the parent project.
Apply this diff to fix the issue:
-option(TESTS "Find Google Test in the parent project for UnoDB to use" ON) -option(BENCHMARKS "Find Google Benchmark in the parent project for UnoDB to use" - ON) +option(TESTS "Find Google Test in the parent project for UnoDB to use" OFF) +option(BENCHMARKS "Find Google Benchmark in the parent project for UnoDB to use" + OFF)
40-42
:⚠️ Potential issueAdd error handling for example execution.
The example targets are executed directly without checking their exit status.
Apply this diff to fix the issue:
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
45-46
: 🧹 Nitpick (assertive)Use list() for Valgrind command arguments.
Define Valgrind command arguments using CMake list() for better maintainability.
Apply this diff to fix the issue:
-set(VALGRIND_COMMAND "valgrind" "--error-exitcode=1" "--leak-check=full" - "--trace-children=yes" "-v") +list(APPEND VALGRIND_COMMAND + "valgrind" + "--error-exitcode=1" + "--leak-check=full" + "--trace-children=yes" + "-v" +)
1-10
:⚠️ Potential issueAdd cmake_minimum_required() before project().
The pipeline failures indicate that
cmake_minimum_required()
should be called before theproject()
call.Apply this diff to fix the issue:
# Copyright 2024-2025 Laurynas Biveinis +cmake_minimum_required(VERSION 3.20) # This is a top-level CMake script and not an include of ../CMakeLists.txt. In # fact, this one includes the one in the parent directory to show how another # project can integrate UnoDB in its build. project(unodb-examples VERSION 0.1 DESCRIPTION "unodb key-value store library examples" HOMEPAGE_URL "https://github.com/laurynas-biveinis/unodb" LANGUAGES CXX)
examples/CMakePresets.json (1)
20-22
: 🧹 Nitpick (assertive)Add explicit compiler flags for clang-cl.
The clang-cl configuration could benefit from explicit compiler flags.
Apply this diff to fix the issue:
"cacheVariables": { "CMAKE_C_COMPILER": "clang-cl", - "CMAKE_CXX_COMPILER": "clang-cl" + "CMAKE_CXX_COMPILER": "clang-cl", + "CMAKE_C_FLAGS": "-m64", + "CMAKE_CXX_FLAGS": "-m64 -fno-delayed-template-parsing" },test/CMakeLists.txt (1)
29-30
: 🧹 Nitpick (assertive)Add version check for GTest.
While the namespace update is good, add a version check to ensure compatibility.
Apply this diff to fix the issue:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(db_test_utils PUBLIC unodb GTest::gtest_main GTest::gmock_main).github/workflows/msvc-build.yml (2)
17-24
: 🧹 Nitpick (assertive)Use JSON arrays for preset lists.
The multiline string format for presets is error-prone. Use JSON arrays instead.
Apply this diff to fix the issue:
- EXAMPLE_PRESETS: >- - msvc-debug - msvc-release - msvc-llvm-debug - msvc-llvm-release - STATIC_ANALYSIS_PRESETS: >- - msvc-static-analysis-debug - msvc-static-analysis-release + EXAMPLE_PRESETS: '["msvc-debug", "msvc-release", "msvc-llvm-debug", "msvc-llvm-release"]' + STATIC_ANALYSIS_PRESETS: '["msvc-static-analysis-debug", "msvc-static-analysis-release"]'
61-64
: 🧹 Nitpick (assertive)Consider combining checkout steps.
The workflow has two separate checkout steps that could be combined for better efficiency.
Apply this diff to fix the issue:
- - uses: actions/checkout@v4 - with: - submodules: false - # ... example steps ... - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset).circleci/config.yml (1)
70-101
: 🧹 Nitpick (assertive)Extract compiler version variables.
The conditional block is well-structured but would be more maintainable with named version variables.
Apply this diff:
if [[ $COMPILER == "gcc" ]]; then - V=13 + GCC_VERSION=13 - export CC=gcc-$V - export CXX=g++-$V + export CC=gcc-$GCC_VERSION + export CXX=g++-$GCC_VERSION elif [[ $COMPILER == "clang" ]]; then - V=19 + CLANG_VERSION=19 - export CC=clang-$V - export CXX=clang++-$V + export CC=clang-$CLANG_VERSION + export CXX=clang++-$CLANG_VERSION fi
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(4 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(6 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CodeQL
CMakeLists.txt
[warning] 15-15: cmake_minimum_required() should be called prior to this top-level project() call.
[warning] 16-16: Compatibility with CMake < 3.10 will be removed from a future version of CMake.
test/CMakeLists.txt
[warning] 15-15: cmake_minimum_required() should be called prior to this top-level project() call.
[warning] 16-16: Compatibility with CMake < 3.10 will be removed from a future version of CMake.
examples/CMakeLists.txt
[warning] 15-15: cmake_minimum_required() should be called prior to this top-level project() call.
[warning] 16-16: Compatibility with CMake < 3.10 will be removed from a future version of CMake.
⏰ Context from checks skipped due to timeout of 90000ms (40)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, OFF, OFF)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, OFF, OFF)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, OFF, OFF)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, OFF, OFF)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
🔇 Additional comments (10)
.github/workflows/valgrind.yml (1)
47-52
: 🧹 Nitpick (assertive)Optimize build configuration.
Similar to other workflows, optimize the build configuration.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/codeql-analysis.yml (1)
51-52
: 🧹 Nitpick (assertive)Optimize build configuration.
Consistent with other workflows, optimize the build configuration.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
53-55
: 🧹 Nitpick (assertive)Optimize build configuration.
Consistent with other workflows, optimize the build configuration.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(sysctl -n hw.ncpu) / 2)) -k.github/workflows/ubuntu-20.04.yml (1)
10-14
: 🧹 Nitpick (assertive)Consider extracting compiler versions into variables.
The configuration is well-structured, but the compiler versions are hardcoded. Extract them into variables at the workflow level for easier maintenance.
Apply this diff to fix the issue:
env: DEFAULT_SANITIZE_ADDRESS: OFF DEFAULT_SANITIZE_THREAD: OFF DEFAULT_SANITIZE_UB: OFF + GCC_VERSION: "13" + CLANG_VERSION: "19"CMakeLists.txt (4)
406-407
: LGTM! Well-structured condition for test and benchmark builds.The condition properly handles both standalone mode and parent project integration by checking for target existence.
453-464
: LGTM! Proper GTest integration.The configuration correctly handles GTest in both standalone and parent project modes, with proper Windows CRT settings.
525-553
: LGTM! Comprehensive Google Benchmark setup.The configuration properly handles LTO settings and integrates with parent projects.
770-772
: LGTM! Improved valgrind target flexibility.Creating the valgrind target without initial dependencies and adding them conditionally later is a cleaner approach.
.github/workflows/build.yml (1)
19-19
: LGTM! Explicit empty permissions.Setting an empty permissions object is a security best practice, following the principle of least privilege.
.github/workflows/old-compilers.yml (1)
17-17
: LGTM! Consistent permissions configuration.The empty permissions object matches the configuration in other workflow files.
1f3f4fa
to
cec73b0
Compare
There was a problem hiding this 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 (4)
.github/workflows/feature-matrix-build.yml (2)
34-34
: 🧹 Nitpick (assertive)Optimize submodule checkout.
The submodule checkout condition
${{ matrix.TESTS == 'ON' || matrix.BENCHMARKS == 'ON' }}
is inefficient. When neither tests nor benchmarks are enabled, the checkout still occurs but withsubmodules: false
.- submodules: ${{ matrix.TESTS == 'ON' || matrix.BENCHMARKS == 'ON' }} + fetch-depth: 1 + submodules: ${{ matrix.TESTS == 'ON' || matrix.BENCHMARKS == 'ON' && 'recursive' || false }}
49-50
: 🧹 Nitpick (assertive)Optimize build performance.
Using a fixed
-j3
value for make is suboptimal. The job count should be based on available CPU cores.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/valgrind.yml (1)
49-49
: 🧹 Nitpick (assertive)Optimize build performance and memory usage.
Fixed
-j3
for make commands can lead to suboptimal performance and potential memory pressure during Valgrind tests.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k - run: make -k valgrind + run: make -j1 -k valgrind # Run serially to avoid memory pressureAlso applies to: 53-53
.github/workflows/experimental-build.yml (1)
36-42
: 🛠️ Refactor suggestionImprove Python cleanup.
Manual removal of Python 3.11 binaries is brittle. Use package management instead.
- rm '/usr/local/bin/2to3-3.11' - rm '/usr/local/bin/idle3.11' - rm '/usr/local/bin/pydoc3.11' - rm '/usr/local/bin/python3.11' - rm '/usr/local/bin/python3.11-config' + brew uninstall --ignore-dependencies [email protected] brew update brew install boost cppcheck
♻️ Duplicate comments (7)
.github/workflows/valgrind.yml (1)
36-37
: 🛠️ Refactor suggestionUse apt package instead of snap.
Installing valgrind via snap is unnecessary when it's available in apt repositories.
- # Install a newer version than the one in APT - sudo snap install --classic valgrind + sudo apt-get install -y valgrind.github/workflows/examples.yml (2)
53-53
: 🧹 Nitpick (assertive)Optimize build and test performance.
Fixed
-j3
for make commands and redundant working directory specifications.- working-directory: ${{github.workspace}}/build - run: make -j3 -k examples + run: make -j$(($(nproc) / 2)) -k examples - working-directory: ${{github.workspace}}/build - run: make -j3 -k valgrind_examples + run: make -j1 -k valgrind_examples # Run serially to avoid memory pressureAlso applies to: 57-57
37-40
: 🧹 Nitpick (assertive)Consolidate package installation.
Multiple package installation commands can be consolidated for better readability and maintenance.
- sudo apt-get install -y libboost-dev libc6-dev-i386 libc6-dbg \ - libgtest-dev libgmock-dev libbenchmark-dev - # Install a newer version than the one in APT - sudo snap install --classic valgrind + sudo apt-get install -y \ + libboost-dev \ + libc6-dev-i386 \ + libc6-dbg \ + libgtest-dev \ + libgmock-dev \ + libbenchmark-dev \ + valgrind.circleci/config.yml (2)
224-225
:⚠️ Potential issueFix CMake configuration path for macOS examples.
The CMake command uses an incorrect path to the source directory.
Apply this diff:
- cmake -S ../../examples -B build/build-examples \ + cmake -S examples -B build/build-examples \
83-112
:⚠️ Potential issueFix CMake configuration path for examples.
The CMake command uses an incorrect path to the source directory.
Apply this diff:
- cmake -S examples -B build-examples \ + cmake -S ../../examples -B build-examples \CMakeLists.txt (2)
773-775
:⚠️ Potential issueAdd dependencies to the valgrind target.
The valgrind target is created without dependencies, which could lead to missing test coverage.
Apply this diff:
-add_custom_target(valgrind) +add_custom_target(valgrind DEPENDS valgrind_tests valgrind_benchmarks)
409-410
: 🧹 Nitpick (assertive)Add a comment explaining the complex condition.
The condition for building tests and benchmarks is not immediately obvious.
Add this comment above the condition:
+# Build tests and benchmarks if: +# 1. We're in standalone mode, OR +# 2. The parent project hasn't provided GTest/Google Benchmark targets, AND +# 3. Tests or benchmarks are enabled if((STANDALONE OR NOT TARGET GTest::gtest_main OR NOT TARGET benchmark::benchmark) AND (TESTS OR BENCHMARKS))
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(7 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(7 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (60)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (Debug, OFF, ON, ON)
🔇 Additional comments (17)
.github/workflows/codeql-analysis.yml (1)
52-52
: 🧹 Nitpick (assertive)Optimize build performance.
Using a fixed
-j3
value for make is suboptimal.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
54-54
: 🧹 Nitpick (assertive)Optimize build performance.
Using a fixed
-j3
value for make is suboptimal.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -kexamples/CMakeLists.txt (2)
39-43
: Add error handling for example execution.The example targets are executed directly without checking their exit status.
Apply this diff to add error handling:
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
45-46
: Use list() for Valgrind command arguments.Define Valgrind command arguments using CMake list() for better maintainability.
Apply this diff to use list():
-set(VALGRIND_COMMAND "valgrind" "--error-exitcode=1" "--leak-check=full" - "--trace-children=yes" "-v") +list(APPEND VALGRIND_COMMAND + "valgrind" + "--error-exitcode=1" + "--leak-check=full" + "--trace-children=yes" + "-v" +)examples/CMakePresets.json (2)
23-25
: Add explicit compiler flags for clang-cl.The clang-cl configuration could benefit from explicit compiler flags.
Apply this diff to add compiler flags:
"cacheVariables": { "CMAKE_C_COMPILER": "clang-cl", - "CMAKE_CXX_COMPILER": "clang-cl" + "CMAKE_CXX_COMPILER": "clang-cl", + "CMAKE_C_FLAGS": "-m64", + "CMAKE_CXX_FLAGS": "-m64 -fno-delayed-template-parsing" },
75-92
: LGTM!The build presets are correctly linked to their corresponding configure presets.
test/CMakeLists.txt (3)
29-30
: Consider adding version check for GTest.While the namespace update is good, add a version check to ensure compatibility.
Apply this diff to add version check:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(db_test_utils PUBLIC unodb GTest::gtest_main GTest::gmock_main)
36-37
: LGTM!The library dependencies are correctly specified.
43-44
: LGTM!The target dependencies are correctly specified.
.github/workflows/msvc-build.yml (3)
17-24
: Use JSON arrays for preset lists.The multiline string format for presets is error-prone.
Apply this diff to use JSON arrays:
- EXAMPLE_PRESETS: >- - msvc-debug - msvc-release - msvc-llvm-debug - msvc-llvm-release + EXAMPLE_PRESETS: '["msvc-debug", "msvc-release", "msvc-llvm-debug", "msvc-llvm-release"]'
61-64
: Consider combining checkout steps.The workflow has two separate checkout steps that could be combined for better efficiency.
Apply this diff to combine checkout steps:
- - uses: actions/checkout@v4 - with: - submodules: false - # ... example steps ... - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset)
16-25
: Consider extracting compiler versions into variables.The configuration is well-structured, but the compiler versions are hardcoded.
Apply this diff to extract compiler versions:
env: DEFAULT_SANITIZE_ADDRESS: OFF DEFAULT_SANITIZE_THREAD: OFF DEFAULT_SANITIZE_UB: OFF + GCC_VERSION: "13" + CLANG_VERSION: "19" jobs: build: steps: - name: Configure CMake (examples) run: | if [[ $COMPILER == "gcc" ]]; then - export CC="gcc-${VERSION}" - export CXX="g++-${VERSION}" + export CC="gcc-${GCC_VERSION}" + export CXX="g++-${GCC_VERSION}" else - export CC="clang-${VERSION}" - export CXX="clang++-${VERSION}" + export CC="clang-${CLANG_VERSION}" + export CXX="clang++-${CLANG_VERSION}" fi.github/workflows/ubuntu-20.04.yml (2)
15-15
: LGTM!Empty permissions object is correctly specified.
221-225
: LGTM!The CMake configuration is correctly specified with build directory and options.
.circleci/config.yml (1)
4-10
: LGTM! Well-structured compiler version parameters.The addition of pipeline-level parameters for compiler versions improves maintainability by centralizing version configuration.
.github/workflows/build.yml (1)
19-19
: LGTM! Modern CMake configuration.The changes align with modern CMake practices:
- Empty permissions object improves security
- Using
-B build
flag is the preferred way to specify build directoryAlso applies to: 406-407
.github/workflows/old-compilers.yml (1)
17-17
: LGTM! Consistent workflow configuration.The changes maintain consistency with the main workflow configuration.
Also applies to: 513-513
cec73b0
to
992d268
Compare
There was a problem hiding this 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 (6)
.github/workflows/feature-matrix-build.yml (2)
49-50
: 🧹 Nitpick (assertive)Remove redundant working directory specification.
Since you're using
cmake -B build
, the working directory in the build step is unnecessary.- working-directory: ${{github.workspace}}/build run: make -j3 -k
50-50
: 🧹 Nitpick (assertive)Optimize build parallelism.
Using a fixed
-j3
value might not be optimal. Consider using a dynamic value based on available CPU cores.- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/valgrind.yml (1)
48-49
: 🧹 Nitpick (assertive)Optimize resource usage in build steps.
Remove redundant working directory and optimize job count.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k - working-directory: ${{github.workspace}}/build - run: make -k valgrind + run: make -j$(($(nproc) / 2)) -k valgrindAlso applies to: 52-53
.github/workflows/codeql-analysis.yml (1)
51-52
: 🧹 Nitpick (assertive)Optimize build configuration.
Remove redundant working directory and optimize job count.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (2)
36-40
: 🧹 Nitpick (assertive)Simplify Python cleanup.
Use a single command to remove multiple Python files.
- rm '/usr/local/bin/2to3-3.11' - rm '/usr/local/bin/idle3.11' - rm '/usr/local/bin/pydoc3.11' - rm '/usr/local/bin/python3.11' - rm '/usr/local/bin/python3.11-config' + rm -f /usr/local/bin/{2to3-3.11,idle3.11,pydoc3.11,python3.11,python3.11-config}
53-54
: 🧹 Nitpick (assertive)Optimize build configuration.
Remove redundant working directory and optimize job count.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$((sysctl -n hw.ncpu) / 2)) -kNote: Using
sysctl
instead ofnproc
for macOS.
♻️ Duplicate comments (5)
.github/workflows/valgrind.yml (1)
36-37
: 🧹 Nitpick (assertive)Use apt instead of snap for valgrind.
Installing valgrind via snap is unnecessary when it's available in apt repositories.
- # Install a newer version than the one in APT - sudo snap install --classic valgrind + sudo apt-get install -y valgrind.github/workflows/examples.yml (2)
52-57
: 🧹 Nitpick (assertive)Optimize build configuration.
Remove redundant working directory specifications and optimize job count.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k examples + run: make -j$(($(nproc) / 2)) -k examples - working-directory: ${{github.workspace}}/build - run: make -j3 -k valgrind_examples + run: make -j$(($(nproc) / 2)) -k valgrind_examples
37-40
: 🧹 Nitpick (assertive)Consolidate package installation.
Use a single apt-get command for all dependencies and avoid snap.
- sudo apt-get install -y libboost-dev libc6-dev-i386 libc6-dbg \ - libgtest-dev libgmock-dev libbenchmark-dev - # Install a newer version than the one in APT - sudo snap install --classic valgrind + sudo apt-get install -y \ + libboost-dev \ + libc6-dev-i386 \ + libc6-dbg \ + libgtest-dev \ + libgmock-dev \ + libbenchmark-dev \ + valgrind.circleci/config.yml (1)
96-102
: 🧹 Nitpick (assertive)Consider using more descriptive variable names.
The compiler setup is correct, but consider using more descriptive variable names for better maintainability:
- if [[ $COMPILER == "gcc" ]]; then - export CC=gcc-$GCC_VERSION - export CXX=g++-$GCC_VERSION - elif [[ $COMPILER == "clang" ]]; then - export CC=clang-$CLANG_VERSION - export CXX=clang++-$CLANG_VERSION - fi + if [[ $COMPILER == "gcc" ]]; then + gcc_compiler_version="$GCC_VERSION" + export CC="gcc-${gcc_compiler_version}" + export CXX="g++-${gcc_compiler_version}" + elif [[ $COMPILER == "clang" ]]; then + clang_compiler_version="$CLANG_VERSION" + export CC="clang-${clang_compiler_version}" + export CXX="clang++-${clang_compiler_version}" + fiCMakeLists.txt (1)
308-319
: 🧹 Nitpick (assertive)Add a comment explaining the IPO/LTO conditions.
The conditions for enabling IPO/LTO are complex and would benefit from a comment explaining the rationale.
+# IPO/LTO is enabled only when: +# 1. Not using MSVC LLVM (which doesn't support it) +# 2. Not using clang ≥17 with ASan (due to ThinLTO module bug) +# 3. IPO is supported by the compiler if(STANDALONE) if(MSVC AND is_clang) message(STATUS "Not enabling IPO/LTO due to MSVC LLVM not supporting it")
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(7 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(7 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (48)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with TSan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Apple Silicon), macos-14, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with ASan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with cppcheck (Intel), macos-latest, Debug, macos-clang, ON, OFF)
🔇 Additional comments (19)
examples/CMakeLists.txt (2)
39-43
: Add error handling for example execution.The example targets are executed directly without checking their exit status.
Apply this diff to add error handling:
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
45-46
: Use list() for Valgrind command arguments.Define Valgrind command arguments using CMake list() for better maintainability.
Apply this diff to use list():
-set(VALGRIND_COMMAND "valgrind" "--error-exitcode=1" "--leak-check=full" - "--trace-children=yes" "-v") +list(APPEND VALGRIND_COMMAND + "valgrind" + "--error-exitcode=1" + "--leak-check=full" + "--trace-children=yes" + "-v" +)examples/CMakePresets.json (2)
22-25
: Add explicit compiler flags for clang-cl.The clang-cl configuration could benefit from explicit compiler flags.
Apply this diff to add explicit flags:
"cacheVariables": { "CMAKE_C_COMPILER": "clang-cl", - "CMAKE_CXX_COMPILER": "clang-cl" + "CMAKE_CXX_COMPILER": "clang-cl", + "CMAKE_C_FLAGS": "-m64", + "CMAKE_CXX_FLAGS": "-m64 -fno-delayed-template-parsing" },
75-92
: LGTM!The build presets are correctly configured and properly linked to their corresponding configure presets.
test/CMakeLists.txt (3)
29-30
: Add version check for GTest.While the namespace update is good, add a version check to ensure compatibility.
Apply this diff to add version check:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(db_test_utils PUBLIC unodb GTest::gtest_main GTest::gmock_main)
36-36
: LGTM!The library linkage is correct and uses the proper GTest namespace.
43-44
: LGTM!The target linkage is correct and uses the proper GTest namespace.
.github/workflows/msvc-build.yml (4)
17-24
: Use JSON arrays for preset lists.The multiline string format for presets is error-prone.
Apply this diff to use JSON arrays:
- EXAMPLE_PRESETS: >- - msvc-debug - msvc-release - msvc-llvm-debug - msvc-llvm-release + EXAMPLE_PRESETS: '["msvc-debug", "msvc-release", "msvc-llvm-debug", "msvc-llvm-release"]'
61-64
: Consider combining checkout steps.The workflow has two separate checkout steps that could be combined for better efficiency.
Apply this diff to combine steps:
- - uses: actions/checkout@v4 - with: - submodules: false - # ... example steps ... - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset)
79-82
: LGTM!The dependencies installation step is correctly configured.
83-90
: LGTM!The CMake configuration for examples is correctly set up.
.github/workflows/ubuntu-20.04.yml (2)
15-15
: LGTM!The permissions are correctly set to an empty object.
221-225
: LGTM!The CMake configuration is correctly set up with the build directory specified using the
-B
option..circleci/config.yml (3)
4-10
: LGTM! Well-structured pipeline parameters.The parameters for GCC and Clang versions are properly defined with sensible defaults.
270-344
: LGTM! Consistent job naming convention.The job names properly use the pipeline parameters for compiler versions, maintaining consistency throughout the configuration.
83-112
:✅ Verification successful
Verify the CMake configuration path for examples.
The CMake command uses a path that might be incorrect. Run this script to verify the path:
🏁 Script executed:
#!/bin/bash # Description: Verify the examples directory location echo "=== Checking examples directory location ===" fd -t d "examples$" echo -e "\n=== Checking CMakeLists.txt in examples ===" fd -t f "CMakeLists.txt" -p "examples/"Length of output: 295
CMake configuration path verified.
The
fd
script confirmed that theexamples/
directory exists and contains aCMakeLists.txt
. The CMake command using-S examples
is correct as-is, so no changes are needed..github/workflows/build.yml (1)
19-19
: LGTM! Following security best practices.The empty permissions object follows the principle of least privilege, ensuring the workflow only has necessary permissions.
.github/workflows/old-compilers.yml (1)
17-17
: LGTM! Following security best practices.The empty permissions object follows the principle of least privilege, ensuring the workflow only has necessary permissions.
CMakeLists.txt (1)
45-47
: LGTM! Clear STANDALONE option documentation.The STANDALONE option is well-documented with a clear description of its purpose and effects.
992d268
to
57725a2
Compare
@coderabbitai review |
✅ Actions performedReview triggered.
|
- No longer configure LTO when building as an included project, leaving it for the parent project to configure. - Update UnoDB CMakeLists.txt to use Google Test & Google Benchmark CMake targets if they are already set up by parent CMake in a non-standalone build. - Convert examples/CMakeLists.txt to be a top-level CMake script, showing an example of using UnoDB as a dependency. - Update CI to build examples from the top-level script.
57725a2
to
5273721
Compare
|
@coderabbitai fullreview |
@laurynas-biveinis I'll perform a full review of the PR. ✅ Actions performedFull review triggered. |
@coderabbitai fullreview |
@laurynas-biveinis I'll perform a full review of the PR. ✅ Actions performedFull review triggered. |
There was a problem hiding this 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 (5)
.github/workflows/feature-matrix-build.yml (2)
49-50
: 🧹 Nitpick (assertive)Optimize build performance.
Replace fixed job count with dynamic CPU core calculation.
- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k
48-50
: 🧹 Nitpick (assertive)Remove redundant working directory.
The working directory is unnecessary since CMake's
-B
option already specifies the build directory.- working-directory: ${{github.workspace}}/build run: make -j3 -k
.github/workflows/valgrind.yml (1)
49-53
: 🧹 Nitpick (assertive)Optimize build and test performance.
Use dynamic CPU core calculation for both build and valgrind steps.
- run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k - name: Valgrind test working-directory: ${{github.workspace}}/build - run: make -k valgrind + run: make -j$(($(nproc) / 2)) -k valgrind.github/workflows/codeql-analysis.yml (1)
51-52
: 🧹 Nitpick (assertive)Optimize build performance and remove redundancy.
The working directory is redundant and the job count should be dynamic.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$(($(nproc) / 2)) -k.github/workflows/experimental-build.yml (1)
53-55
: 🧹 Nitpick (assertive)Optimize build performance for macOS.
Use dynamic CPU core calculation and remove redundant working directory.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k + run: make -j$((sysctl -n hw.ncpu / 2)) -k
♻️ Duplicate comments (5)
.github/workflows/valgrind.yml (1)
36-37
: 🧹 Nitpick (assertive)Use apt package manager for valgrind.
The comment suggests using snap for a newer version, but the apt version is sufficient for CI purposes.
- # Install a newer version than the one in APT - sudo snap install --classic valgrind + sudo apt-get install -y valgrind.github/workflows/examples.yml (2)
36-40
: 🧹 Nitpick (assertive)Consolidate package installations and use apt for valgrind.
Combine all package installations into a single apt-get command.
sudo apt-get update - sudo apt-get install -y libboost-dev libc6-dev-i386 libc6-dbg \ - libgtest-dev libgmock-dev libbenchmark-dev - # Install a newer version than the one in APT - sudo snap install --classic valgrind + sudo apt-get install -y \ + libboost-dev \ + libc6-dev-i386 \ + libc6-dbg \ + libgtest-dev \ + libgmock-dev \ + libbenchmark-dev \ + valgrind
52-57
: 🧹 Nitpick (assertive)Optimize build performance and remove redundancy.
Use dynamic CPU core calculation and remove redundant working directories.
- working-directory: ${{github.workspace}}/build - run: make -j3 -k examples + run: make -j$(($(nproc) / 2)) -k examples - working-directory: ${{github.workspace}}/build - run: make -j3 -k valgrind_examples + run: make -j$(($(nproc) / 2)) -k valgrind_examplesCMakeLists.txt (2)
409-410
: 🧹 Nitpick (assertive)Add a comment explaining the complex condition.
The condition for building tests and benchmarks is not immediately obvious. Add this comment:
+# Build tests and benchmarks if: +# 1. We're in standalone mode, OR +# 2. The parent project hasn't provided GTest/Google Benchmark targets, AND +# 3. Tests or benchmarks are enabled if((STANDALONE OR NOT TARGET GTest::gtest_main OR NOT TARGET benchmark::benchmark) AND (TESTS OR BENCHMARKS))
773-775
: 🧹 Nitpick (assertive)Add a comment explaining the valgrind target dependencies.
Add this comment to clarify the dependency structure:
+# The valgrind target starts with no dependencies. +# Dependencies are added later when: +# 1. Tests are enabled (valgrind_tests) +# 2. Benchmarks are enabled (valgrind_benchmarks) +# 3. DeepState is available (valgrind_deepstate) add_custom_target(valgrind)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (14)
.circleci/config.yml
(7 hunks).github/workflows/build.yml
(2 hunks).github/workflows/codeql-analysis.yml
(1 hunks).github/workflows/examples.yml
(1 hunks).github/workflows/experimental-build.yml
(2 hunks).github/workflows/feature-matrix-build.yml
(1 hunks).github/workflows/msvc-build.yml
(4 hunks).github/workflows/old-compilers.yml
(2 hunks).github/workflows/ubuntu-20.04.yml
(2 hunks).github/workflows/valgrind.yml
(1 hunks)CMakeLists.txt
(7 hunks)examples/CMakeLists.txt
(1 hunks)examples/CMakePresets.json
(1 hunks)test/CMakeLists.txt
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (80)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
- GitHub Check: build (XCode Release with ASan (Apple Silicon), macos-14, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Debug with UBSan (Intel), macos-latest, Debug, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release with ASan (Intel), macos-latest, Release, macos-clang, ON, OFF)
- GitHub Check: build (XCode Release (Intel), macos-latest, Release, macos-clang, OFF)
- GitHub Check: build (clang 12 Debug with UBSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with TSan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug with ASan, Debug, ON, clang, 12)
- GitHub Check: build (clang 12 Debug, Debug, clang, 12)
🔇 Additional comments (15)
examples/CMakeLists.txt (3)
12-14
: Default values for TESTS and BENCHMARKS options need to be OFF.These options defaulting to ON will cause build failures if GTest and benchmark packages aren't available in the parent project.
Apply this diff:
-option(TESTS "Find Google Test in the parent project for UnoDB to use" ON) -option(BENCHMARKS "Find Google Benchmark in the parent project for UnoDB to use" - ON) +option(TESTS "Find Google Test in the parent project for UnoDB to use" OFF) +option(BENCHMARKS "Find Google Benchmark in the parent project for UnoDB to use" + OFF)
40-42
: Add error handling for example execution.Examples are executed without checking their exit status.
Apply this diff:
- env ./example_art - COMMAND env ./example_art_stats - COMMAND env ./example_olc_art + env bash -c './example_art || exit 1' + COMMAND env bash -c './example_art_stats || exit 1' + COMMAND env bash -c './example_olc_art || exit 1'
45-46
: Use list() for Valgrind command arguments.Current string format is error-prone and hard to maintain.
Apply this diff:
-set(VALGRIND_COMMAND "valgrind" "--error-exitcode=1" "--leak-check=full" - "--trace-children=yes" "-v") +list(APPEND VALGRIND_COMMAND + "valgrind" + "--error-exitcode=1" + "--leak-check=full" + "--trace-children=yes" + "-v" +)examples/CMakePresets.json (1)
23-25
: Add explicit compiler flags for clang-cl.The clang-cl configuration needs explicit flags for better control.
Apply this diff:
"cacheVariables": { "CMAKE_C_COMPILER": "clang-cl", - "CMAKE_CXX_COMPILER": "clang-cl" + "CMAKE_CXX_COMPILER": "clang-cl", + "CMAKE_C_FLAGS": "-m64", + "CMAKE_CXX_FLAGS": "-m64 -fno-delayed-template-parsing" },test/CMakeLists.txt (1)
29-30
: Add version check for GTest.Ensure compatibility by checking GTest version.
Apply this diff:
+if(NOT TARGET GTest::gtest_main) + message(FATAL_ERROR "GTest version 1.14 or higher is required") +endif() target_link_libraries(db_test_utils PUBLIC unodb GTest::gtest_main GTest::gmock_main).github/workflows/msvc-build.yml (2)
61-64
: Combine checkout steps for better efficiency.Multiple checkout steps are unnecessary.
Apply this diff:
- - uses: actions/checkout@v4 - with: - submodules: false - # ... example steps ... - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + - name: Update submodules + run: git submodule update --init + if: contains(env.EXAMPLE_PRESETS, matrix.preset)
17-24
: Use JSON arrays for preset lists.Multiline string format is error-prone.
Apply this diff:
- EXAMPLE_PRESETS: >- - msvc-debug - msvc-release - msvc-llvm-debug - msvc-llvm-release + EXAMPLE_PRESETS: '["msvc-debug", "msvc-release", "msvc-llvm-debug", "msvc-llvm-release"]'.github/workflows/ubuntu-20.04.yml (1)
10-14
: Extract compiler versions into variables.Hardcoded compiler versions make maintenance difficult.
Apply this diff:
env: DEFAULT_SANITIZE_ADDRESS: OFF DEFAULT_SANITIZE_THREAD: OFF DEFAULT_SANITIZE_UB: OFF + GCC_VERSION: "13" + CLANG_VERSION: "19".circleci/config.yml (4)
4-10
: LGTM! Well-structured compiler version parameters.The parameters provide flexibility for compiler version selection with sensible defaults.
266-266
: LGTM! Consistent use of compiler version parameters in job names.The job names are properly parameterized using the pipeline-level compiler version parameters.
Also applies to: 270-270, 275-275, 280-280, 285-285, 289-289, 294-294, 299-299, 304-304, 308-308, 313-313, 318-318, 323-323, 334-334, 339-339
83-112
:✅ Verification successful
Verify the CMake configuration path for examples.
The CMake command uses a relative path to the source directory. Ensure that
examples
is the correct path relative to the repository root.Run this script to verify the path:
🏁 Script executed:
#!/bin/bash # Description: Verify the examples directory exists at the expected path fd -t d "^examples$"Length of output: 32
CMake Configuration Path Verified
The script confirmed that the
examples
directory exists at the expected path. The relative path used in the CMake command is correct.
204-226
:✅ Verification successful
Verify the CMake configuration path for macOS examples.
The CMake command uses a relative path to the source directory. Ensure that
examples
is the correct path relative to the repository root.Run this script to verify the path:
🏁 Script executed:
#!/bin/bash # Description: Verify the examples directory exists at the expected path fd -t d "^examples$"Length of output: 32
Verified: The CMake configuration uses the correct relative path.
- The
fd
command confirmed that theexamples
directory exists at the repository root.- No issues found with the provided CMake command in configuring macOS examples.
.github/workflows/build.yml (1)
19-19
: LGTM! Secure permissions configuration.The empty permissions object follows the principle of least privilege, improving security.
.github/workflows/old-compilers.yml (1)
17-17
: LGTM! Secure permissions configuration.The empty permissions object follows the principle of least privilege, improving security.
CMakeLists.txt (1)
308-329
: LGTM! Well-structured IPO/LTO configuration.The configuration properly handles:
- MSVC LLVM incompatibility
- clang ≥17 with ASan ThinLTO module bug
- Conditional IPO support check
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #633 +/- ##
==========================================
- Coverage 98.35% 98.24% -0.12%
==========================================
Files 33 33
Lines 7043 7052 +9
==========================================
+ Hits 6927 6928 +1
- Misses 116 124 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@thompsonbry , @monejava , changes in this area:
One last thing remaining is the INSTALL target. This one can wait until the ART work stabilizes, because it's not clear yet how much of the library will be header-only and compiled. |
targets if they are already set up by parent CMake.
example of using UnoDB as a dependency.
Summary by CodeRabbit
Chores
New Features
Refactor