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

compilers: drop support for GCC 4.9, 5 and 6 #18127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Aug 22, 2024

  • 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?

GCC 4.9 was removed.

GCC 5-8 are all disabled:

  • 5 - removal on 2024-10-03
  • 6 - removal on 2024-10-03
  • 7 - removal on 2025-02-22
  • 8 - removal on 2025-02-22

More in line with https://docs.brew.sh/Manpage#install-options-formulacask-

This option will only accept compilers that are provided by Homebrew or bundled with macOS.

@cho-m cho-m force-pushed the remove-support-disabled-gcc branch from b9b144b to 378e8cf Compare August 22, 2024 22:01
@Bo98
Copy link
Member

Bo98 commented Aug 22, 2024

LGTM but might need to wait for the next minor release as this is technically a breaking change?

@MikeMcQuaid
Copy link
Member

I don't feel strongly either way. I'd be amazed if there's people relying on GCC 4.9 support given it's been removed for a while.

@Bo98
Copy link
Member

Bo98 commented Aug 23, 2024

System GCC also counts here but yeah.

If we're planning to also drop 5 and 6 maybe it's worth doing it all at the same time which is probably roughly when we'd do a minor release anyway.

@cho-m
Copy link
Member Author

cho-m commented Aug 23, 2024

System GCC also counts here but yeah.

Did we support using old system GCC?

I guess this could impact someone still running something like Ubuntu 14.04 LTS or RHEL7/DTS3. That would probably be an awful experience as various formulae have moved to C++17 (e.g. working on ICU 75 PR which makes C++17 a minimum deep in the dependency tree).


If we're planning to also drop 5 and 6 maybe it's worth doing it all at the same time which is probably roughly when we'd do a minor release anyway.

Makes sense. I was thinking of how many to drop but went conservative with only 4.9.

Minimum GCC 7 may allow cleaning up some fails_with gcc: "5" we added back when running older Ubuntu in CI as GCC 7 has most of the C++17 features.

@Bo98
Copy link
Member

Bo98 commented Aug 23, 2024

Did we support using old system GCC?

For Homebrew/core, not really. Can override it with --cc but that's like maximum levels of untested.

Third party taps are however free to use their own policies and CI images. We recommend aligning with Homebrew/core but do not require it.

@cho-m
Copy link
Member Author

cho-m commented Sep 2, 2024

I'll split out documentation changes to separate PR so this only touches Library/Homebrew/compilers.rb

EDIT: #18228

@cho-m cho-m force-pushed the remove-support-disabled-gcc branch from 378e8cf to d9edeb2 Compare September 2, 2024 16:39
@cho-m cho-m changed the title compilers: drop support for GCC 4.9 compilers: drop support for GCC 4.9, 5 and 6 Sep 2, 2024
GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12 13 14].freeze
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13|14)$/
GNU_GCC_VERSIONS = %w[7 8 9 10 11 12 13 14].freeze
Copy link
Member Author

Choose a reason for hiding this comment

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

4.9 (removed) and 5 & 6 (planned to remove in October). May need to check on which LTS distros this will impact.

Copy link
Member Author

@cho-m cho-m Sep 2, 2024

Choose a reason for hiding this comment

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

Rough estimates for some common older Linux:

Analytics Distro EOL? GCC
12 Amazon Linux 2 GCC 7
13 Ubuntu 18.04 2028 GCC 7
25 CentOS Linux 7 2024 GCC 4.8
34 Ubuntu 16.04 2026 GCC 5
37, 40, 60 RHEL 8 2032 GCC 8 or 9
128 RHEL 7 2026 GCC 4.8
347 Debian 8 Buster 2025 GCC 8

I didn't see any usage of GCC 4.9 or 6 from quick glance.

GCC 5 could impact Ubuntu 16 users and was our original default prior to newer Ubuntu/toolchain.

EDIT: Do we have analytics for GCC actually used? We strip out the --cc value in https://formulae.brew.sh/analytics/brew-command-run-options/365d/

Copy link
Member

@Bo98 Bo98 Sep 3, 2024

Choose a reason for hiding this comment

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

Do we have analytics for GCC actually used?

Unfortunately not. Stripping out arg values is intended behaviour because they are not validated so could contain any input. Though --cc isn't the only way it can be used as formulae can do e.g. ENV.public_send(:"gcc-5") (horrible API we should really fix but whatever it's public API nonetheless).

Copy link
Member

Choose a reason for hiding this comment

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

Do we have analytics for GCC actually used?

Could probably infer some of this from https://formulae.brew.sh/analytics/os-version/365d/

I think it'd be reasonable to require a GCC 7 minimum version for Homebrew based on the above. We already enforce relatively newer curl and git.

@Bo98
Copy link
Member

Bo98 commented Sep 3, 2024

For when we merge this, it might be worth dropping the gcc-4.9, gcc-5 and gcc-6 shim symlinks too.

@cho-m
Copy link
Member Author

cho-m commented Sep 3, 2024

For when we merge this, it might be worth dropping the gcc-4.9, gcc-5 and gcc-6 shim symlinks too.

Forgot about those. Will update PR to remove them.

Also, unrelated to this PR, was looking at shims and noticed we still have some old Apple GCC 4.2 shims. Is there any use for these?

@Bo98
Copy link
Member

Bo98 commented Sep 3, 2024

Minimum Xcode we support is 7.3 so probably can be removed.

I guess technically speaking a formula or build-script could rely on them my invoking llvm-gcc, so the shims do still have some purpose in "modernising" old build scripts to point to newer compilers. This is probably rare but given we're already calling the GCC removal a breaking change, we can bundle removing that with this PR.

@cho-m cho-m force-pushed the remove-support-disabled-gcc branch from d9edeb2 to af08745 Compare September 5, 2024 17:58
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.

3 participants