neovim/cmake
Daniel Hahler 8851903434 cmake/LuaHelpers.cmake: check_lua_module: display errors
This helps to figure out what the problem is, e.g. in my case I have
lua51-mpack installed to be used with luajit, but it is broken (missing
libmpack).

With this patch you get:

    -- Checking Lua interpreter /usr/bin/luajit
    /usr/bin/luajit: error loading module 'mpack' from file '/usr/lib/lua/5.1/mpack.so':
            libmpack.so.0: cannot open shared object file: No such file or directory
    stack traceback:
            [C]: at 0x55fcf0166fb0
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: at 0x55fcf01188a0
    -- [/usr/bin/luajit] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.1
    /usr/bin/lua5.1: error loading module 'mpack' from file '/usr/lib/lua/5.1/mpack.so':
            libmpack.so.0: cannot open shared object file: No such file or directory
    stack traceback:
            [C]: ?
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: ?
    -- [/usr/bin/lua5.1] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.2
    /usr/bin/lua5.2: (command line):1: module 'mpack' not found:
            no field package.preload['mpack']
            no file '/usr/share/lua/5.2/mpack.lua'
            no file '/usr/share/lua/5.2/mpack/init.lua'
            no file '/usr/lib/lua/5.2/mpack.lua'
            no file '/usr/lib/lua/5.2/mpack/init.lua'
            no file './mpack.lua'
            no file '/usr/lib/lua/5.2/mpack.so'
            no file '/usr/lib/lua/5.2/loadall.so'
            no file './mpack.so'
    stack traceback:
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: in ?
    -- [/usr/bin/lua5.2] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua
    /usr/bin/lua: (command line):1: module 'mpack' not found:
            no field package.preload['mpack']
            no file '/usr/share/lua/5.3/mpack.lua'
            no file '/usr/share/lua/5.3/mpack/init.lua'
            no file '/usr/lib/lua/5.3/mpack.lua'
            no file '/usr/lib/lua/5.3/mpack/init.lua'
            no file './mpack.lua'
            no file './mpack/init.lua'
            no file '/usr/lib/lua/5.3/mpack.so'
            no file '/usr/lib/lua/5.3/loadall.so'
            no file './mpack.so'
    stack traceback:
            [C]: in function 'require'
            (command line):1: in main chunk
            [C]: in ?
    -- [/usr/bin/lua] The 'mpack' lua package is required for building Neovim
    CMake Error at CMakeLists.txt:459 (message):
      A suitable Lua interpreter was not found.

While this makes it more verbose for the expected error case ("module
'mpack' not found"), the behavior before this patch hides too much.
This is the old output:

    -- Checking Lua interpreter /usr/bin/luajit
    -- [/usr/bin/luajit] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.1
    -- [/usr/bin/lua5.1] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua5.2
    -- [/usr/bin/lua5.2] The 'mpack' lua package is required for building Neovim
    -- Checking Lua interpreter /usr/bin/lua
    -- [/usr/bin/lua] The 'mpack' lua package is required for building Neovim
    CMake Error at CMakeLists.txt:459 (message):
      A suitable Lua interpreter was not found.

This is for when the whole configuration runs (i.e. after `make
distclean`), afterwards only one Lua interpreter gets checked only.
2018-02-22 01:22:19 +01:00
..
ConvertPo.cmake Move po generation from Make to CMake. 2014-07-17 07:16:53 -04:00
Download.cmake cmake: Allow failing to download small suppress files 2017-03-31 16:04:18 +03:00
FindIconv.cmake build: pull iconv detection into its own FindIconv.cmake file 2014-11-08 16:22:35 -05:00
FindJeMalloc.cmake Prefer the static jemalloc library by default on OSX 2017-07-07 14:33:54 -04:00
FindLibIntl.cmake Stub ngettext when libintl isn't available 2017-10-03 14:54:50 -04:00
FindLibTermkey.cmake cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
FindLibUV.cmake build: OpenBSD: libuv does not use KVM, do not link to it. (#6663) 2017-05-03 20:16:06 +02:00
FindLibVterm.cmake cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
FindLua.cmake cmake: Add FindLua.cmake 2017-04-10 23:10:55 +03:00
FindLuaJit.cmake cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
FindMsgpack.cmake cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
FindUnibilium.cmake cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
FindWinpty.cmake win: integrate winpty (WIP) 2017-08-16 09:13:43 +02:00
GenerateHelptags.cmake.in Be more explicit about the lack of X11 integration 2015-11-10 20:10:55 -05:00
GetCompileFlags.cmake cmake/GetCompileFlags: remove duplicate include dirs 2018-02-14 09:57:58 +01:00
GetGitRevisionDescription.cmake CMake: Force use of project directory to look for Git data. 2015-11-01 16:19:52 +01:00
GetGitRevisionDescription.cmake.in version: report commit hash as "build number" in long version string 2014-10-07 10:03:14 +00:00
i386-linux-gnu.toolchain.cmake Travis: Refactor CI files, use container infrastructure. 2015-07-08 07:42:16 -03:00
InstallClintErrors.cmake cmake: Use archive instead of downloading *.json files (#6482) 2017-04-09 03:28:48 +02:00
InstallHelpers.cmake cmake,bsd: Fix mandir to saner defaults. (#7417) 2017-10-21 02:36:26 +02:00
LibFindMacros.cmake add LibFindMacros CMake macro library 2014-02-26 07:08:26 -03:00
LuaHelpers.cmake cmake/LuaHelpers.cmake: check_lua_module: display errors 2018-02-22 01:22:19 +01:00
mingw32-w64-cross-travis.toolchain.cmake Travis: Add Mingw third-party builds 2015-05-15 17:55:02 +03:00
PreventInTreeBuilds.cmake build: prevent in-tree builds for the time being, as it's not supported 2016-10-11 20:20:31 -04:00
RunLuacheck.cmake ci: Also lint lua code in src/nvim/lua 2017-05-25 16:50:06 +03:00
RunMsgfmt.cmake Move po generation from Make to CMake. 2014-07-17 07:16:53 -04:00
RunMsgmerge.cmake Move po generation from Make to CMake. 2014-07-17 07:16:53 -04:00
RunTests.cmake busted: explicit LUA_PATH to test scripts (#7864) 2018-01-20 14:43:16 +01:00
RunXgettext.cmake Move po generation from Make to CMake. 2014-07-17 07:16:53 -04:00
WindowsDllCopy.cmake MSVC: Build third-party dependencies as release DLLs 2016-08-07 21:57:28 +01:00