Merge PR #1185 'Some fixes and missing changes'

This commit is contained in:
Thiago de Arruda
2014-09-16 14:58:05 -03:00
5 changed files with 25 additions and 22 deletions

View File

@@ -94,7 +94,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Find Lua interpreter
include(LuaHelpers)
set(LUA_DEPENDENCIES lpeg cmsgpack bit)
set(LUA_DEPENDENCIES lpeg MessagePack bit)
if(NOT LUA_PRG)
foreach(CURRENT_LUA_PRG luajit lua)
# If LUA_PRG is set find_program() will not search

View File

@@ -29,9 +29,8 @@ endif
" Execute python, import neovim and print a string. If import_result matches
" the printed string, we can probably start the host
let s:import_result = substitute(system(
\ s:python_interpreter .' -c "import neovim; print \"ok\""'),
\ '^[\s\n]*\(ok\)[\s\n]*$', '\1', '')
let s:import_result = system(s:python_interpreter .
\ ' -c "import neovim, sys; sys.stdout.write(\"ok\")"')
if s:import_result != 'ok'
finish
endif

View File

@@ -1,5 +1,5 @@
lpeg = require('lpeg')
msgpack = require('cmsgpack')
msgpack = require('MessagePack')
-- lpeg grammar for building api metadata from a set of header files. It
-- ignores comments and preprocessor commands and parses a very small subset
@@ -126,10 +126,12 @@ void msgpack_rpc_init_function_metadata(Dictionary *metadata)
{
msgpack_unpacked unpacked;
msgpack_unpacked_init(&unpacked);
assert(msgpack_unpack_next(&unpacked,
(const char *)msgpack_metadata,
sizeof(msgpack_metadata),
NULL) == MSGPACK_UNPACK_SUCCESS);
if (msgpack_unpack_next(&unpacked,
(const char *)msgpack_metadata,
sizeof(msgpack_metadata),
NULL) != MSGPACK_UNPACK_SUCCESS) {
abort();
}
Object functions;
msgpack_rpc_to_object(&unpacked.data, &functions);
msgpack_unpacked_destroy(&unpacked);

View File

@@ -353,7 +353,8 @@ static void parse_msgpack(RStream *rstream, void *data, bool eof)
msgpack_unpack_return result;
// Deserialize everything we can.
while ((result = msgpack_unpacker_next(channel->unpacker, &unpacked))) {
while ((result = msgpack_unpacker_next(channel->unpacker, &unpacked)) ==
MSGPACK_UNPACK_SUCCESS) {
if (kv_size(channel->call_stack) && is_rpc_response(&unpacked.data)) {
if (is_valid_rpc_response(&unpacked.data, channel)) {
call_stack_pop(&unpacked.data, channel);

View File

@@ -50,8 +50,8 @@ include(ExternalProject)
set(LIBUV_URL https://github.com/joyent/libuv/archive/v0.11.28.tar.gz)
set(LIBUV_MD5 1a849ba4fc571d531482ed74bc7aabc4)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/0335df55e1a408c0d56d43e46253c952fb8a7f04.tar.gz)
set(MSGPACK_MD5 4c18a1625b586c0d69a0e955ce9a187f)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/ecf4b09acd29746829b6a02939db91dfdec635b4.tar.gz)
set(MSGPACK_MD5 3599eaf904b8ba0c36cea7ed80973364)
set(LUAJIT_URL http://luajit.org/download/LuaJIT-2.0.3.tar.gz)
set(LUAJIT_MD5 f14e9104be513913810cd59c8c658dc0)
@@ -166,25 +166,26 @@ if(USE_BUNDLED_LUAROCKS)
add_custom_target(busted
DEPENDS ${DEPS_BIN_DIR}/busted)
# lua-cmsgpack doesn't depend on busted, but luarocks is unhappy to have two
# instances running in parallel. So we depend on busted to force it
# to be serialized.
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lua-cmsgpack
# lua-messagepack doesn't depend on busted, but luarocks is unhappy to have
# two instances running in parallel. So we depend on busted to force it to
# be serialized.
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lua-messagepack
COMMAND ${DEPS_BIN_DIR}/luarocks
ARGS build lua-cmsgpack CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
ARGS build lua-messagepack CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
DEPENDS busted)
add_custom_target(lua-cmsgpack
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lua-cmsgpack)
add_custom_target(lua-messagepack
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lua-messagepack)
# Like before, depend on cmsgpack to ensure serialization of install commands
# Like before, depend on lua-messagepack to ensure serialization of install
# commands
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lpeg
COMMAND ${DEPS_BIN_DIR}/luarocks
ARGS build lpeg CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
DEPENDS lua-cmsgpack)
DEPENDS lua-messagepack)
add_custom_target(lpeg
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lpeg)
list(APPEND THIRD_PARTY_DEPS busted lua-cmsgpack lpeg)
list(APPEND THIRD_PARTY_DEPS busted lua-messagepack lpeg)
endif()
add_custom_target(third-party ALL