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

feat:Supports compilation on FreeBSD14 #2711

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

lqxhub
Copy link
Collaborator

@lqxhub lqxhub commented Jun 7, 2024

pika can now be compiled on FreeBSD14

Summary by CodeRabbit

  • New Features

    • Added support for FreeBSD across various modules.
  • Bug Fixes

    • Ensured compatibility with FreeBSD by including necessary headers and adjusting conditional compilation directives.
  • Refactor

    • Updated build configuration to include FreeBSD-specific flags and definitions.
    • Modified conditional logic to support FreeBSD alongside macOS.

@github-actions github-actions bot added the ✏️ Feature New feature or request label Jun 7, 2024
Copy link

coderabbitai bot commented Jun 7, 2024

Walkthrough

The changes introduce support for FreeBSD in the project's build and source files. This includes updating CMake configuration files, adding conditional compilation directives, and including necessary headers specific to FreeBSD. These updates ensure that the project can be compiled and run on FreeBSD systems without issues.

Changes

File Change Summary
CMakeLists.txt Added support for FreeBSD by including specific flags and definitions.
include/pika_server.h Added conditional compilation for FreeBSD to include necessary headers.
src/net/CMakeLists.txt Modified conditional logic to exclude certain files for FreeBSD.
src/net/src/net_interfaces.cc Included additional headers and adjusted conditional compilation for FreeBSD.
src/pika_monotonic_time.cc Added implementation for getMonotonicUs() for FreeBSD.
src/pika_rsync_service.cc Added include directive for <sys/wait.h> specific to FreeBSD.
src/pstd/src/rsync.cc Added conditional inclusion of headers for FreeBSD-specific functionality.
src/storage/src/coding.h Introduced macro definition STORAGE_PLATFORM_IS_LITTLE_ENDIAN for FreeBSD.

Possibly related issues

  • pika build fail on FreeBSD #2703: The changes in this PR address the build failure on FreeBSD by adding the necessary headers and conditional compilation directives.

Poem

In the land where FreeBSD roams,
Code now builds, no more groans.
Headers set, flags in place,
Compilation runs apace.
A rabbit’s joy, a coder’s cheer,
Pika builds without a fear.
🎉🐇✨


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 Configration File (.coderabbit.yaml)

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

Documentation and Community

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 38eb16d and 2c15e8b.

Files selected for processing (8)
  • CMakeLists.txt (2 hunks)
  • include/pika_server.h (1 hunks)
  • src/net/CMakeLists.txt (1 hunks)
  • src/net/src/net_interfaces.cc (2 hunks)
  • src/pika_monotonic_time.cc (2 hunks)
  • src/pika_rsync_service.cc (1 hunks)
  • src/pstd/src/rsync.cc (1 hunks)
  • src/storage/src/coding.h (1 hunks)
Files not reviewed due to errors (1)
  • src/net/CMakeLists.txt (no review received)
Files skipped from review due to trivial changes (3)
  • include/pika_server.h
  • src/pika_rsync_service.cc
  • src/pstd/src/rsync.cc
Additional comments not posted (5)
src/pika_monotonic_time.cc (1)

20-29: The FreeBSD-specific implementation of getMonotonicUs() using clock_gettime is correctly implemented and aligns with the PR's objectives to support FreeBSD.

src/storage/src/coding.h (1)

16-18: The addition of the STORAGE_PLATFORM_IS_LITTLE_ENDIAN macro for FreeBSD using _BYTE_ORDER and _LITTLE_ENDIAN is correctly implemented and necessary for endian-specific operations on FreeBSD.

src/net/src/net_interfaces.cc (1)

15-22: The update to include additional headers and expand the conditional compilation to include FreeBSD ensures proper functionality on FreeBSD systems. This aligns with the PR's objectives to support FreeBSD.

CMakeLists.txt (2)

59-61: Ensure proper thread support for FreeBSD.

The addition of -pthread and the definition -DOS_FREEBSD are standard practices for enabling multithreading support on FreeBSD, aligning with the configurations for other operating systems like Linux and Darwin.


72-72: Validate system support error handling.

This error message ensures that the build process halts with a clear notification when an unsupported system is detected. It's crucial to verify that this message is correctly implemented and appears only when necessary.

Verification successful

The error message "only support linux or macOs or FreeBSD" is correctly implemented in the CMakeLists.txt file. It is triggered when the system name does not match "Darwin" (macOS), "FreeBSD", or "Linux". This ensures that the build process halts with a clear notification when an unsupported system is detected.

  • The error message is located within an else() block that follows checks for "Darwin", "FreeBSD", and "Linux" system names.

This implementation appears to be correct and appropriate for handling unsupported systems.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Ensure the error message is appropriate for unsupported systems.

# Test: Search for the error message in the CMakeLists.txt. Expect: Correct error message for unsupported systems.
rg --type cmake 'only support linux or macOs or FreeBSD' CMakeLists.txt

Length of output: 138



Script:

#!/bin/bash
# Description: Verify the conditions under which the error message is triggered in the CMakeLists.txt file.

# Search for the conditional statements that lead to the error message.
rg --type cmake 'if\(' CMakeLists.txt -A 5

Length of output: 7486

@AlexStocks AlexStocks merged commit 84cdb18 into OpenAtomFoundation:unstable Jun 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0.0 ✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants