Eventually we may want to merge homebrew-core and linuxbrew-core. Even if not, minimising the diff between these repositories makes life easier for the linuxbrew-core maintainers.
To do this will require a few things (not in any particular order):
if OS.linux? blocks (partly for readability and partly so these blocks can be parsed on macOS) like uses_from_macos e.g.def install that's only run on a single platformcellar :any to bottles on a single platform@sjackman I would like to make gcc@5 the main gcc formula on linux.
brew install gcc would then install gcc 9, like it does on mac. This would allow to cleanup the gcc formula on linux, and ease the transition. Do you think this is doable?
As of #7280 we've got an audit for legitimate uses_from_macos usage.
@sjackman I would like to make gcc@5 the main gcc formula on linux.
brew install gcc would then install gcc 9, like it does on mac. This would allow to cleanup the gcc formula on linux, and ease the transition. Do you think this is doable?
My intuition is that on Linux gcc should be an alias to gcc@5.
As of #7280 we've got an audit for legitimate
uses_from_macosusage.
Thanks, Issy!
My intuition is that on Linux gcc should be an alias to gcc@5
This means that we need os-dependent aliases. Not sure I like that idea. And I still think it is surprising to brew install gcc and get something different than on mac.
I'm with @iMichka that I think the cleanest solution is probably to make the gcc formula the same on both OSs. It's easier to have Homebrew/brew compiler selection code pick a different compiler when needed than it's going to be to have homebrew-core have different logic for GCC versions with the same name.
Makes sense. I'm on board.
FYI having the command "gcc" (on the system: 10.1.1, Fedora 32) clobbered by linuxbrew's gcc (5.5) caused some unexpected problems that I only started to encounter when compiling a gem with a c++ dependency.
It's also contra the documentation, "Homebrew does not use any libraries provided by your host system, except glibc and gcc if they are new enough."
I do not mind brew clobbering with new versions, but ancient ones? Hmmm.
My workaround has been to uninstall the "gcc" formula, ignoring the dependency requirement by "llvm" (which in turn is brought in by Postgres and maybe Crystal language).
I do not mind brew clobbering with new versions, but ancient ones? Hmmm.
A fair comment. I'll keep this in mind when we address this issue.
@iMichka I recently stumbled in a very ancient GCC's ThreadSanitizer data race bug when compiling a Go program which relies on cgo. on linux
Just to understand, why does homebrew defaults to 5.5?
Because we build on Ubuntu 16.04 which is a LTS version, and gcc5 is the default there.
You can modify a formula to make it use any other brewed gcc if needed.
You can also use brew install --cc=gcc-9 hello
What about using the system GCC if it's adequate, per documentation?
If the brewed GCC-5 is installed, it will always take precedence. If the brewed GCC-5 is not installed, and if the host GCC is new enough, it will be used.
Yeah, but when I install(ed) llvm, it decided to opt me into installing gcc. I took no special action to install GCC of any version myself. And LLVM is a dependency of Postgres and Crystal. Maybe it's a formula problem with llvm?
Yes, because llvm currently depends on gcc as it provides libstdc++. If you know how to ship llvm without gcc, a PR is welcome.
Could we discuss this somewhere else, this issue was not about llvm and gcc intially: https://discourse.brew.sh
Short status update, as some huge progress has been made lately:
OS.mac? statments. We are now below 1400.There was a proposal from @SMillerDev to start adding linux bottles and more CI to homebrew-core as the migration is ongoing. Initially I was thinking to add all the bottles in one step at the end of the migration; but we can also take a step-by-step approach. We can not re-use linuxbrew-core bottles as-is, as the revisions are sometimes different there.
Thoughts?
I think the best option to have would be:
We bottle the formula that are explicitly enabled to be tested in homebrew-core and use those bottles in linuxbrew where we can having less and less bottles in the linuxbrew bintray.
Second best option:
We bottle the formula that are explicitly enabled to be tested in homebrew-core and rebuild the bottles in linuxbrew. Until we flip the switch and we disable linuxbrew.
Worst option:
We don't bottle in homebrew-core, but we keep the same flow until all formulae are upstreamed from linuxbrew and then we start bottles in homebrew-core.
The first option looks great, but how can we know on which bintray account the Linux bottle actually is? This will become irrelevant when we merge the core taps together, but for now I think it would be a problem that needs to be sorted out first.
We bottle the formula that are explicitly enabled to be tested in homebrew-core and rebuild the bottles in linuxbrew. Until we flip the switch and we disable linuxbrew.
I like this option.
The first option looks great, but how can we know on which bintray account the Linux bottle actually is? This will become irrelevant when we merge the core taps together, but for now I think it would be a problem that needs to be sorted out first.
I'd imagine we can try the main one and fall back if it fails?
I would go for second option. It's less work, and probably easier to handle.
We just need to think about the final migration when we flip the switch, but that's all.
Most helpful comment
Short status update, as some huge progress has been made lately:
OS.mac?statments. We are now below 1400.