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

fix: Supports coexistence of multiple protobuf versions #388

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

lqxhub
Copy link
Collaborator

@lqxhub lqxhub commented Jul 27, 2024

修复protobuf多本版共存导致的链接错误

之前,如果本地安装了protobuf,然后编译pikiwidb,在链接时,会使用系统的protobuf, 导致链接出错,现在支持如果本地已经安装了protobuf,在编译和链接时,不使用系统的,防止链接出错

leveldb会自动搜索当前系统中是否存在 snappy , 如果存在就会自动加入, 并且不可关闭这个选项, 现在对 leveldb 加入了 snappy支持, 使用项目中的 snappy

Summary by CodeRabbit

  • 新特性

    • 新增了库路径配置,优化了构建过程中库的查找。
    • 更新了Protobuf库的引用方式,提升了库链接的简洁性与准确性。
  • 修复问题

    • 改进了CMake配置,确保Protobuf相关路径的正确性。

Copy link

coderabbitai bot commented Jul 27, 2024

Walkthrough

这次更新主要针对 cmake/braft.cmakecmake/brpc.cmake 文件,新增了对 Protobuf 库的引用方式,并引入了库路径的设置。通过这些修改,构建配置得到了改善,能够更有效地找到所需的库和头文件,从而提升了编译过程的可靠性。

Changes

文件 变更摘要
cmake/braft.cmake 新增 -DCMAKE_LIBRARY_PATH=${LIB_INSTALL_PREFIX} 并将 -DPROTOBUF_LIBRARIES=${PROTOBUF_LIBRARY} 更新为 -DPROTOBUF_LIBRARY=${PROTOBUF_LIBRARY}
cmake/brpc.cmake 新增对 CMAKE_LIBRARY_PATHProtobuf_LIBRARIESProtobuf_INCLUDE_DIR 的定义,更新库和包含目录的路径引用,确保编译时找到正确的库和头文件。

Poem

在月下轻跳跃,
新库路径我欢笑。
Protobuf更简洁,
编译无忧乐逍遥。
呜呜声中春常在,
兔兔欢呼到天高。 🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Jul 27, 2024
@lqxhub lqxhub requested a review from panlei-coder July 27, 2024 15:20
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2848690 and 5980328.

Files selected for processing (2)
  • cmake/braft.cmake (2 hunks)
  • cmake/brpc.cmake (2 hunks)
Additional comments not posted (5)
cmake/braft.cmake (2)

29-29: 添加库路径配置

新增的 -DCMAKE_LIBRARY_PATH=${LIB_INSTALL_PREFIX} 参数确保构建系统在安装阶段能够找到必要的库。


42-42: 修正Protobuf库引用

将参数 -DPROTOBUF_LIBRARIES=${PROTOBUF_LIBRARY} 修改为 -DPROTOBUF_LIBRARY=${PROTOBUF_LIBRARY},简化或修正了库链接的变量命名。

cmake/brpc.cmake (3)

27-27: 添加库路径配置

新增的 -DCMAKE_LIBRARY_PATH=${LIB_INSTALL_PREFIX} 参数确保构建系统在安装阶段能够找到必要的库。


38-38: 修正Protobuf库引用

将参数 -DPROTOBUF_LIBRARIES=${PROTOBUF_LIBRARY} 修改为 -DProtobuf_LIBRARIES=${PROTOBUF_LIBRARY},简化或修正了库链接的变量命名。


40-40: 修正Protobuf包含目录引用

将参数 -DPROTOBUF_INCLUDE_DIRS=${PROTOBUF_INCLUDE_DIR} 修改为 -DProtobuf_INCLUDE_DIR=${PROTOBUF_INCLUDE_DIR},简化或修正了包含目录的变量命名。

@AlexStocks AlexStocks merged commit 5c5b95f into OpenAtomFoundation:unstable Jul 28, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️ Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants