[ruby-core:114332] [Ruby master Bug#19794] Ruby 3.2.2 fails to build on macOS Sonoma betas

Issue #19794 has been reported by jhaungs (Jim Haungs). ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794 * Author: jhaungs (Jim Haungs) * Status: Open * Priority: Normal * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/

Issue #19794 has been updated by ecnelises (Chaofan Qiu).
ld maintains a list of directories to search for a library or framework to use. The default library search path is /usr/lib then /usr/local/lib. The -L option will add a new library search path. The default framework search path is /Library/Frameworks then /System/Library/Frameworks.
I'm using Sonoma beta with Xcode 15 beta, it seems system ld still tries to look for `/usr/local/lib` and emits warning when it doesn't exist. ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794#change-104167 * Author: jhaungs (Jim Haungs) * Status: Open * Priority: Normal * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/

Issue #19794 has been updated by jhaungs (Jim Haungs). Thanks for the Analysis. I've reported this as FB13016123 in Apple's feedback system. ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794#change-104168 * Author: jhaungs (Jim Haungs) * Status: Open * Priority: Normal * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/

Issue #19794 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Open to Assigned Assignee set to nobu (Nobuyoshi Nakada) We should avoid to non-existence directory for fresh install of macOS. @nobu Can you investigate this? ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794#change-104521 * Author: jhaungs (Jim Haungs) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/

Issue #19794 has been updated by monfresh (Moncef Belyamani). I think something else is going on here. On a fresh macOS installation, the `/usr/local` directory has been completely empty for several macOS versions now, since at least Catalina, and most likely earlier versions as well. I know this because I specialize in Ruby installation on Mac. I'm the creator of "Ruby on Mac" (rubyonmac.dev). I just installed Ruby 3.2.2 on macOS Sonoma 14.0 (release candidate) without any issues using my Ruby on Mac product. I also tried it directly with `rbenv` and it worked. This is on an M1 Mini with nothing in `/usr/local` and with Homebrew installed in `/opt/homebrew` If every version manager and installing from source failed, then perhaps there was a bug in Sonoma beta 4, or an incompatibility with Homebrew, or something wrong, outdated, misconfigured, or missing in @jhaungs dev setup on their Mac. If they're on an Intel Mac and `/usr/local` was empty, that would indicate that Homebrew wasn't installed yet. Another possible reason for this failure is that `/usr/local/lib` is a symlink to some file. This might sound farfetched, but I had a customer who had done just that. In my experience helping thousands of people over the past 12 years, the vast majority of installation issues are due to missing prerequisites, outdated or misconfigured tools, and setting incorrect or unnecessary Ruby compilation flags, either globally in the shell startup file or in the terminal as part of the installation command. ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794#change-104693 * Author: jhaungs (Jim Haungs) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/

Issue #19794 has been updated by jhaungs (Jim Haungs). Thanks @monfresh. I tried it on Sonoma RC, and it installed fine. The /usr/local/lib dir is present. I have had no feedback on FB13016123, but I suspect Apple fixed this after Sonoma Beta 4. One of my reasons for filing this was the hope that the configure script could be improved to surface errors from LD as something more meaningful than "Something wrong with LDFLAGS." It takes way too long to reverse-engineer the configure script to figure out the root cause of the error. ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794#change-104697 * Author: jhaungs (Jim Haungs) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/

Issue #19794 has been updated by nobu (Nobuyoshi Nakada). The latest Xcode seems taking care about only `/usr/local/lib` differently. ```sh $ echo 'int main(void) {return 0;}' > main.c $ clang --version Apple clang version 15.0.0 (clang-1500.0.40.1) Target: arm64-apple-darwin22.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin $ LANG=C ls /usr/local/lib /non/existent/lib ls: cannot access '/usr/local/lib': No such file or directory ls: cannot access '/non/existent/lib': No such file or directory bash: exit 2 $ clang -L /usr/local/lib -L /non/existent/lib main.c ld: warning: search path '/non/existent/lib' not found ``` ---------------------------------------- Bug #19794: Ruby 3.2.2 fails to build on macOS Sonoma betas https://bugs.ruby-lang.org/issues/19794#change-104705 * Author: jhaungs (Jim Haungs) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * ruby -v: 3.2.2 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails. When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build. The solution was to `cd /usr/local; sudo mkdir lib` to create the missing lib directory under /usr/local. It would be nice to remove this dependency from the configure script. -- https://bugs.ruby-lang.org/
participants (5)
-
ecnelises (Chaofan Qiu)
-
hsbt (Hiroshi SHIBATA)
-
jhaungs (Jim Haungs)
-
monfresh (Moncef Belyamani)
-
nobu (Nobuyoshi Nakada)