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

abseil: Use the minimum C++ standard supported #133008

Closed
wants to merge 1 commit into from

Conversation

adamnovak
Copy link

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

This changes the Abseil build to build for the minimum C++ standard that Abseil supports. Abseil is now forward but not backward-compatible, so this should be compatible with the most C++ standards for downstream applications.

This will fix Homebrew#133007 and undoes Homebrew#62803 since Abseil 20230125.3 shouldn't need
it.

I'd add a test for user code with C++17 and Abseil with C++14, but then I
wouldn't be able to get rid of the fails with GCC 5 annotation.
@adamnovak
Copy link
Author

It's not clear to me yet how to build this manually from a Github branch, instead of from edits made via brew tap and brew edit. I'll keep trying to see if I can get Brew to run my modified formula for me.

@carlocab carlocab added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Jun 6, 2023
Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

I'm sympathetic with the desire to use an older C++ standard here; using C++17 makes things rather difficult for dependent software.

However, doing this will break dependents like or-tools. You can check this for yourself by building or-tools from source after making this change. But CC @Mizux in case there are workarounds for this.

If you need a version of Protobuf that doesn't require C++17, please use protobuf@21.

@carlocab
Copy link
Member

carlocab commented Jun 9, 2023

I don't think there's a way to do this without breaking dependents such as or-tools that use/need C++17. Therefore, closing.

If there is a workaround for the above, please open a new pull request that implements it.

@carlocab carlocab closed this Jun 9, 2023
@adamnovak
Copy link
Author

I don't think there's a way to do this without breaking dependents such as or-tools that use/need C++17. Therefore, closing.

I must be wrong about how Abseil's forward-compatibility is supposed to work, then. There was a commit over there that seemed to suggest you could (now) build C++17 code against an Abseil built on C++14 and have it work, if you let Abseil's CMake write its config header into the install. But maybe that's not actually true.

In that case, maybe the real answer is to expose somehow to user code somehow what C++ version Homebrew's Abseil is? Is there a way to ask that question about a package with brew?

@carlocab
Copy link
Member

This is not currently supported, and I'm not sure doing so would be very useful since it would be Homebrew-specific.

If there were a standard way to do it used by other package managers then that would be a different story.

However, I think you can use CMake to inspect the properties of targets provided by Abseil to determine the C++ standard they were compiled with.

@github-actions github-actions bot added the outdated PR was locked due to age label Jul 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants