Skip to content
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

chore: allow build without Boost Stacktrace #466

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

tapiab
Copy link
Contributor

@tapiab tapiab commented Nov 28, 2024

This MR allows building OSTk Core without Boost Stacktrace (use basic Stacktrace instead) due to some target incompatibility with it.

Summary by CodeRabbit

  • New Features
    • Introduced options for building with Boost Stacktrace and Boost Static libraries.
  • Improvements
    • Enhanced flexibility in module path management and Boost dependency configuration.
    • Updated directory structure for configuration files to improve organization.
  • Bug Fixes
    • Removed restrictions on default paths in the SGP4 library search, allowing broader library detection.

@tapiab tapiab self-assigned this Nov 28, 2024
Copy link
Contributor

coderabbitai bot commented Nov 28, 2024

Walkthrough

The changes in this pull request primarily involve modifications to the CMakeLists.txt file and the FindSGP4.cmake script. Two new configuration options for building with Boost libraries have been introduced, enhancing user flexibility. The handling of module paths has been improved, and the logic for setting Boost dependencies has been made conditional based on user-selected options. Additionally, the directory structure for configuration files has been updated for better organization. The FindSGP4.cmake script has been adjusted to allow broader search paths for the SGP4 library.

Changes

File Change Summary
CMakeLists.txt - Added options: BUILD_WITH_BOOST_STACKTRACE and BUILD_WITH_BOOST_STATIC (default ON)
- Changed CMAKE_MODULE_PATH from SET to LIST APPEND
- Modified Boost_USE_STATIC_LIBS to depend on BUILD_WITH_BOOST_STATIC
- Updated paths for configuration files to tools/cmake
- Changed installation paths to include a new subdirectory structure under INSTALL_LIB
tools/cmake/FindSGP4.cmake - Removed NO_DEFAULT_PATH from FIND_PATH and FIND_LIBRARY, allowing broader search paths

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CMake
    participant Boost
    participant SGP4

    User->>CMake: Configure project
    CMake->>Boost: Check BUILD_WITH_BOOST_STACKTRACE
    CMake->>Boost: Check BUILD_WITH_BOOST_STATIC
    CMake->>CMake: Set Boost_USE_STATIC_LIBS based on options
    CMake->>CMake: Update CMAKE_MODULE_PATH
    CMake->>CMake: Configure files in tools/cmake
    CMake->>SGP4: Find SGP4 library
    SGP4-->>CMake: Return SGP4_LIBRARIES and SGP4_INCLUDE_DIRS
    CMake->>User: Build project
Loading

🐰 "In the land of code, where options bloom,
Boost and SGP4 find their room.
With paths that twist and turns that bend,
Our build's a joy, on that we depend!
So hop along, let's set the pace,
For every change, a better place!" 🐇

Warning

Rate limit exceeded

@tapiab has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between bd596ec and 65fbad7.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.12%. Comparing base (bd596ec) to head (65fbad7).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #466   +/-   ##
=======================================
  Coverage   91.12%   91.12%           
=======================================
  Files          85       85           
  Lines        8639     8639           
=======================================
  Hits         7872     7872           
  Misses        767      767           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tapiab tapiab marked this pull request as ready for review November 28, 2024 13:43
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
CMakeLists.txt (1)

28-29: LGTM! Consider adding option documentation.

The new build options are well-named and align with CMake conventions. Their default values maintain backward compatibility.

Consider adding comments to document these options:

+# Enable/disable building with Boost Stacktrace (uses basic stacktrace implementation when disabled)
 OPTION (BUILD_WITH_BOOST_STACKTRACE "Build with Boost Stacktrace instead of stacktrace basic" ON)
+# Enable/disable building with Boost static libraries
 OPTION (BUILD_WITH_BOOST_STATIC "Build with Boost Static lib" ON)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bd596ec and 65fbad7.

📒 Files selected for processing (2)
  • CMakeLists.txt (6 hunks)
  • tools/cmake/FindSGP4.cmake (1 hunks)
🔇 Additional comments (5)
tools/cmake/FindSGP4.cmake (1)

10-10: LGTM! Verify system paths don't cause conflicts.

Allowing search in system paths increases flexibility. However, ensure this doesn't lead to version conflicts if SGP4 is installed in multiple locations.

✅ Verification successful

Since we're in a sandbox environment without access to system paths, let's verify if there are any other SGP4-related files in the repository that might indicate potential conflicts:


Let's check how SGP4 is being used in the CMakeLists.txt to understand the dependency management better:


Removing NO_DEFAULT_PATH is safe in this context

The removal of NO_DEFAULT_PATH from FindSGP4.cmake is safe because:

  • The project uses SGP4 as a required dependency with proper variable checks
  • The CMake configuration properly validates the found SGP4 through SGP4_FOUND
  • The include and library directories are explicitly set using the variables from the find module
  • The project maintains a consistent linking strategy for both static and shared libraries
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for multiple SGP4 installations that could cause conflicts

# Search for SGP4.h in common system paths
echo "Checking for SGP4.h installations:"
fd SGP4.h /usr/include /usr/local/include

# Search for SGP4 libraries
echo -e "\nChecking for SGP4 library installations:"
fd "libsgp4" /usr/lib /usr/local/lib

Length of output: 421


Script:

#!/bin/bash
# Check for any SGP4-related files in the repository
echo "SGP4-related files:"
fd -t f SGP4

# Check for any SGP4-related CMake files
echo -e "\nSGP4-related CMake files:"
fd -e cmake SGP4

# Check if SGP4 is mentioned in any CMake cache or configuration files
echo -e "\nSGP4 mentions in CMake files:"
rg -l "SGP4" -g "*.cmake" -g "CMakeLists.txt"

Length of output: 659


Script:

#!/bin/bash
# Check how SGP4 is configured and used in CMakeLists.txt
echo "SGP4 configuration in CMakeLists.txt:"
rg -A 5 -B 5 "SGP4" CMakeLists.txt

# Check if there are any version requirements or specific configurations
echo -e "\nSGP4 find_package configurations:"
rg "find_package.*SGP4" CMakeLists.txt

# Check for any SGP4 related variables
echo -e "\nSGP4 related variables:"
rg "SGP4_" CMakeLists.txt

Length of output: 2534

CMakeLists.txt (4)

39-39: LGTM! Good improvement to module path handling.

Using LIST(APPEND) instead of SET is a better practice as it preserves any existing module paths that might have been set by parent projects or user configurations.


243-247: LGTM! Clean conditional Boost static library configuration.

The conditional setting of Boost_USE_STATIC_LIBS based on the new option is well implemented.


629-639: LGTM! Good improvement to CMake config installation paths.

Moving CMake config files to a cmake subdirectory follows modern CMake conventions and improves the organization of installed files.


644-644: LGTM! Consistent path update for uninstall target.

The uninstall target configuration file path has been updated consistently with other changes.

tools/cmake/FindSGP4.cmake Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
@vishwa2710 vishwa2710 merged commit 298e57e into main Dec 2, 2024
15 checks passed
@vishwa2710 vishwa2710 deleted the users/tapiab/build-without-boost-stacktrace branch December 2, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants