Skip to content

Instantly share code, notes, and snippets.

@equalsraf
Last active October 27, 2017 17:19
Show Gist options
  • Save equalsraf/6921ad7f69d43631d90bb0a675415edf to your computer and use it in GitHub Desktop.
Save equalsraf/6921ad7f69d43631d90bb0a675415edf to your computer and use it in GitHub Desktop.
some issues building neovim in openbsd 6.2

cmake fails to find a usable lua

... even if packages for lua and all deps(mpack, bitop, lpeg) are installed. This seems to be a problem with the lua binary name in OpenBSD its called lua51, lua52, luajit51 - instead of the expected lua5.1 or just lua.

The workaround for this is to specify the binary

cmake -DLUA_PRG=/usr/local/bin/lua51 ..

linkage fails against luajit

If nvim finds luajit it will try to link against libluajit. This fails with various undefined symbols, e.g. _Unwind_SetGR.

Work around is using regular lua

cmake -DPREFER_LUA=1 ..

third-party fails to build luajit

I have no workaround for this other than using the openbsd package.

  • check openbsd pkg recipes for what link flags we are probably missing

third-party fails to build luarocks

The luarocks configure script fails to find lua/luajit.

[ 45%] Performing configure step for 'luarocks'                                                                                                                               
cd /home/raf/Code/neovim/.deps/build/src/luarocks && /home/raf/Code/neovim/.deps/build/src/luarocks/configure --prefix=/usr/local --lua-suffix=jit                            
$PATH interpreter not found in                                                                                                             
You may want to use the flags --with-lua, --with-lua-bin and/or --lua-suffix. See --help.    

Quick work around for the recipe is

index ef8a8450f..9e3ec0fb8 100644
--- a/third-party/cmake/BuildLuarocks.cmake
+++ b/third-party/cmake/BuildLuarocks.cmake
@@ -61,8 +61,9 @@ if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING))
 
   BuildLuarocks(
     CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
-      --prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}
-      --lua-suffix=jit
+               --with-lua-include=/usr/local/include/lua-5.1
+           --prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}
+         --lua-suffix=51
     INSTALL_COMMAND ${MAKE_PRG} bootstrap)
 elseif(MSVC OR MINGW)

But this probably warrants a patch upstream.

functionaltest tries to use wrong lua lib

[100%] Built target nvim
-- Output to stderr:
/usr/local/bin/luajit51: ...deps/usr/lib/luarocks/rocks/busted/2.0.rc12-1/bin/busted:3: module 'busted.runner' not found:
        no field package.preload['busted.runner']
        no file './busted/runner.lua'
        no file '/usr/local/share/luajit-2.0/busted/runner.lua'
        no file '/usr/local/share/lua/5.1/busted/runner.lua'
        no file '/usr/local/share/lua/5.1/busted/runner/init.lua'
        no file './busted/runner.so'
        no file '/usr/local/lib/lua/5.1/busted/runner.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './busted.so'
        no file '/usr/local/lib/lua/5.1/busted.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        ...deps/usr/lib/luarocks/rocks/busted/2.0.rc12-1/bin/busted:3: in main chunk
        [C]: at 0x182396900b60

More of a config issue. I think I mixed up the lua versions between third-party and the nvim buld.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment