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

gcc 12.1.0 #100411

Closed
wants to merge 59 commits into from
Closed

gcc 12.1.0 #100411

wants to merge 59 commits into from

Conversation

fxcoudert
Copy link
Member

GCC 12.1.0 will be released in about a week: https://gcc.gnu.org/pipermail/gcc/2022-April/238628.html

ARM support was partly, but not fully, integrated into upstream (GCC has a slow development cycle). We can use a patch, based on the maintainer's branch at https://github.com/iains/gcc-darwin-arm64

@fxcoudert fxcoudert added do not merge prerelease-testing Pull request from upstream, testing a pre-release with homebrew dependencies CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. long build Set a long timeout for formula testing labels Apr 29, 2022
@BrewTestBot BrewTestBot added the automerge-skip `brew pr-automerge` will skip this pull request label Apr 29, 2022
@cho-m cho-m removed the CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. label Apr 30, 2022
@bayandin bayandin added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Apr 30, 2022
SMillerDev
SMillerDev previously approved these changes Apr 30, 2022
@SMillerDev SMillerDev dismissed their stale review April 30, 2022 08:15

That was meant to be a comment

@fxcoudert fxcoudert added the CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. label Apr 30, 2022
@fxcoudert
Copy link
Member Author

ARM patch needs to be rebased on top of the actual RC, I'll do that. Let's see how gcc 12 rc goes on Intel.

@fxcoudert
Copy link
Member Author

D front-end now needs to be bootstrapped. It has so few users, remove for now.

@fxcoudert fxcoudert force-pushed the gcc12 branch 3 times, most recently from 844cf5b to e74612c Compare April 30, 2022 17:11
@fxcoudert
Copy link
Member Author

This PR needs a brew change before we can test formulas that depend on GCC: Homebrew/brew#13221

@fxcoudert
Copy link
Member Author

So, both Intel and ARM builds seem to proceed okay, most depends build OK, I've completed the list of revision bumps and this should now look almost like the final thing. (Well, when GCC is released in a week.)

@fxcoudert
Copy link
Member Author

On ARM macOS 12:

  • dynare build failure: https://git.dynare.org/Dynare/dynare/-/issues/1852
  • nwchem existing build failure
  • lots of files with missing rpath in openmodelica linkage test
  • khiva has a file with missing rpath
  • highs msc-generator pythran will also need a rev-bump

@cho-m cho-m added the CI-linux-self-hosted Build on Linux self-hosted runner label May 1, 2022
@chenrui333 chenrui333 removed the CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. label May 2, 2022
@cho-m cho-m mentioned this pull request May 4, 2022
6 tasks
@danielnachun
Copy link
Contributor

danielnachun commented Jul 28, 2022

Build the gcc formula using glibc@2.13 instead

This is what I want to do but it will take a while to figure out as it's a bit more complicated than the other formula. I am very confident we can make the glibc bootstrapping work but I feel bad that it's blocking our migration. I am personally very invested in putting in the work to make CentOS 7 support as seamless as possible because I am one of the people using Homebrew on that platform. But I can't give an exact timeline for when I can get this last snag fixed for bootstrapping.

If this looks infeasible in the short term then I'm okay with leaving it to the user to get a new enough version of GCC to build the glibc formula during bootstrapping. This isn't the easiest thing to do but given that I hope to make glibc relocatable eventually I hope it will be come irrelevant.

Can I propose a slightly more involved solution for migrating to GCC 12 that would allow us to save the bottles we already made and not force an immediate upgrade to a newer CI image? I am willing to take full responsibility for the work it would require and would start on it immediately if we're okay with it. These are the steps we would take:

  1. Revision bump GCC 11 to add #{opt_lib}/gcc/current as a symlink to the GCC 11 formula without removing #{opt_lib}/gcc/11, and replace #{opt_lib}/gcc/11 with #{opt_lib}/gcc/current in the RPATHs we add to the GCC spec on Linux. This will mean that bottles currently built with GCC 11 will still work and that any new bottles built with it will look for libstdc++ in #{opt_lib}/gcc/current.
  2. Revision bump all GCC dependents in individual PRs without dependent testing. While I know this is a pain, we only have to do it once, and we will only need long builds for a handful of formulae. The sole purpose of this is to update their RPATH so that it looks for libstdc++ in #{opt_lib}/gcc/current instead of #{opt_lib}/gcc/11.
  3. In the GCC 12, PR, revert GCC 11 back the way it was and use the #{opt_lib}/gcc/current path in GCC 12 instead.

Although we will have vastly fewer GCC Linux dependents in the near future, once we've switched to the #{opt_lib}/gcc/current structure, we won't ever have to revision bump Linux-specific GCC dependents on GCC version upgrades again.

@sjackman
Copy link
Contributor

sjackman commented Jul 29, 2022

I suggest…

  • upgrade the glibc formula to 2.35 (or the version provided by the chosen Ubuntu version)
  • update the bottle builder image to Ubuntu 22.04 (or 18.04 or 20.04)
  • unbottle the ~300 formulae that depend on gcc on Linux and remove the gcc dependency
  • merge this PR
  • rebuild the unbottled formulae using the host compiler

@carlocab
Copy link
Member

I am very confident we can make the glibc bootstrapping work but I feel bad that it's blocking our migration.

This is where we disagree: I think glibc bootstrapping can and should be fixed properly after migration rather than before. In particular, it should not be a blocker at all.

Instead of worrying about making glibc bootstrapping seamless for users on older systems, we should provide a viable (even if a bit rocky) migration path for them to follow. I suspect most of these users already know their way around a Linux system, so it doesn't need to be as smooth as it should be for the average user.

If this looks infeasible in the short term then I'm okay with leaving it to the user to get a new enough version of GCC to build the glibc formula during bootstrapping. This isn't the easiest thing to do but given that I hope to make glibc relocatable eventually I hope it will be come irrelevant.

Yes, this is one example of a viable migration path that I reference above.

Can I propose a slightly more involved solution for migrating to GCC 12 that would allow us to save the bottles we already made and not force an immediate upgrade to a newer CI image? I am willing to take full responsibility for the work it would require and would start on it immediately if we're okay with it. These are the steps we would take:

  1. Revision bump GCC 11 to add #{opt_lib}/gcc/current as a symlink to the GCC 11 formula without removing #{opt_lib}/gcc/11, and replace #{opt_lib}/gcc/11 with #{opt_lib}/gcc/current in the RPATHs we add to the GCC spec on Linux. This will mean that bottles currently built with GCC 11 will still work and that any new bottles built with it will look for libstdc++.
  2. Revision bump all GCC dependents in individual PRs without dependent testing. While I know this is a pain, we only have to do it once, and we will only need long builds for a handful of formulae. The sole purpose of this is to update their RPATH so that it looks for libstdc++ in #{opt_lib}/gcc/current instead of #{opt_lib}/gcc/11.
  3. In the GCC 12, PR, revert GCC 11 back the way it was and use the #{opt_lib}/gcc/current path in GCC 12 instead.

This plan requires nearly twice as many rebuilds and/or revision bumps, and both are costly. Rebuilds take CI time, which is in short supply these days. revision bumps trigger cascading formula upgrades that we get very many complaints about.

@sjackman
Copy link
Contributor

Here's a PR to upgrade Glibc to version 2.35 to get the ball rolling.

@MikeMcQuaid
Copy link
Member

Instead of worrying about making glibc bootstrapping seamless for users on older systems, we should provide a viable (even if a bit rocky) migration path for them to follow. I suspect most of these users already know their way around a Linux system, so it doesn't need to be as smooth as it should be for the average user.
...
Yes, this is one example of a viable migration path that I reference above.
...
This plan requires nearly twice as many rebuilds and/or revision bumps, and both are costly. Rebuilds take CI time, which is in short supply these days. revision bumps trigger cascading formula upgrades that we get very many complaints about.

Agreed with all of this. Would suggest we take discussion of a plan into a dedicated issue.

  • unbottle the ~300 formulae that depend on gcc on Linux and remove the gcc dependency

This feels like something we could/should do now to get things rolling.

@sjackman
Copy link
Contributor

Agreed with all of this. Would suggest we take discussion of a plan into a dedicated issue.

unbottle the ~300 formulae that depend on gcc on Linux and remove the gcc dependency

This feels like something we could/should do now to get things rolling.

I agree!

@carlocab
Copy link
Member

  • unbottle the ~300 formulae that depend on gcc on Linux and remove the gcc dependency

This feels like something we could/should do now to get things rolling.

Yes, we can see which formulae need this based on CI from #106755.

@chandlerc
Copy link
Contributor

Can we make sure we add a comment to any formulae where the bottle is removed so that we know it was done deliberately?

Will these bottles get added back?

I'm worried because some things have had the bottle removed that are exceedingly expensive to build from source. There has been a huge push that this isn't something we should be solving and instead we should rely on bottles, but if they go away this whole idea breaks down.

For example, LLVM no longer has a bottle and that is going to make things very painful for users trying to install it as LLVM can be very slow and resource intensive to build.

@carlocab
Copy link
Member

carlocab commented Aug 2, 2022

Will these bottles get added back?

Yes. We intend to do so as soon as possible. Sorry for the inconvenience!

@chandlerc
Copy link
Contributor

Will these bottles get added back?

Yes. We intend to do so as soon as possible. Sorry for the inconvenience!

Any estimates for the timescale of "soon" here?

Our continuous builds on Linux are currently broken due to lack of bottles, so we'll have to work around this if its even on the order of days. We've been fine with the periodic bottle re-build that takes several hours in the worst case, but it seems like this is going to be a longer lasting problem than that.

We also need to give users instructions as if they are on a laptop for example they may not realistically be able to build LLVM from source.

carlocab added a commit to carlocab/homebrew-core that referenced this pull request Aug 2, 2022
We can do with keeping this for a little bit longer. In the meantime,
external CI is relying on it. See Homebrew#100411.

This reverts commit e90cd98.
@carlocab carlocab mentioned this pull request Aug 2, 2022
6 tasks
@carlocab
Copy link
Member

carlocab commented Aug 2, 2022

I'll add this back in #107087. (Merged in 19dc6a6.)

Note: the llvm bottles will break when I merge #106755. This may happen in the next three days. Fixing it requires one of:

I'll give you some warning before that happens. I'll work on merging #107018 so that users who cannot do any of the above can try using llvm@13 in the meantime.

Does that work for you?

BrewTestBot pushed a commit that referenced this pull request Aug 2, 2022
We can do with keeping this for a little bit longer. In the meantime,
external CI is relying on it. See #100411.

This reverts commit e90cd98.

Closes #107087.

Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
@chandlerc
Copy link
Contributor

We could temporarily go back to llvm@13 if we needed to, or better yet when landed manually install gcc@11.

Also happy to know how to get bottles working again w/ the new GCC everywhere, I don't want to leave you all stuck in a weird state either.

chandlerc added a commit to chandlerc/carbon-lang that referenced this pull request Aug 2, 2022
This lets us workaround issues that came up where Homebrew removed the
LLVM bottles on Linux that we relied on to have reasonable install times
for our CI.

See Homebrew/homebrew-core#100411 for discussion of the challenges
they're facing here. We raised this issue and they've temporarily worked
around it for us so this PR isn't necessary. But I wanted to send it out
for reference in case we eventually do need to briefly pin and work
around things, we should know how.

If interested, I can generalize this a bit so that we just have a simply
commitish setting somewhere than enables and leverages this, and we can
poke a new commitish into that any time we hit something and need to
keep CI flowing.
@chandlerc
Copy link
Contributor

FWIW, if its useful for us to pin everything for a few days (or even a week) while the world rebuilds against GCC-12, I think that'd be pretty easy for us at this point.

@carlocab
Copy link
Member

carlocab commented Aug 2, 2022

Just as an update, we've now worked out a smoother transition plan that involves much less breakage.

See:
Homebrew/brew#13631
Homebrew/brew#13633
#107148

There will almost certainly still be some, but it will likely not be to any painful-to-build formulae. In particular, I don't expect any of the workarounds I mentioned above to be necessary. But feel free to shout if we break something again.

@cho-m cho-m added the superseded PR was replaced by another PR label Aug 4, 2022
@carlocab
Copy link
Member

carlocab commented Aug 5, 2022

@chandlerc GCC 12 will land in the next hour or so. If something breaks for you, let me know. Anything that does should be fixed by a brew reinstall. Please do let me know even if brew reinstall fixed it, and especially if it didn't.

If there is breakage, brew may attempt to eagerly rebuild a formula from source to try to fix it. You can feel free to interrupt the rebuild attempt and then do a brew reinstall from a bottle.

@fxcoudert fxcoudert deleted the gcc12 branch August 5, 2022 16:59
@chandlerc
Copy link
Contributor

@chandlerc GCC 12 will land in the next hour or so. If something breaks for you, let me know. Anything that does should be fixed by a brew reinstall. Please do let me know even if brew reinstall fixed it, and especially if it didn't.

If there is breakage, brew may attempt to eagerly rebuild a formula from source to try to fix it. You can feel free to interrupt the rebuild attempt and then do a brew reinstall from a bottle.

Just to close the loop, everything worked great with this approach!

@github-actions github-actions bot added the outdated PR was locked due to age label Sep 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge-skip `brew pr-automerge` will skip this pull request CI-linux-self-hosted Build on Linux self-hosted runner CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. long build Set a long timeout for formula testing outdated PR was locked due to age superseded PR was replaced by another PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.