Opened 4 years ago
Closed 3 years ago
#62183 closed defect (fixed)
ruby30 @3.0.0: error: use of undeclared identifier 'fmt'; did you mean 'fma'?
Reported by: | simon-dedeo | Owned by: | kimuraw (kimura wataru) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.4 |
Keywords: | sierra | Cc: | simon-dedeo, mascguy (Christopher Nielsen) |
Port: | ruby30 |
Description (last modified by simon-dedeo)
with MacPorts version 2.6.4
simon$ sudo port install ruby30 ---> Computing dependencies for ruby30 ---> Fetching archive for ruby30 ---> Attempting to fetch ruby30-3.0.0_0.darwin_16.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/ruby30 ---> Attempting to fetch ruby30-3.0.0_0.darwin_16.x86_64.tbz2 from https://mse.uk.packages.macports.org/ruby30 ---> Attempting to fetch ruby30-3.0.0_0.darwin_16.x86_64.tbz2 from https://lil.fr.packages.macports.org/ruby30 ---> Fetching distfiles for ruby30 ---> Verifying checksums for ruby30 ---> Extracting ruby30 ---> Configuring ruby30 ---> Building ruby30 Error: Failed to build ruby30: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_ruby30/ruby30/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port ruby30 failed
The logfile is attached.
Oddly, my particular version of Mac OS X (10.12) is flagged as bad at https://ports.macports.org/port/ruby30/summary
Thank you for any help -- keen to get our code up and running on the new system.
UPDATE: FIXED
After some more playing around, I noticed that there was a version incompatability between the clang residing in /usr/bin/clang, and the one in /Library/Developer/CommandLineTools/usr/bin/:
simon$ /usr/bin/clang --version Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
simon$ /Library/Developer/CommandLineTools/usr/bin/clang --version Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
simon$ /opt/local/bin/clang --version clang version 9.0.1 Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-9.0/bin
For some reason, making a soft link from /Library/Developer/CommandLineTools/usr/bin/clang
to /opt/local/clang
seemed to trigger the right behavior. Amusingly, one reason I noticed this is that I had an older ticket here about my adventures in clang version land.
I don't know if the earlier failure to compile was triggered by running things with clang 8.1, or if it had something to do with mixing clang 8.1 and 9.0 at different stages.
I've attached the new, successful log file in case people are curious.
Attachments (3)
Change History (13)
Changed 4 years ago by simon-dedeo
comment:1 Changed 4 years ago by simon-dedeo
Cc: | simon-dedeo added |
---|---|
Description: | modified (diff) |
Port: | ruby30 added |
Version: | → 2.6.4 |
comment:2 Changed 4 years ago by simon-dedeo
Description: | modified (diff) |
---|
Changed 4 years ago by simon-dedeo
Attachment: | main_success.log added |
---|
(partial version of) a successful log file for the install
comment:3 Changed 4 years ago by simon-dedeo
Description: | modified (diff) |
---|
comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | sierra added |
---|---|
Owner: | set to kimuraw |
Status: | new → assigned |
Summary: | ruby30: won't install on Mac OS X 10.12.6 → ruby30 @3.0.0: error: use of undeclared identifier 'fmt'; did you mean 'fma'? |
Replying to simon-dedeo:
For some reason, making a soft link from
/Library/Developer/CommandLineTools/usr/bin/clang
to/opt/local/clang
seemed to trigger the right behavior.
You should not be manually creating symlinks in this manner. Please undo what you did. To fix the clang version mismatch, please install matching versions of Xcode and the Xcode command line tools, using a version that is compatible with your OS version.
Oddly, my particular version of Mac OS X (10.12) is flagged as bad at https://ports.macports.org/port/ruby30/summary
I wouldn't call it odd. Our build failed in the same way that yours did. So there is something wrong there that we need to fix.
comment:5 Changed 4 years ago by simon-dedeo
Thank you Ryan; I'm doing the Xcode/Xcode command line tools update now, and I'll let you know what happens. Downstream from the successful compile I had some weird behaviors from ruby30 itself (i.e., when running it), so it wasn't a successful install, just one that didn't crash at install time.
Changed 4 years ago by simon-dedeo
Attachment: | main.2.log added |
---|
re-running with updated XCode, and no weird symlinks; new version fails again
comment:6 Changed 4 years ago by simon-dedeo
Just comparing the log files, there's very little different except that the successful compile was with clang version 9.0.1
, the unsuccessful with Apple LLVM version 9.0.0 (clang-900.0.39.2)
; i.e., perhaps this has to do with a subtle difference between the two branches of clang.
comment:7 Changed 4 years ago by simon-dedeo
In case it helps, I managed to get the installation to work with the following trick. Obviously this is not the way someone wants to do it in the long term! It's based on reading (via Google translate) the remarks at https://koic.hatenablog.com/entry/update-clang-for-ruby-2-8-0-dev which suggest that it's the version of clang that's causing trouble. If it is indeed clang-9, this might explain why both lower and higher versions of Mac OS X than 10.12 are able to install 3.0.
First, update clang to 11 (at least that's what I did):
sudo port install clang-11
port select --set clang mp-clang-11
Then, try to install ruby30; when it crashes do the following as superuser (if necessary):
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_ruby30/ruby30/work/ruby-3.0.0
./configure --prefix=/opt/local --enable-shared --enable-install-static-library --disable-install-doc --mandir=/opt/local/share/man --enable-pthread --without-gmp --with-opt-dir=/opt/local --program-suffix=3.0 --with-rubylibprefix=/opt/local/lib/ruby3.0 --without-baseruby --with-arch=x86_64 CC=/opt/local/bin/clang
make clean
Finally, run sudo port install ruby30
again.
This forces the port to install with the clang-11 compiler; the magic is the final additional option.
comment:8 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:9 Changed 3 years ago by mascguy (Christopher Nielsen)
My apologies for the delayed permanent fix for this, it's ridiculously trivial: We simply need to blacklist Xcode Clang versions prior to 901.
Fix verified locally, and a commit to follow momentarily.
comment:10 Changed 3 years ago by Christopher Nielsen <mascguy@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
logfile output from ports ("Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_ruby30/ruby30/main.log for details")