Opened 2 years ago

Closed 2 months ago

#66077 closed defect (fixed)

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) 2 years ago.
main.log.gz (32.0 KB) - added by assholehoff (Anton Dahlén) 2 years ago.

Download all attachments as: .zip

Change History (13)

Changed 2 years ago by assholehoff (Anton Dahlén)

Attachment: main.log added

Changed 2 years ago by assholehoff (Anton Dahlén)

Attachment: main.log.gz added

comment:1 Changed 2 years ago by benoitc (Benoit Chesneau)

same issue there.

comment:2 Changed 2 years 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 2 years 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 2 years 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 2 years 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 2 years ago by elventear (Pepe Barbe) (previous) (diff)

comment:6 Changed 12 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 12 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.

Last edited 2 months ago by l2dy (Zero King) (previous) (diff)

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

Keywords: arm64 added

comment:9 in reply to:  7 Changed 2 months ago by wryfi

Replying to l2dy:

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.

I don't understand why lua-5.3 is being installed as a dependency of lua-5.1 ports. That just doesn't make any sense. Something is fishy about this. See my comment in #70420.

I confirm that nothing seems to be using the luarocks 1.0 port group any more, so the originally proposed fix here is no longer relevant.

The luarocks_org 1.0 port group does depend on the luarocks 1.1 port group though, so maybe a fix is needed there? It does seem to have a --lua-version argument in build.pre_args and destroot.pre_args, but not a --lua-dir argument.

Last edited 2 months ago by wryfi (previous) (diff)

comment:10 Changed 2 months ago by wryfi

Incidentally, for anyone following along here, as described in #70420, after uninstalling lua53-luarocks and lua53 (and ignoring the warnings about breaking lua-luarocks) neovim built for me. If you actually use lua-5.3 for something though, this will obviously not work for you.

Last edited 2 months ago by wryfi (previous) (diff)

comment:11 Changed 2 months ago by Chris Haumesser <5400416-wryfi@…>

Resolution: fixed
Status: assignedclosed

In 391c7804e8d2a5f359d9108d95bcdc304d1b9d62/macports-ports (master):

neovim: include lua51 headers to build properly

fixes #70420
fixes #66077

Note: See TracTickets for help on using tickets.