Skip to content

Conversation

@GaetanLepage
Copy link

GOOGLE_CLOUD_CPP_ENABLE features which do not have a corresponding GOOGLE_CPP_CPP_ENABLE_<name> feature are getting filtered out wrongfully.

Indeed, google_cloud_cpp_enable_cleanup will disable a feature when NOT "${${feature_flag}}".
This statement will be true in two cases:

  1. When GOOGLE_CPP_CPP_ENABLE_<name> is explicitly disabled (which is the intended behavior)
  2. When GOOGLE_CPP_CPP_ENABLE_<name> does not exist (unintended)

Indeed, this leads to universe_domain being filtered out as GOOGLE_CPP_CPP_ENABLE_UNIVERSE_DOMAIN was not declared in google_cloud_cpp_define_legacy_feature_options.

This PR fixes the google_cloud_cpp_enable_cleanup behavior by disabling a feature when both DEFINED "${${feature_flag}}" and NOT "${${feature_flag}}".

Another alternative would be to declare GOOGLE_CPP_CPP_ENABLE_UNIVERSE_DOMAIN, but I understood that these options were "legacy" and that their usage is discouraged.

@GaetanLepage GaetanLepage requested a review from a team as a code owner December 7, 2025 16:32
@gemini-code-assist
Copy link

Summary of Changes

Hello @GaetanLepage, 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 resolves a bug in the CMake build system's feature management, specifically within the google_cloud_cpp_enable_cleanup macro. Previously, features were unintentionally disabled if their dedicated GOOGLE_CLOUD_CPP_ENABLE_* option was not defined, rather than only when explicitly set to false. The change introduces a DEFINED check, ensuring that features are now correctly enabled by default unless explicitly opted out, thereby preventing erroneous feature removals like the one observed with universe_domain.

Highlights

  • Incorrect Feature Disabling: The google_cloud_cpp_enable_cleanup macro was incorrectly disabling features when their corresponding GOOGLE_CLOUD_CPP_ENABLE_* CMake option was undefined, rather than explicitly set to false.
  • Impact on 'universe_domain': This bug specifically led to features like universe_domain being filtered out because GOOGLE_CLOUD_CPP_ENABLE_UNIVERSE_DOMAIN was not declared, causing unintended behavior.
  • Conditional Logic Fix: The fix introduces a DEFINED check within the macro's conditional logic, ensuring that a feature is only disabled if its enable flag is both explicitly defined and set to a false value.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 addresses a bug in the CMake build logic where a feature could be incorrectly disabled. The issue arose when a legacy GOOGLE_CLOUD_CPP_ENABLE_<feature> option was not defined, as this was treated as a 'false' value, leading to the feature being filtered out. The fix introduces a check to verify that the legacy option is defined before its value is evaluated. This change is correct and makes the build configuration more robust by preventing features from being unintentionally disabled.

@GaetanLepage GaetanLepage changed the title fix(cmake): do not disable feature if option GOOGLE_CLOUD_CPP_ENABLE_* does not exist fix(cmake): do not disable feature if option GOOGLE_CLOUD_CPP_ENABLE_* does not exist Dec 7, 2025
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