Opened 3 years ago

Closed 22 months ago

#64288 closed defect (fixed)

MacVim @8.2.snapshot171_2+huge: broken, no suitable image found: libintl.8.dylib: mach-o, but wrong architecture

Reported by: neirbowj (John W. O'Brien) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: bigsur arm64 Cc:
Port: MacVim

Description

On a new MacBook Air (M1, 2020), with Big Sur (11.6.2), and MacPorts 2.7.1, installing MacVim with the default variants consistently results in

--->  Scanning binaries for linking errors
--->  Found 1 broken file, matching files to ports
--->  Found 1 broken port, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: MacVim @8.2.snapshot171+huge
Continue? [Y/n]:

Rebuilding, shows,

Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  statacl: found in macvim-dev-macvim-e65c14c/src/auto/config.log
  acl: found in macvim-dev-macvim-e65c14c/src/auto/config.log
--->  Building MacVim
Error: Failed to build MacVim: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_MacVim/MacVim/main.log for details.
Error: rev-upgrade failed: Error rebuilding MacVim
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a
bug.

Running from the command line reports,

$ mvim
dyld: Library not loaded: /opt/local/lib/libintl.8.dylib
  Referenced from: /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim
  Reason: no suitable image found.  Did find:
	/opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture
	/opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture

Attachments (1)

main.log (170.4 KB) - added by neirbowj (John W. O'Brien) 3 years ago.
MacVim main build log

Download all attachments as: .zip

Change History (13)

comment:1 Changed 3 years ago by neirbowj (John W. O'Brien)

Log available upon request. My best guess is that this is a consequence of the arch restriction.

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

MacPorts supports such architecture restrictions.

For what architectures does MacPorts believe it has installed those files?

port -v installed MacVim libintl

For what architectures are they actually installed?

lipo -info /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim /opt/local/lib/libintl.8.dylib

And of course we will need to see the main.log file to see what failed.

comment:3 Changed 3 years ago by neirbowj (John W. O'Brien)

$ port contents gettext-runtime | grep libintl.8
  /opt/local/lib/libintl.8.dylib
$ port -v installed MacVim gettext-runtime
The following ports are currently installed:
  gettext-runtime @0.21_0 (active) requested_variants='' platform='darwin 20' archs='arm64' date='2021-12-21T11:12:17-0500'
  MacVim @8.2.snapshot171_2+huge (active) requested_variants='' platform='darwin 20' archs='x86_64' date='2021-12-24T18:44:43-0500'
$ lipo -info /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim /opt/local/lib/libintl.8.dylib
Non-fat file: /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim is architecture: x86_64
Non-fat file: /opt/local/lib/libintl.8.dylib is architecture: arm64

Changed 3 years ago by neirbowj (John W. O'Brien)

Attachment: main.log added

MacVim main build log

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Oops, yes of course gettext-runtime provides libintl.dylib.

So the problem is that gettext-runtime has not been installed with the universal variant. MacPorts should have arranged for that to happen when you installed MacVim, since MacVim doesn't support arm64. Please try:

sudo port install gettext-runtime +universal

The log shows errors coming from things installed by Xcode. Maybe try reinstalling Xcode and the Xcode command line tools, making sure to use the same version of each, and that is compatible with Big Sur.

comment:5 Changed 3 years ago by neirbowj (John W. O'Brien)

Maybe try reinstalling Xcode and the Xcode command line tools, making sure to use the same version of each, and that is compatible with Big Sur.

This is a brand new machine as of 12/20 and I installed Xcode and the command line tools according to the MacPorts documentation on 12/21.

I will try installing the universal variant of gettext-runtime and report back.

Is there any forecast available for when MacVim will add support for arm64?

comment:6 Changed 3 years ago by neirbowj (John W. O'Brien)

$ port -v installed MacVim gettext-runtime
The following ports are currently installed:
  gettext-runtime @0.21_0+universal (active) requested_variants='+universal' platform='darwin 20' archs='arm64 x86_64' date='2021-12-25T10:53:47-0500'
  MacVim @8.2.snapshot171_2+huge (active) requested_variants='' platform='darwin 20' archs='x86_64' date='2021-12-24T18:44:43-0500'
$ lipo -info /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim /opt/local/lib/libintl.8.dylib
Architectures in the fat file: /opt/local/lib/libintl.8.dylib are: x86_64 arm64
Non-fat file: /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim is architecture: x86_64 

mvim runs successfully now. Thank you for the tips.

comment:7 in reply to:  5 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to neirbowj:

Maybe try reinstalling Xcode and the Xcode command line tools, making sure to use the same version of each, and that is compatible with Big Sur.

This is a brand new machine as of 12/20 and I installed Xcode and the command line tools according to the MacPorts documentation on 12/21.

I see. Did you open Xcode once and agree to install the additional components? If not, do that.

I will try installing the universal variant of gettext-runtime and report back.

I think I see why it didn't happen automatically and will file a ticket once I've confirmed it.

Is there any forecast available for when MacVim will add support for arm64?

I'll have to leave that question to Rainer.

comment:8 Changed 3 years ago by neirbowj (John W. O'Brien)

Did you open Xcode once and agree to install the additional components? If not, do that.

I thought I had, but when I opened Xcode just now it prompted me to do that. So I did.

comment:9 in reply to:  8 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

I think I see why it didn't happen automatically and will file a ticket once I've confirmed it.

That's now #64291.

Replying to neirbowj:

Did you open Xcode once and agree to install the additional components? If not, do that.

I thought I had, but when I opened Xcode just now it prompted me to do that. So I did.

Ok great. I think that's the cause of some if not all of the errors you saw in the build. You could try a rebuild and see if it succeeds:

sudo port clean MacVim
sudo port -ns upgrade --force MacVim

If it does, then you're all set and hopefully any future port builds will work fine too.

comment:10 Changed 3 years ago by neirbowj (John W. O'Brien)

sudo port clean MacVim
sudo port -ns upgrade --force MacVim

Those commands completed successfully. I gather I was only testing from-source builds, and not whether MacVim would pull in gettext-runtime+universal (per #64291).

FWIW, I have 38 requested ports and 427 total ports installed from before installing "additional components", and MacVim was the first that had any trouble. Presumably that would be explained if none of the others required compilation from source. Is that right?

comment:11 Changed 2 years ago by neirbowj (John W. O'Brien)

I can confirm that this problem is still reproducible on a new Apple M1 Max device, with Monterey (12.4), and MacPorts 2.7.2. The workaround suggested in comment:4 is still effective.

sudo port install gettext-runtime +universal

comment:12 Changed 22 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

things work correctly now. MacVim has been updated:

% port -v installed macvim
The following ports are currently installed:
  MacVim @9.0.release174_0+huge (active) requested_variants='' platform='darwin 22' archs='arm64' date='2023-01-09T08:24:10-0800'

This file is arm64, not x86_64 on an M1 Mac:

% file /Applications/MacPorts/MacVim.app/Contents/MacOS/Vim
/Applications/MacPorts/MacVim.app/Contents/MacOS/Vim: Mach-O 64-bit executable arm64

and there are no gettext link errors.

Note: See TracTickets for help on using tickets.