Opened 18 months ago

Last modified 5 months ago

#66077 assigned defect

neovim 0.8.0: fails to install on macOS 13.0 arm64

Reported by: assholehoff (Anton Dahlén) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: arm64 Cc: l2dy (Zero King)
Port: neovim

Description

Port seems to build just fine, but fails to install after reaching generating help tags with :info:build dyld[50164]: symbol not found in flat namespace '_luaL_checkversion_' in the log. The compiled binary found in .../work/build/bin fails to load with a similar error message.

Attachments (2)

main.log (1.1 MB) - added by assholehoff (Anton Dahlén) 18 months ago.
main.log.gz (32.0 KB) - added by assholehoff (Anton Dahlén) 18 months ago.

Download all attachments as: .zip

Change History (10)

Changed 18 months ago by assholehoff (Anton Dahlén)

Attachment: main.log added

Changed 18 months ago by assholehoff (Anton Dahlén)

Attachment: main.log.gz added

comment:1 Changed 18 months ago by benoitc (Benoit Chesneau)

same issue there.

comment:2 Changed 18 months ago by hexane360 (Colin Gilgenbach)

I believe the problem is with how MacPorts is installing luarocks, as per: https://github.com/luarocks/luarocks/issues/1209

Modifying the luarocks portgroup to specify --lua-dir and --lua-version seems to fix the issue for me:

--- macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/luarocks-1.0.tcl	2022-01-25 15:12:18
+++ macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/luarocks-1.0.tcl	2022-10-27 17:00:11
@@ -88,7 +88,7 @@
 proc luarocks.setup {module vers {type "src.rock"} {docs {}} {source "custom"} {implementation "luarocks"}} {
     global name subport luarocks.branches luarocks.default_branch luarocks.dependencies
     global destroot prefix distpath distname worksrcpath os.platform
-    global configure.cc configure.cflags configure.ldflags
+    global configure.cc configure.cflags configure.ldflags macosx_deployment_target
     global luarocks.bin luarocks.branch
     global luarocks.suffix luarocks.bindir luarocks.rocksdir
     global luarocks.module luarocks.filename luarocks.distname luarocks.project luarocks.docs
@@ -179,6 +179,7 @@
     destroot.env-append     CC="${configure.cc}"
     destroot.env-append     "CFLAGS=${configure.cflags} [get_canonical_archflags cc]"
     destroot.env-append     "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"
+    destroot.env-append     MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}
 
     # https://github.com/luarocks/luarocks/wiki/Types-of-rocks
     switch -glob ${type} {
@@ -200,7 +201,7 @@
             build {}
 
             destroot.cmd       ${luarocks.bin}
-            destroot.pre_args  --tree ${destroot}${prefix}
+            destroot.pre_args  --lua-dir=${prefix} --lua-version=${luarocks.branch} --tree ${destroot}${prefix}
             destroot.args      make --deps-mode none
             destroot.post_args ${distpath}/${luarocks.distname}.rockspec
 
@@ -230,7 +231,7 @@
             build {}
 
             destroot.cmd       ${luarocks.bin}
-            destroot.pre_args  --tree ${destroot}${prefix}
+            destroot.pre_args  --lua-dir=${prefix} --lua-version=${luarocks.branch} --tree ${destroot}${prefix}
             destroot.args      build --deps-mode none
             destroot.post_args ${worksrcpath}/${luarocks.distname}.src.rock
 
@@ -261,7 +262,7 @@
             build {}
 
             destroot.cmd       ${luarocks.bin}
-            destroot.pre_args  --tree ${destroot}${prefix}
+            destroot.pre_args  --lua-dir=${prefix} --lua-version=${luarocks.branch} --tree ${destroot}${prefix}
             destroot.args      build --deps-mode none
             destroot.post_args ${worksrcpath}/${luarocks.distname}.all.rock

I'm too busy to make a PR right now, but hopefully this works for other people.

comment:3 Changed 18 months ago by elventear (Pepe Barbe)

I have the same error on x86_64 on macOS 13.0. I tried applying the Portgroup suggestion for luarocks, but that did not seem to help with the problem.

comment:4 in reply to:  3 Changed 18 months ago by assholehoff (Anton Dahlén)

Replying to elventear:

I have the same error on x86_64 on macOS 13.0. I tried applying the Portgroup suggestion for luarocks, but that did not seem to help with the problem.

Just to double check; you are getting the same error even after:

  1. uninstalling (or deactivating) lua and luarocks
  2. cleaning any failed build
  3. applying the patch
  4. rebuilding lua and luarocks

My x86-64 laptop is from 2014 so I can't run anything newer than 11 on it, but it worked for me there.

comment:5 Changed 18 months ago by elventear (Pepe Barbe)

Replying to assholehoff:

It was not clear that I had to uninstall other lua packages, so I decided to try and did not work. These are the steps that I followed:

  1. port uninstall lua* (breaking some packages).
  2. port reclaim.
  3. apply patch.
  4. fix broken packages, which installs lua and lua52 back.
  5. port install neovim.

And it failed the same for me.

I was able to install successfully with the following steps:

  1. selfupdate (i.e. no patch)
  2. port uninstall lua* (breaking some packages)
  3. port reclaim
  4. port install neovim
  5. fix broken packages.

Digging a bit deeper about the missing symbol, I think luaL_checkversion was added to Lua in version 5.2, and neovim uses Lua 5.1 and I have not been able to find that function in any of the Lua 5.1 docs. I wonder if the problem is that something is linking against the wrong version of Lua when there are other versions installed.

Last edited 18 months ago by elventear (Pepe Barbe) (previous) (diff)

comment:6 Changed 6 months ago by psifertex (Jordan)

An incorrect dependency seems likely. Doing a fresh install of neovim, I see:

 lua51
 lua51-lpeg
 lua51-mpack
 lua53
 lua53-luarocks

Can't think of a good reason _both_ would be installed as a dependency of neovim.

comment:7 in reply to:  6 Changed 6 months ago by l2dy (Zero King)

Replying to psifertex:

An incorrect dependency seems likely. Doing a fresh install of neovim, I see:

 lua51
 lua51-lpeg
 lua51-mpack
 lua53
 lua53-luarocks

Can't think of a good reason _both_ would be installed as a dependency of neovim.

lua53-luarocks is installed as a build dependency for other Lua ports. It is possible to build ports for other Lua versions with it, but I'm not sure how robust that feature is.

I have updated the luarocks 1.0 port group to explicitly specify --lua-version, but these Lua ports have been updated to use the newer luarocks_org 1.0 port group now, so it does not matter.

nvim does not crash on my macOS 13 device and I don't own an arm64 one, so someone who is able to reproduce the issue has to help.

By the way, I'm accepting sponsorship for a new MacBook for MacPorts development. If anyone is interested, here is the link: https://github.com/sponsors/l2dy

comment:8 Changed 5 months ago by raimue (Rainer Müller)

Keywords: arm64 added
Note: See TracTickets for help on using tickets.