tarantool / memcached

Memcached protocol 'wrapper' for tarantool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace libmemcached GIT submodule with OS package libmemcached

ligurio opened this issue · comments

memcached has a GIT submodule libmemcached, it is used for building three tools for testing: memccapable, memcslap and memccapable (cmake/BuildLibmemcached.cmake):

macro   (libmemcached_build)
    set(libmemcached_src ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libmemcached)
    add_custom_target(libmemcached_cfg ./bootstrap.sh autoreconf
        COMMAND ./configure --enable-jobserver=no --enable-memaslap
                --enable-static --enable-shared=off
        WORKING_DIRECTORY ${libmemcached_src}
    )
    add_custom_target(libmemcached_make
        COMMAND make libmemcached/csl/parser.h clients/memcapable
                        clients/memslap clients/memaslap
        DEPENDS libmemcached_cfg
        WORKING_DIRECTORY ${libmemcached_src}
    )
    add_custom_target(libmemcached_copy
        COMMAND ${CMAKE_COMMAND} -E copy ${libmemcached_src}/clients/memcapable
                                 ${CMAKE_CURRENT_BINARY_DIR}/test/capable/memcapable
        COMMAND ${CMAKE_COMMAND} -E copy ${libmemcached_src}/clients/memaslap
                                 ${CMAKE_CURRENT_BINARY_DIR}/test/bench/memaslap
        COMMAND ${CMAKE_COMMAND} -E copy ${libmemcached_src}/clients/memslap
                                 ${CMAKE_CURRENT_BINARY_DIR}/test/bench/memslap
        DEPENDS libmemcached_make
    )
    add_custom_target(libmemcached DEPENDS libmemcached_copy)
endmacro(libmemcached_build)

We same we can do with binary package libmemcached-tools. It is available at least on Ubuntu - https://packages.ubuntu.com/focal/libmemcached-tools:

sergeyb@pony:~/sources/MRG/memcached$ dpkg -L libmemcached-tools                
/.                                
/usr                              
/usr/bin                          
/usr/bin/memccapable             
/usr/bin/memccat               
/usr/bin/memccp                  
/usr/bin/memcdump                
/usr/bin/memcerror                
/usr/bin/memcexist                                                             
/usr/bin/memcflush                                                             
/usr/bin/memcparse                                                             
/usr/bin/memcping                     
/usr/bin/memcrm
/usr/bin/memcslap
/usr/bin/memcstat
/usr/bin/memctouch
...

The libmemcached library will be only testing dependency, so a rock itself will not depend on it, correct?

The libmemcached library will be only testing dependency, so a rock itself will not depend on it, correct?

Seems memcached build was never depend on libmemcached.

libmemcached-devel used by memtier (benchmark)

For unknown reasons, memaslap benchmark is not available in binary package for Ubuntu, but memcslap is there.

According to documentation (http://docs.libmemcached.org/bin/memaslap.html and http://docs.libmemcached.org/bin/memslap.html) memaslap looks more powerfull than memslap. If we want to use memaslap to testing (#89) we cannot replace libmemcached to binary package.

Let's compare cons and pros so.

Keep the submodule:

  • Pro: ability to enable all provided benchmarks.
  • Pro: don't depend on any OS specific peculiars.
  • Con: we need to support git mirror for the upstream bazaar repository (and sometimes stitch history parts using git filter-branch or git replace — rewrite a hash of parent commit).

Use the package:

  • Con: not all benchmarks (at least on Ubuntu).
  • Con: may be OS specific problems.
  • Pro: we don't need to support the mirror.

For me it seems that supporting of our mirror is not so hard work (and quite rare), so gains of the submodule overweight.

What do you think?

Pro: don't depend on any OS specific peculiars.

This can be achieved not only by using git submodule but, for example, by using Dockerfile that builds a single binary required by test.

Pro: ability to enable all provided benchmarks.

I'm not sure that we need two benchmarks for memcached. Probably one of them would be enough for our small needs.