-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
GCC version changes break bottle linkage #33948
Comments
Looking at the configure script, there doesn't seem to be an official way to do this. It should be possible though, and I think it's a good idea. |
Rebottling them now. |
I don't think this is limited to just bottles. Pgplot, for instance, also breaks due to the GCC release changing version numbers as it can no longer find libgfortran.3.dylib |
Could we symlink the previously named dylibs & such onto the current version? ie, symlink a |
GCC uses the contents of Moving forward, we could have GCC install to a directory that doesn't contain minor version so it doesn't break on point releases, e.g. |
I thought this was because we pass |
It is, yes. |
We should ask the gcc developers for suggestions before we make any changes. |
This breaks most of JuliaLang's bottles at every point release as well, making testing on OSX Travis impossible until our lone bottle-builder gets a chance to rebuild everything. Hopefully there's a good long-term solution here. |
I'd like to also point out that entwined with this issue is the fact that the paths contain OSX minor version numbers as well, such as this path on my 10.8 machine: I don't have problems with C-compiled programs, it's only things that get linked by |
I half-seriously opened a PR at homebrew-python to keep a copy of the relevant gcc libraries inside scipy's prefix and to rewrite linkages to point to the sequestered libraries. There's a tool called delocate which does this (which is used to make Python wheel binary distributions and happens to be written in Python but isn't otherwise Python-specific) but I think the functionality would be relatively straightforward to reimplement in Ruby and pull into Homebrew core if we chose to implement a |
There is some new progress on a |
I'm experimenting with a few tweaks to the formula to remove This links diff --git a/Library/Formula/gcc.rb b/Library/Formula/gcc.rb
index 899c5f3..13f3a40 100644
--- a/Library/Formula/gcc.rb
+++ b/Library/Formula/gcc.rb
@@ -87,7 +87,7 @@ class Gcc < Formula
args = [
"--build=#{arch}-apple-darwin#{osmajor}",
- "--prefix=#{prefix}",
+ "--prefix=#{libexec}",
"--enable-languages=#{languages.join(",")}",
# Make most executables versioned to avoid conflicts.
"--program-suffix=-#{version_suffix}",
@@ -97,10 +97,6 @@ class Gcc < Formula
"--with-cloog=#{Formula["cloog"].opt_prefix}",
"--with-isl=#{Formula["isl"].opt_prefix}",
"--with-system-zlib",
- # This ensures lib, libexec, include are sandboxed so that they
- # don't wander around telling little children there is no Santa
- # Claus.
- "--enable-version-specific-runtime-libs",
"--enable-libstdcxx-time=yes",
"--enable-stage1-checking",
"--enable-checking=release",
@@ -143,10 +139,14 @@ class Gcc < Formula
system "../configure", *args
system "make", "bootstrap"
system "make", "install"
+ end
- if build.with?("fortran") || build.with?("all-languages")
- bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"
- end
+ # Symlink contents from bin and share
+ Dir.glob(libexec/"bin/*") {|file| bin.install_symlink file}
+ prefix.install_symlink libexec/"share"
+
+ if build.with?("fortran") || build.with?("all-languages")
+ bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"
end
# Handle conflicts between GCC formulae and avoid interfering
@@ -161,10 +161,10 @@ class Gcc < Formula
# Rename java properties
if build.with?("java") || build.with?("all-languages")
config_files = [
- "#{lib}/logging.properties",
- "#{lib}/security/classpath.security",
- "#{lib}/i386/logging.properties",
- "#{lib}/i386/security/classpath.security"
+ "#{libexec}/lib/logging.properties",
+ "#{libexec}/lib/security/classpath.security",
+ "#{libexec}/lib/i386/logging.properties",
+ "#{libexec}/lib/i386/security/classpath.security"
]
config_files.each do |file|
add_suffix file, version_suffix if File.exist? file |
GCC's practice of installing to
target/version
subdirectories breaks linkage in downstream formulae for each release. So right now all three bottles here that depend on:fortran
need to be rebuilt because they link against 4.9.1.open-mpilibxcThis is a much more obvious problem in Homebrew/science, where we get an influx of issues and recompiling of massive builds like Octave and its dependencies after each minor GCC release. Looking at the docs, there doesn't seem to be a reasonable way to get around this. Perhaps someone more experienced with GCC could provide insight.
The text was updated successfully, but these errors were encountered: