Skip to content

Einstein: port to FreeBSD#208

Open
LaurentChardon wants to merge 1 commit intopguyot:masterfrom
LaurentChardon:master
Open

Einstein: port to FreeBSD#208
LaurentChardon wants to merge 1 commit intopguyot:masterfrom
LaurentChardon:master

Conversation

@LaurentChardon
Copy link

@LaurentChardon LaurentChardon commented Feb 28, 2026

Port Einstein to FreeBSD
While there, handle NetBSD
Don't break existing Linux and OpenBSD

Summary by CodeRabbit

  • Chores
    • Enhanced cross-platform build configuration support for BSD-based operating systems, including improved system detection and compiler flag handling.
    • Expanded build tooling discovery to support additional versions of code formatting tools.
    • Refined library and source file compilation logic to consistently apply BSD-specific handling across all supported BSD variants.

Port Einstein to FreeBSD
While there, handle NetBSD
Don't break existing Linux and OpenBSD
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

The PR broadens BSD platform detection in CMake build files from OpenBSD-specific to a generic ".*BSD$" pattern, affecting library discovery, include paths, and linking across multiple targets. Additionally, compiler warning options are adjusted for GNU compilers on BSD/Linux builds, and clang-format discovery is expanded to include clang-format19.

Changes

Cohort / File(s) Summary
BSD Detection Broadening
Emulator/NativeCalls/CMakeLists.txt, Emulator/Serial/CMakeLists.txt, Emulator/Sound/CMakeLists.txt
Replaced OpenBSD-specific checks with generic ".*BSD$" regex pattern to apply BSD-specific logic uniformly across FreeBSD, NetBSD, and other BSD variants.
Root CMake Configuration
CMakeLists.txt
Introduced dedicated FreeBSD/NetBSD no-op branch, broadened BSD detection across multiple code paths, adjusted compiler warning options for GNU compilers (removed -Wstringop-truncation on BSD/Linux), and expanded clang-format discovery to include clang-format19.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hops through the BSDs with glee,
From FreeBSD to NetBSD spree!
No longer just OpenBSD's friend,
All BSD variants now blend,
Build systems broader, warnings tame,
A rabbit's joy, the build's new game! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Einstein: port to FreeBSD' accurately reflects the main objective of the changeset, which adds FreeBSD support and BSD-wide compatibility improvements across multiple CMakeLists.txt files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

🧹 Nitpick comments (1)
CMakeLists.txt (1)

693-693: Consider adding a broader clang-format search.

Adding clang-format19 is good, but the naming convention varies across systems. FreeBSD ports typically install as clang-format<version> without a hyphen (e.g., clang-format19), while some systems use clang-format-19.

Optional: Expand search names for broader compatibility
 find_program(CLANG_FORMAT_EXECUTABLE
-    NAMES clang-format-14 clang-format-mp-14 clang-format19 clang-format
+    NAMES clang-format-14 clang-format-mp-14 clang-format19 clang-format-19 clang-format
     HINTS /usr/local/opt/clang-format@14/bin/ /usr/lib/llvm-14/bin/
     DOC "clang-format executable")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` at line 693, Update the NAMES list used when locating
clang-format in CMakeLists.txt to include additional common variants so the find
command matches both hyphenated and non-hyphenated installs; specifically add
names like clang-format-19, clang-format-14, clang-format-15, clang-format-16
(and their non-hyphenated counterparts) alongside the existing clang-format and
clang-format19 entries in the NAMES list so the finder used in this
CMakeLists.txt will locate clang-format across more platforms.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@CMakeLists.txt`:
- Line 693: Update the NAMES list used when locating clang-format in
CMakeLists.txt to include additional common variants so the find command matches
both hyphenated and non-hyphenated installs; specifically add names like
clang-format-19, clang-format-14, clang-format-15, clang-format-16 (and their
non-hyphenated counterparts) alongside the existing clang-format and
clang-format19 entries in the NAMES list so the finder used in this
CMakeLists.txt will locate clang-format across more platforms.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f21490 and 2bfd5f0.

📒 Files selected for processing (4)
  • CMakeLists.txt
  • Emulator/NativeCalls/CMakeLists.txt
  • Emulator/Serial/CMakeLists.txt
  • Emulator/Sound/CMakeLists.txt

@LaurentChardon
Copy link
Author

Looking at the "nitpick" comment from coderabbit, I realize that the addition of clang-format19 is not strictly necessary and can be removed. It's simpler and better for me as the packager to use a packaging tool that allows me to alias clang-format19 to clang-format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant