KEMBAR78
Migrate Linux CI to GCC 12 by cho-m · Pull Request #20609 · Homebrew/brew · GitHub
Skip to content

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Aug 30, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Exploring changes needed for this.

@MikeMcQuaid
Copy link
Member

Thanks @cho-m! Can I get a sense of what this would enable/unblock for us to upgrade?

@cho-m
Copy link
Member Author

cho-m commented Sep 1, 2025

Thanks @cho-m! Can I get a sense of what this would enable/unblock for us to upgrade?

I mainly want to migrate to remove workarounds I added to use gcc@12 / llvm in

  • node1
  • protobuf2
  • or-tools3

This avoids an unnecessary dependency and Ubuntu's GCC may be faster.

GCC 12 should also allow us to bottle ada-url (and maybe use in node). And it should remove the gcc@12 usage in osrm-backend.


In terms of user impact:

  • For users on bottles, there should be no noticeable impact. As mentioned in above thread, we have always used GCC 12 libraries
  • For source-build users, those on OS like Ubuntu 22.04 and RHEL 9 could be impacted where the default [apt | dnf] install gcc is GCC 11 (EDIT: though compiler selection may still be able to pick GCC 11?). These should have workarounds available to avoid brew gcc@12:
    • Ubuntu 22.04 users can install g++-12 and then update-alternatives
    • RHEL/Centos/Rocky 9 users can dnf install gcc-toolset-12 and then alternatives it

Footnotes

  1. https://github.com/Homebrew/homebrew-core/blob/main/Formula/n/node.rb#L47-L63

  2. https://github.com/Homebrew/homebrew-core/blob/main/Formula/p/protobuf.rb#L30-L36

  3. https://github.com/Homebrew/homebrew-core/blob/main/Formula/o/or-tools.rb#L53-L59

@MikeMcQuaid
Copy link
Member

@cho-m Thanks for explaining! As long as we can handle the from-bottle case automatically that'd be ideal. The from source case we may want a brew doctor warning for (but optional given it's not supported anyway).

It's also worth thinking here about when/whether we want to move to Ubuntu 24.04. I suspect the answer is "no, not yet" but we'll need to in ~1.5 years.

@cho-m
Copy link
Member Author

cho-m commented Sep 1, 2025

It's also worth thinking here about when/whether we want to move to Ubuntu 24.04. I suspect the answer is "no, not yet" but we'll need to in ~1.5 years.

No strong opinion here. Anytime from Apr 2026 (26.04 release date) to Apr 2027 (end of standard support) should be fine. May want to prepare advance notice to make sure users are aware of plan.

@MikeMcQuaid
Copy link
Member

May want to prepare advance notice to make sure users are aware of plan.

We can communicate "at some point after X we will ...". We can't really commit to dates years out given a volunteer team 😭

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks! A few more comments.

@cho-m cho-m force-pushed the gcc-12 branch 3 times, most recently from b42ed19 to 2988231 Compare September 2, 2025 16:45
@cho-m
Copy link
Member Author

cho-m commented Sep 2, 2025

Pushed some updates for review comments but will need to do more local testing to make sure they work.


We can communicate "at some point after X we will ...". We can't really commit to dates years out given a volunteer team 😭

Yeah, not a hard deadline. Just a rough timeframe as glibc upgrade can cause unexpected issues.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

This now looks great to me, nice work @cho-m!

@MikeMcQuaid
Copy link
Member

We can communicate "at some point after X we will ...". We can't really commit to dates years out given a volunteer team 😭

Yeah, not a hard deadline. Just a rough timeframe as glibc upgrade can cause unexpected issues.

@cho-m Agreed. Would you be able to pick up a first draft for this? Could be either in Support Tiers (there's similar stuff for macOS at the bottom) or Homebrew on Linux docs.

@cho-m
Copy link
Member Author

cho-m commented Sep 3, 2025

Container seems okay with quick build and formula install attempt. brew config shows:

Host glibc: 2.35
Host libstdc++: 6.0.30
/usr/bin/gcc-12: 12.3.0

Removing gcc-12 gives

Host glibc: 2.35
Host libstdc++: 6.0.30
/usr/bin/gcc: 11.4.0

Removing gcc gives

Host glibc: 2.35
Host libstdc++: 6.0.30
/usr/bin/gcc: N/A

Spun up a clean Rocky 9 container to see output:

OS: Rocky Linux release 9.3 (Blue Onyx)
Host glibc: 2.34
Host libstdc++: 6.0.29

And Ubuntu 16.04:

OS: Ubuntu 16.04.7 LTS
Host glibc: 2.23
Host libstdc++: 6.0.21

@cho-m cho-m marked this pull request as ready for review September 3, 2025 20:03
@cho-m cho-m changed the title Migrate Linux to GCC 12 Migrate Linux to GCC 12 and check libstdc++ Sep 3, 2025
@cho-m cho-m marked this pull request as draft September 4, 2025 13:21
@cho-m cho-m changed the title Migrate Linux to GCC 12 and check libstdc++ Add GCC 12 to Dockerfile and check host libstdc++ Sep 12, 2025
@cho-m cho-m changed the title Add GCC 12 to Dockerfile and check host libstdc++ Migrate Linux CI to GCC 12 Sep 12, 2025
@cho-m cho-m changed the base branch from main to libstdcxx September 12, 2025 18:45
Base automatically changed from libstdcxx to main September 12, 2025 19:34
@cho-m
Copy link
Member Author

cho-m commented Sep 13, 2025

Can wait a couple days in case some issues show up for other commits. I will also try building formulae on docker image.

@cho-m cho-m marked this pull request as ready for review September 15, 2025 00:47
@cho-m
Copy link
Member Author

cho-m commented Sep 16, 2025

Should be ready to review. May want to wait for Tahoe bottling to slow down before merge so there is less CI activity.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Good to merge when Tahoe bottling complete!

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@cho-m
Copy link
Member Author

cho-m commented Sep 17, 2025

Merging as Tahoe bottling has slowed down (first pass done, no bottle jobs) and GNOME formulae are starting to fail with GCC 11.

Can try to fix forward any failures we hit in Homebrew/core.

@cho-m cho-m added this pull request to the merge queue Sep 17, 2025
Merged via the queue into main with commit e94d1da Sep 17, 2025
36 checks passed
@cho-m cho-m deleted the gcc-12 branch September 17, 2025 16:31
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.

4 participants