Skip to content

Update Linux GCC code. #19642

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged

Update Linux GCC code. #19642

merged 1 commit into from
Apr 3, 2025

Conversation

MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Mar 28, 2025

Update both the variables that dictate this and the documents that explain our GCC/glibc policies.

These should ease a later future migration to a newer GCC version.

This is based on the conversation in #19238.

@Bo98
Copy link
Member

Bo98 commented Mar 28, 2025

Need to install g++-12 in the Docker image (on 22.04 only) and will require adjusting the needs_compiler_formula? check to check runtime libraries rather than the compiler. Ubuntu 22.04 is a weird one where the default compiler /usr/bin/gcc is 11 but the runtime libraries (which is what really matters 99% of the time) is 12.

Might also require compiler selector changes if it is preferring /usr/bin/gcc over /usr/bin/gcc-12. The compiler selector should already support the latter - just a matter of whether it prioritises it correctly or not. Just noting it to make sure it is tested.

@MikeMcQuaid
Copy link
Member Author

Thanks @Bo98. @iMichka is this something you (or another @Homebrew/maintainers who meaningfully uses Linux, I don't really) could finish off?

@iMichka
Copy link
Member

iMichka commented Apr 1, 2025

Ok so after thinking a little bit about this

  • I'm fine with bumping the compiler version but being conservative about glibc.
  • Need to install g++-12 in the Docker image -> can we uninstall gcc 11 to gain some space and not bloat the image (I do not know the impact on image size)
  • How will users know they need to switch to gcc12 if possible?
  • I would like to see is a deadline for switching to gcc 13: if we follow LTS versions this will not happen before 2027 and I think this is too far away from now?

@MikeMcQuaid
Copy link
Member Author

  • Need to install g++-12 in the Docker image -> can we uninstall gcc 11 to gain some space and not bloat the image (I do not know the impact on image size)

@iMichka I don't know, I'm OK with trying!

  • How will users know they need to switch to gcc12 if possible?

Feels like we should just handle this automatically for them with Docker images/formulae etc.

Otherwise: perhaps a brew doctor suggestion or adding to the installer?

  • I would like to see is a deadline for switching to gcc 13: if we follow LTS versions this will not happen before 2027 and I think this is too far away from now?

What's the need to move to GCC 13? What is blocked by being on GCC 12 (or even 11)?

@MikeMcQuaid MikeMcQuaid force-pushed the linux_ci_gcc branch 2 times, most recently from 98b9ab0 to d9f9b08 Compare April 3, 2025 10:40
@MikeMcQuaid MikeMcQuaid changed the title Update Linux CI to use GCC 12 Update Linux GCC code. Apr 3, 2025
@MikeMcQuaid MikeMcQuaid requested review from iMichka, Bo98 and carlocab April 3, 2025 10:40
@MikeMcQuaid
Copy link
Member Author

MikeMcQuaid commented Apr 3, 2025

I've hit my time box of what I can justify spending on this for now.

I've removed the actual version bumps here and scoped this to the refactoring/fixes that were needed that work without the version bumps.

The tests (bar formula audit failing which I don't understand) were passing here so this is ready to merge as-is and will make life easier for someone wanting to update these variables in future if they look back at the changes in 98b9ab0 to Dockerfile, the new host_gcc_path in Library/Homebrew/extend/os/linux/development_tools.rb and bumping versions in Library/Homebrew/os.rb. The remaining points are those raised by @iMichka, fixing the formula audit job and doing testing on a Linux machine.

@MikeMcQuaid MikeMcQuaid force-pushed the linux_ci_gcc branch 2 times, most recently from e1690e1 to 1f5e7b1 Compare April 3, 2025 11:33
Update both the variables that dictate this and the documents that
explain our GCC/glibc policies.

These should ease a future migration to a newer GCC version.
Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 3, 2025
Merged via the queue into master with commit e3137f1 Apr 3, 2025
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the linux_ci_gcc branch April 3, 2025 15:39
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