From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C17FA445320 for ; Wed, 15 Jul 2020 18:21:46 +0300 (MSK) Date: Wed, 15 Jul 2020 18:21:36 +0300 From: Sergey Kaplun Message-ID: <20200715152136.GA13607@root> References: <9e6b2ec973a0dd0f2bb6da4915bf1f8f7ff58081.1592235478.git.skaplun@tarantool.org> <20200714154646.GL5559@tarantool.org> <20200715093215.GA947@root> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200715093215.GA947@root> Subject: Re: [Tarantool-patches] [PATCH 2/2] msgpack: fix wrong mp_ext type in error message List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org, Alexander Turenko On 15.07.20, Sergey Kaplun wrote: > Hi Igor! Thanks for the review! > > > +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 > > [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