[Tarantool-patches] [PATCH 2/2] msgpack: fix wrong mp_ext type in error message

Sergey Kaplun skaplun at tarantool.org
Wed Jul 15 18:21:36 MSK 2020


On 15.07.20, Sergey Kaplun wrote:
> Hi Igor! Thanks for the review!

<snipped>

> > > +target_link_libraries(mplua.test unit box server core
> > > +    ${CURL_LIBRARIES} ${LIBYAML_LIBRARIES} ${READLINE_LIBRARIES}
> > > +    ${ICU_LIBRARIES} ${LUAJIT_LIBRARIES})
> > 
> > Why should this be done in such complex way? Do your test binary need
> > *all* mentioned libs? I see no usage for libcurl, libreadline, libicu,
> > libyaml in the test. Furthermore, IIRC LuaJIT symbols are provided by
> > libserver archive.
> 
> When I had tried to build my test I found out that lua/msgpack.c requires build
> with tarantool_lua_ibuf (from lua/utils.c).
> 
> | /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
> | CMakeFiles/mplua.test.dir/__/__/src/lua/msgpack.c.o: in function
> | `lua_msgpack_encode': msgpack.c:(.text+0x1673): undefined reference to
> | `tarantool_lua_ibuf'
> 
> Building utils requires build with httpc_lua (from lua/httpc.c). And it
> requires curl library.
> 
> | /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
> | CMakeFiles/mplua.test.dir/__/__/src/lua/init.c.o:(.data.rel+0x1b8): undefined
> | reference to `httpc_lua'
> 
> And so on. I suppose that building with libserver and its linkage with
> necessary libraries would be less bulky than list all necessary sources
> inside add_executable. It would be nice if you will offer a prettier
> approach.
> 
> Unfortunately libserver doesn't provides necessary symbols, but requires it to
> be built.
> | nm -g src/libserver.a | grep lua_type | sort | uniq
> |                  U lua_type
> |                  U lua_typename
> 
> > 
> > Well, I faced the following linkage error when the test is build in
> > Release mode:
> > | [ 87%] Linking CXX executable mplua.test
> > | /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../src/libcore.a(evio.cc.o): in function `evio_service_bind(evio_service*, char const*)':
> > | evio.cc:(.text+0x9e2): undefined reference to `uri_parse'
> > | collect2: error: ld returned 1 exit status
> 
> Hmm, I build successfully with Debug/RelWithDebInfo/Release mode
> locally. How did you get this error? Did you build from my branch or
> applied diff to master?

I can offer something like that:

| target_link_libraries(mplua.test server box core unit)

> > > diff --git a/test/unit/mplua.c b/test/unit/mplua.c

<snipped>

> 
> [1]: https://github.com/tarantool/tarantool/issues/5017
> [2]: https://github.com/msgpack/msgpack/blob/master/spec.md#ext-format-family
> 
> -- 
> Best regards,
> Sergey Kaplun

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list