-
Notifications
You must be signed in to change notification settings - Fork 1
build(cmake): fix invalid macOS deployment target #96
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
Conversation
Summary of ChangesHello @bniladridas, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily addresses a critical build configuration issue on macOS by correcting an invalid deployment target in CMake. This ensures that the project builds against a supported macOS version, preventing potential linker warnings or compatibility problems. Additionally, it updates the pre-commit configuration to leverage newer hooks and explicitly defines the path for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly fixes an invalid macOS deployment target in the CMake configuration, which improves build stability on macOS. It also updates the pre-commit-hooks dependency to a newer version.
My review includes two main points:
- In
.pre-commit-config.yaml, the path toclang-formathas been hardcoded. This reduces portability and should be reverted to allowpre-committo find the executable in the system'sPATH. - In
CMakeLists.txt, the change to the deployment target has made a conditional block redundant. I've suggested a simplification to improve code clarity.
| - id: clang-format | ||
| name: clang-format | ||
| entry: clang-format | ||
| entry: /opt/homebrew/bin/clang-format |
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.
Hardcoding the path to clang-format makes the pre-commit configuration less portable. This path is specific to Apple Silicon Macs with Homebrew installed in its default location. It will fail for developers on Intel-based Macs (where Homebrew is in /usr/local), on other operating systems, or for those who have installed clang-format through different means.
The language: system hook is designed to find the executable in the system's PATH. It's better to rely on that and ensure clang-format is in the PATH in the development environment. Please revert this to entry: clang-format.
entry: clang-format| set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0" CACHE STRING "Minimum macOS version" FORCE) | ||
| else() | ||
| # Use current system version to avoid linker warnings with Homebrew libraries | ||
| set(CMAKE_OSX_DEPLOYMENT_TARGET "26.0" CACHE STRING "Minimum macOS version" FORCE) | ||
| set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0" CACHE STRING "Minimum macOS version" FORCE) | ||
| endif() |
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.
With this change, both branches of the if(DEFINED ENV{CI} OR DEFINED ENV{GITHUB_ACTIONS}) conditional (starting on line 147) now set CMAKE_OSX_DEPLOYMENT_TARGET to the same value ("14.0"). The conditional logic is now redundant. To improve code clarity, you could remove the if/else block (lines 147-153) and replace it with a single set() command and an updated comment explaining why 14.0 is used.
agentBuild: [##########.] 100% (Passed) Overall: Operational (92%) |
I thought this might fix a bug I’m working on, but it turned out not to be the cause. Still, this setting is clearly incorrect and worth fixing.
CMAKE_OSX_DEPLOYMENT_TARGET="26.0"is invalid and should be set to a supported macOS version (e.g."14.0"). This was surfaced while using clang-format version 21.1.8.…and cleaned up some outdated content on the GitLab mirror.