Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib
@ 2019-02-26 12:11 Vladislav Shpilevoy
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc Vladislav Shpilevoy
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:11 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

The commit messages comprehensively describe the intention of this patchset, so
I will not copypaste it here. Just one sentence: it is needed for SWIM, since
SWIM depends in src/, being itself placed in src/lib/ - it is illegal.

Branch: http://github.com/tarantool/tarantool/tree/gerold103/relocate-core-lib

v1: https://www.freelists.org/post/tarantool-patches/PATCH-02-Move-core-lib-to-srclib

Changes in v2:
- Extracted http_parser and collations into separate libraries.

Vladislav Shpilevoy (4):
  Remove dead dependency of http_parser on httpc
  Move 'http_parser' to src/lib
  Move 'core' and 'uuid' libs to src/lib
  Extract 'coll' library from 'core'

 CMakeLists.txt                          |  1 +
 src/CMakeLists.txt                      | 73 +++----------------------
 src/box/applier.h                       |  2 +-
 src/box/coll_id.c                       |  2 +-
 src/box/coll_id_def.h                   |  2 +-
 src/box/recovery.h                      |  1 -
 src/box/replication.h                   |  2 +-
 src/box/sql/expr.c                      |  2 +-
 src/box/sql/fk_constraint.c             |  2 +-
 src/box/sql/func.c                      |  2 +-
 src/box/sql/select.c                    |  2 +-
 src/box/sql/vdbeaux.c                   |  2 +-
 src/box/sql/where.c                     |  2 +-
 src/box/sql/whereexpr.c                 |  2 +-
 src/box/tuple.c                         |  1 -
 src/box/tuple.h                         |  2 +-
 src/box/tuple_compare.cc                |  2 +-
 src/box/tuple_hash.cc                   |  2 +-
 src/box/xlog.h                          |  2 +-
 src/box/xrow.h                          |  2 +-
 src/lib/CMakeLists.txt                  |  4 ++
 src/lib/coll/CMakeLists.txt             |  2 +
 src/{ => lib/coll}/coll.c               |  0
 src/{ => lib/coll}/coll.h               |  0
 src/{ => lib/coll}/coll_def.c           |  0
 src/{ => lib/coll}/coll_def.h           |  0
 src/lib/core/CMakeLists.txt             | 46 ++++++++++++++++
 src/{ => lib/core}/assoc.c              |  0
 src/{ => lib/core}/assoc.h              |  0
 src/{ => lib/core}/backtrace.cc         |  0
 src/{ => lib/core}/backtrace.h          |  0
 src/{ => lib/core}/cbus.c               |  0
 src/{ => lib/core}/cbus.h               |  0
 src/{ => lib/core}/clock.c              |  0
 src/{ => lib/core}/clock.h              |  0
 src/{ => lib/core}/coio.cc              |  0
 src/{ => lib/core}/coio.h               |  0
 src/{ => lib/core}/coio_buf.cc          |  0
 src/{ => lib/core}/coio_buf.h           |  0
 src/{ => lib/core}/coio_file.c          |  0
 src/{ => lib/core}/coio_file.h          |  0
 src/{ => lib/core}/coio_task.c          |  0
 src/{ => lib/core}/coio_task.h          |  0
 src/{ => lib/core}/diag.c               |  0
 src/{ => lib/core}/diag.h               |  0
 src/{ => lib/core}/errinj.c             |  0
 src/{ => lib/core}/errinj.h             |  0
 src/{ => lib/core}/evio.c               |  0
 src/{ => lib/core}/evio.h               |  0
 src/{ => lib/core}/exception.cc         |  0
 src/{ => lib/core}/exception.h          |  0
 src/{ => lib/core}/fiber.c              |  0
 src/{ => lib/core}/fiber.h              |  0
 src/{ => lib/core}/fiber_channel.c      |  0
 src/{ => lib/core}/fiber_channel.h      |  0
 src/{ => lib/core}/fiber_cond.c         |  0
 src/{ => lib/core}/fiber_cond.h         |  0
 src/{ => lib/core}/fiber_pool.c         |  0
 src/{ => lib/core}/fiber_pool.h         |  0
 src/{ => lib/core}/fio.c                |  0
 src/{ => lib/core}/fio.h                |  0
 src/{ => lib/core}/latch.c              |  0
 src/{ => lib/core}/latch.h              |  0
 src/{ => lib/core}/memory.c             |  0
 src/{ => lib/core}/memory.h             |  0
 src/{ => lib/core}/mpstream.c           |  0
 src/{ => lib/core}/mpstream.h           |  0
 src/{ => lib/core}/port.c               |  0
 src/{ => lib/core}/port.h               |  0
 src/{ => lib/core}/random.c             |  0
 src/{ => lib/core}/random.h             |  0
 src/{ => lib/core}/ratelimit.h          |  0
 src/{ => lib/core}/reflection.c         |  0
 src/{ => lib/core}/reflection.h         |  0
 src/{ => lib/core}/say.c                |  0
 src/{ => lib/core}/say.h                |  0
 src/{ => lib/core}/sio.c                |  0
 src/{ => lib/core}/sio.h                |  0
 src/{ => lib/core}/trigger.cc           |  0
 src/{ => lib/core}/trigger.h            |  0
 src/{ => lib/core}/util.c               |  0
 src/lib/http_parser/CMakeLists.txt      |  1 +
 src/{ => lib/http_parser}/http_parser.c |  1 -
 src/{ => lib/http_parser}/http_parser.h |  0
 src/lib/uuid/CMakeLists.txt             |  2 +
 src/{ => lib/uuid}/tt_uuid.c            |  0
 src/{ => lib/uuid}/tt_uuid.h            |  0
 src/lua/httpc.c                         |  4 +-
 src/lua/utf8.c                          |  2 +-
 src/main.cc                             |  3 +-
 test/unit/CMakeLists.txt                |  6 +-
 test/unit/coll.cpp                      |  4 +-
 test/unit/uuid.c                        |  2 +-
 test/unit/vy_iterators_helper.c         |  2 +-
 test/unit/xrow.cc                       |  2 +-
 95 files changed, 92 insertions(+), 97 deletions(-)
 create mode 100644 src/lib/coll/CMakeLists.txt
 rename src/{ => lib/coll}/coll.c (100%)
 rename src/{ => lib/coll}/coll.h (100%)
 rename src/{ => lib/coll}/coll_def.c (100%)
 rename src/{ => lib/coll}/coll_def.h (100%)
 create mode 100644 src/lib/core/CMakeLists.txt
 rename src/{ => lib/core}/assoc.c (100%)
 rename src/{ => lib/core}/assoc.h (100%)
 rename src/{ => lib/core}/backtrace.cc (100%)
 rename src/{ => lib/core}/backtrace.h (100%)
 rename src/{ => lib/core}/cbus.c (100%)
 rename src/{ => lib/core}/cbus.h (100%)
 rename src/{ => lib/core}/clock.c (100%)
 rename src/{ => lib/core}/clock.h (100%)
 rename src/{ => lib/core}/coio.cc (100%)
 rename src/{ => lib/core}/coio.h (100%)
 rename src/{ => lib/core}/coio_buf.cc (100%)
 rename src/{ => lib/core}/coio_buf.h (100%)
 rename src/{ => lib/core}/coio_file.c (100%)
 rename src/{ => lib/core}/coio_file.h (100%)
 rename src/{ => lib/core}/coio_task.c (100%)
 rename src/{ => lib/core}/coio_task.h (100%)
 rename src/{ => lib/core}/diag.c (100%)
 rename src/{ => lib/core}/diag.h (100%)
 rename src/{ => lib/core}/errinj.c (100%)
 rename src/{ => lib/core}/errinj.h (100%)
 rename src/{ => lib/core}/evio.c (100%)
 rename src/{ => lib/core}/evio.h (100%)
 rename src/{ => lib/core}/exception.cc (100%)
 rename src/{ => lib/core}/exception.h (100%)
 rename src/{ => lib/core}/fiber.c (100%)
 rename src/{ => lib/core}/fiber.h (100%)
 rename src/{ => lib/core}/fiber_channel.c (100%)
 rename src/{ => lib/core}/fiber_channel.h (100%)
 rename src/{ => lib/core}/fiber_cond.c (100%)
 rename src/{ => lib/core}/fiber_cond.h (100%)
 rename src/{ => lib/core}/fiber_pool.c (100%)
 rename src/{ => lib/core}/fiber_pool.h (100%)
 rename src/{ => lib/core}/fio.c (100%)
 rename src/{ => lib/core}/fio.h (100%)
 rename src/{ => lib/core}/latch.c (100%)
 rename src/{ => lib/core}/latch.h (100%)
 rename src/{ => lib/core}/memory.c (100%)
 rename src/{ => lib/core}/memory.h (100%)
 rename src/{ => lib/core}/mpstream.c (100%)
 rename src/{ => lib/core}/mpstream.h (100%)
 rename src/{ => lib/core}/port.c (100%)
 rename src/{ => lib/core}/port.h (100%)
 rename src/{ => lib/core}/random.c (100%)
 rename src/{ => lib/core}/random.h (100%)
 rename src/{ => lib/core}/ratelimit.h (100%)
 rename src/{ => lib/core}/reflection.c (100%)
 rename src/{ => lib/core}/reflection.h (100%)
 rename src/{ => lib/core}/say.c (100%)
 rename src/{ => lib/core}/say.h (100%)
 rename src/{ => lib/core}/sio.c (100%)
 rename src/{ => lib/core}/sio.h (100%)
 rename src/{ => lib/core}/trigger.cc (100%)
 rename src/{ => lib/core}/trigger.h (100%)
 rename src/{ => lib/core}/util.c (100%)
 create mode 100644 src/lib/http_parser/CMakeLists.txt
 rename src/{ => lib/http_parser}/http_parser.c (99%)
 rename src/{ => lib/http_parser}/http_parser.h (100%)
 create mode 100644 src/lib/uuid/CMakeLists.txt
 rename src/{ => lib/uuid}/tt_uuid.c (100%)
 rename src/{ => lib/uuid}/tt_uuid.h (100%)

-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc
  2019-02-26 12:11 [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib Vladislav Shpilevoy
@ 2019-02-26 12:11 ` Vladislav Shpilevoy
  2019-02-26 12:12   ` [tarantool-patches] " Vladislav Shpilevoy
  2019-02-26 12:21   ` Konstantin Osipov
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 2/4] Move 'http_parser' to src/lib Vladislav Shpilevoy
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:11 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

Http_parser is a standalone library, which in fact does not
require httpc. And because of that it is going to be moved into
lib/http_parser.
---
 src/http_parser.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/http_parser.c b/src/http_parser.c
index d485f5b44..e70f96164 100644
--- a/src/http_parser.c
+++ b/src/http_parser.c
@@ -30,7 +30,6 @@
  */
 
 #include <string.h>
-#include "httpc.h"
 #include "http_parser.h"
 
 #define LF     (unsigned char) '\n'
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] [PATCH v2 2/4] Move 'http_parser' to src/lib
  2019-02-26 12:11 [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib Vladislav Shpilevoy
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc Vladislav Shpilevoy
@ 2019-02-26 12:11 ` Vladislav Shpilevoy
  2019-02-26 12:21   ` [tarantool-patches] " Konstantin Osipov
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 3/4] Move 'core' and 'uuid' libs " Vladislav Shpilevoy
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:11 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

Http_parser in fact does not depend on anything, even on the core.
As a rule, such basic libraries are stored in src/lib.

The patch is not necessary for anything, but it is a right thing
to do, while some activity is happening there.
---
 src/CMakeLists.txt                      | 3 +--
 src/lib/CMakeLists.txt                  | 1 +
 src/lib/http_parser/CMakeLists.txt      | 1 +
 src/{ => lib/http_parser}/http_parser.c | 0
 src/{ => lib/http_parser}/http_parser.h | 0
 src/lua/httpc.c                         | 2 +-
 6 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 src/lib/http_parser/CMakeLists.txt
 rename src/{ => lib/http_parser}/http_parser.c (100%)
 rename src/{ => lib/http_parser}/http_parser.h (100%)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1abde73b3..3d8d6413c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -100,7 +100,6 @@ set (core_sources
      util.c
      random.c
      trigger.cc
-     http_parser.c
      coll.c
      coll_def.c
      mpstream.c
@@ -219,7 +218,7 @@ endif()
 
 set_source_files_compile_flags(${server_sources})
 add_library(server STATIC ${server_sources})
-target_link_libraries(server core bit uri uuid ${ICU_LIBRARIES})
+target_link_libraries(server core http_parser bit uri uuid ${ICU_LIBRARIES})
 
 # Rule of thumb: if exporting a symbol from a static library, list the
 # library here.
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index e06934486..e06d35bf0 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -6,6 +6,7 @@ add_subdirectory(salad)
 add_subdirectory(csv)
 add_subdirectory(json)
 add_subdirectory(uri)
+add_subdirectory(http_parser)
 if(ENABLE_BUNDLED_MSGPUCK)
     add_subdirectory(msgpuck EXCLUDE_FROM_ALL)
 endif()
diff --git a/src/lib/http_parser/CMakeLists.txt b/src/lib/http_parser/CMakeLists.txt
new file mode 100644
index 000000000..a48f83cb6
--- /dev/null
+++ b/src/lib/http_parser/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(http_parser STATIC http_parser.c)
diff --git a/src/http_parser.c b/src/lib/http_parser/http_parser.c
similarity index 100%
rename from src/http_parser.c
rename to src/lib/http_parser/http_parser.c
diff --git a/src/http_parser.h b/src/lib/http_parser/http_parser.h
similarity index 100%
rename from src/http_parser.h
rename to src/lib/http_parser/http_parser.h
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index d31e664d6..976b2d4cf 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -34,7 +34,7 @@
  */
 #define DRIVER_LUA_UDATA_NAME	"httpc"
 
-#include <http_parser.h>
+#include "http_parser/http_parser.h"
 #include "src/httpc.h"
 #include "say.h"
 #include "lua/utils.h"
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] [PATCH v2 3/4] Move 'core' and 'uuid' libs to src/lib
  2019-02-26 12:11 [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib Vladislav Shpilevoy
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc Vladislav Shpilevoy
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 2/4] Move 'http_parser' to src/lib Vladislav Shpilevoy
@ 2019-02-26 12:11 ` Vladislav Shpilevoy
  2019-02-26 12:22   ` [tarantool-patches] " Konstantin Osipov
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 4/4] Extract 'coll' library from 'core' Vladislav Shpilevoy
  2019-02-26 16:55 ` [tarantool-patches] [PATCH 1/1] Move 'info' library to src/lib Vladislav Shpilevoy
  4 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:11 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

For the same reason why 'uri' was moved to src/lib - SWIM needs
core and uuid, and SWIM will live in src/lib.

This commit follows 'uri' relocation as a separate one because
'uri' relocation required some changes in the files, moved by
this commit.

Needed for #3234
---
 CMakeLists.txt                     |  1 +
 src/CMakeLists.txt                 | 70 +++---------------------------
 src/box/applier.h                  |  2 +-
 src/box/recovery.h                 |  1 -
 src/box/replication.h              |  2 +-
 src/box/tuple.c                    |  1 -
 src/box/tuple.h                    |  2 +-
 src/box/xlog.h                     |  2 +-
 src/box/xrow.h                     |  2 +-
 src/lib/CMakeLists.txt             |  2 +
 src/lib/core/CMakeLists.txt        | 48 ++++++++++++++++++++
 src/{ => lib/core}/assoc.c         |  0
 src/{ => lib/core}/assoc.h         |  0
 src/{ => lib/core}/backtrace.cc    |  0
 src/{ => lib/core}/backtrace.h     |  0
 src/{ => lib/core}/cbus.c          |  0
 src/{ => lib/core}/cbus.h          |  0
 src/{ => lib/core}/clock.c         |  0
 src/{ => lib/core}/clock.h         |  0
 src/{ => lib/core}/coio.cc         |  0
 src/{ => lib/core}/coio.h          |  0
 src/{ => lib/core}/coio_buf.cc     |  0
 src/{ => lib/core}/coio_buf.h      |  0
 src/{ => lib/core}/coio_file.c     |  0
 src/{ => lib/core}/coio_file.h     |  0
 src/{ => lib/core}/coio_task.c     |  0
 src/{ => lib/core}/coio_task.h     |  0
 src/{ => lib/core}/coll.c          |  0
 src/{ => lib/core}/coll.h          |  0
 src/{ => lib/core}/coll_def.c      |  0
 src/{ => lib/core}/coll_def.h      |  0
 src/{ => lib/core}/diag.c          |  0
 src/{ => lib/core}/diag.h          |  0
 src/{ => lib/core}/errinj.c        |  0
 src/{ => lib/core}/errinj.h        |  0
 src/{ => lib/core}/evio.c          |  0
 src/{ => lib/core}/evio.h          |  0
 src/{ => lib/core}/exception.cc    |  0
 src/{ => lib/core}/exception.h     |  0
 src/{ => lib/core}/fiber.c         |  0
 src/{ => lib/core}/fiber.h         |  0
 src/{ => lib/core}/fiber_channel.c |  0
 src/{ => lib/core}/fiber_channel.h |  0
 src/{ => lib/core}/fiber_cond.c    |  0
 src/{ => lib/core}/fiber_cond.h    |  0
 src/{ => lib/core}/fiber_pool.c    |  0
 src/{ => lib/core}/fiber_pool.h    |  0
 src/{ => lib/core}/fio.c           |  0
 src/{ => lib/core}/fio.h           |  0
 src/{ => lib/core}/latch.c         |  0
 src/{ => lib/core}/latch.h         |  0
 src/{ => lib/core}/memory.c        |  0
 src/{ => lib/core}/memory.h        |  0
 src/{ => lib/core}/mpstream.c      |  0
 src/{ => lib/core}/mpstream.h      |  0
 src/{ => lib/core}/port.c          |  0
 src/{ => lib/core}/port.h          |  0
 src/{ => lib/core}/random.c        |  0
 src/{ => lib/core}/random.h        |  0
 src/{ => lib/core}/ratelimit.h     |  0
 src/{ => lib/core}/reflection.c    |  0
 src/{ => lib/core}/reflection.h    |  0
 src/{ => lib/core}/say.c           |  0
 src/{ => lib/core}/say.h           |  0
 src/{ => lib/core}/sio.c           |  0
 src/{ => lib/core}/sio.h           |  0
 src/{ => lib/core}/trigger.cc      |  0
 src/{ => lib/core}/trigger.h       |  0
 src/{ => lib/core}/util.c          |  0
 src/lib/uuid/CMakeLists.txt        |  2 +
 src/{ => lib/uuid}/tt_uuid.c       |  0
 src/{ => lib/uuid}/tt_uuid.h       |  0
 src/lua/httpc.c                    |  2 +-
 src/main.cc                        |  1 -
 test/unit/CMakeLists.txt           |  4 +-
 test/unit/uuid.c                   |  2 +-
 test/unit/vy_iterators_helper.c    |  2 +-
 test/unit/xrow.cc                  |  2 +-
 78 files changed, 71 insertions(+), 77 deletions(-)
 create mode 100644 src/lib/core/CMakeLists.txt
 rename src/{ => lib/core}/assoc.c (100%)
 rename src/{ => lib/core}/assoc.h (100%)
 rename src/{ => lib/core}/backtrace.cc (100%)
 rename src/{ => lib/core}/backtrace.h (100%)
 rename src/{ => lib/core}/cbus.c (100%)
 rename src/{ => lib/core}/cbus.h (100%)
 rename src/{ => lib/core}/clock.c (100%)
 rename src/{ => lib/core}/clock.h (100%)
 rename src/{ => lib/core}/coio.cc (100%)
 rename src/{ => lib/core}/coio.h (100%)
 rename src/{ => lib/core}/coio_buf.cc (100%)
 rename src/{ => lib/core}/coio_buf.h (100%)
 rename src/{ => lib/core}/coio_file.c (100%)
 rename src/{ => lib/core}/coio_file.h (100%)
 rename src/{ => lib/core}/coio_task.c (100%)
 rename src/{ => lib/core}/coio_task.h (100%)
 rename src/{ => lib/core}/coll.c (100%)
 rename src/{ => lib/core}/coll.h (100%)
 rename src/{ => lib/core}/coll_def.c (100%)
 rename src/{ => lib/core}/coll_def.h (100%)
 rename src/{ => lib/core}/diag.c (100%)
 rename src/{ => lib/core}/diag.h (100%)
 rename src/{ => lib/core}/errinj.c (100%)
 rename src/{ => lib/core}/errinj.h (100%)
 rename src/{ => lib/core}/evio.c (100%)
 rename src/{ => lib/core}/evio.h (100%)
 rename src/{ => lib/core}/exception.cc (100%)
 rename src/{ => lib/core}/exception.h (100%)
 rename src/{ => lib/core}/fiber.c (100%)
 rename src/{ => lib/core}/fiber.h (100%)
 rename src/{ => lib/core}/fiber_channel.c (100%)
 rename src/{ => lib/core}/fiber_channel.h (100%)
 rename src/{ => lib/core}/fiber_cond.c (100%)
 rename src/{ => lib/core}/fiber_cond.h (100%)
 rename src/{ => lib/core}/fiber_pool.c (100%)
 rename src/{ => lib/core}/fiber_pool.h (100%)
 rename src/{ => lib/core}/fio.c (100%)
 rename src/{ => lib/core}/fio.h (100%)
 rename src/{ => lib/core}/latch.c (100%)
 rename src/{ => lib/core}/latch.h (100%)
 rename src/{ => lib/core}/memory.c (100%)
 rename src/{ => lib/core}/memory.h (100%)
 rename src/{ => lib/core}/mpstream.c (100%)
 rename src/{ => lib/core}/mpstream.h (100%)
 rename src/{ => lib/core}/port.c (100%)
 rename src/{ => lib/core}/port.h (100%)
 rename src/{ => lib/core}/random.c (100%)
 rename src/{ => lib/core}/random.h (100%)
 rename src/{ => lib/core}/ratelimit.h (100%)
 rename src/{ => lib/core}/reflection.c (100%)
 rename src/{ => lib/core}/reflection.h (100%)
 rename src/{ => lib/core}/say.c (100%)
 rename src/{ => lib/core}/say.h (100%)
 rename src/{ => lib/core}/sio.c (100%)
 rename src/{ => lib/core}/sio.h (100%)
 rename src/{ => lib/core}/trigger.cc (100%)
 rename src/{ => lib/core}/trigger.h (100%)
 rename src/{ => lib/core}/util.c (100%)
 create mode 100644 src/lib/uuid/CMakeLists.txt
 rename src/{ => lib/uuid}/tt_uuid.c (100%)
 rename src/{ => lib/uuid}/tt_uuid.h (100%)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2606de23..2d60ad2bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -207,6 +207,7 @@ include_directories(${PROJECT_BINARY_DIR}/src)
 include_directories(${PROJECT_SOURCE_DIR}/src/lib)
 include_directories(${PROJECT_SOURCE_DIR}/src/lib/small)
 include_directories(${PROJECT_SOURCE_DIR}/src/lib/small/third_party)
+include_directories(${PROJECT_SOURCE_DIR}/src/lib/core)
 include_directories(${PROJECT_SOURCE_DIR})
 
 #
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3d8d6413c..b115e14c9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -73,65 +73,9 @@ if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
     set(generic_libraries ${generic_libraries} dl)
 endif()
 
-set (core_sources
-     diag.c
-     say.c
-     memory.c
-     clock.c
-     fiber.c
-     backtrace.cc
-     cbus.c
-     fiber_pool.c
-     fiber_cond.c
-     fiber_channel.c
-     latch.c
-     sio.c
-     evio.c
-     coio.cc
-     coio_task.c
-     coio_file.c
-     coio_buf.cc
-     fio.c
-     cbus.c
-     exception.cc
-     errinj.c
-     reflection.c
-     assoc.c
-     util.c
-     random.c
-     trigger.cc
-     coll.c
-     coll_def.c
-     mpstream.c
-     port.c
- )
-
-if (TARGET_OS_NETBSD)
-    # A workaround for "undefined reference to `__gcc_personality_v0'"
-    # on x86_64-rumprun-netbsd-gcc
-    set_source_files_properties(util.c PROPERTIES COMPILE_FLAGS
-        -fno-exceptions)
-endif ()
-
-add_library(core STATIC ${core_sources})
-target_link_libraries(core
-    salad small uri
-    ${LIBEV_LIBRARIES}
-    ${LIBEIO_LIBRARIES}
-    ${LIBCORO_LIBRARIES}
-    ${MSGPUCK_LIBRARIES}
-    ${generic_libraries})
-
 add_library(stat STATIC rmean.c latency.c histogram.c)
 target_link_libraries(stat core)
 
-if (ENABLE_BACKTRACE AND NOT TARGET_OS_DARWIN)
-    target_link_libraries(core gcc_s ${UNWIND_LIBRARIES})
-endif()
-
-add_library(uuid STATIC tt_uuid.c)
-target_link_libraries(uuid core bit)
-
 add_library(scramble STATIC scramble.c)
 target_link_libraries(scramble core misc)
 
@@ -182,11 +126,11 @@ set (server_sources
 set(api_headers
     ${CMAKE_BINARY_DIR}/src/trivia/config.h
     ${CMAKE_SOURCE_DIR}/src/trivia/util.h
-    ${CMAKE_SOURCE_DIR}/src/say.h
-    ${CMAKE_SOURCE_DIR}/src/fiber.h
-    ${CMAKE_SOURCE_DIR}/src/fiber_cond.h
-    ${CMAKE_SOURCE_DIR}/src/coio.h
-    ${CMAKE_SOURCE_DIR}/src/coio_task.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/say.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/fiber.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/fiber_cond.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/coio.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/coio_task.h
     ${CMAKE_SOURCE_DIR}/src/lua/utils.h
     ${CMAKE_SOURCE_DIR}/src/lua/error.h
     ${CMAKE_SOURCE_DIR}/src/lua/string.h
@@ -203,8 +147,8 @@ set(api_headers
     ${CMAKE_SOURCE_DIR}/src/box/error.h
     ${CMAKE_SOURCE_DIR}/src/box/lua/call.h
     ${CMAKE_SOURCE_DIR}/src/box/lua/tuple.h
-    ${CMAKE_SOURCE_DIR}/src/latch.h
-    ${CMAKE_SOURCE_DIR}/src/clock.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/latch.h
+    ${CMAKE_SOURCE_DIR}/src/lib/core/clock.h
 )
 rebuild_module_api(${api_headers})
 
diff --git a/src/box/applier.h b/src/box/applier.h
index 25a795fe5..d942b6fbb 100644
--- a/src/box/applier.h
+++ b/src/box/applier.h
@@ -40,7 +40,7 @@
 #include "fiber_cond.h"
 #include "trigger.h"
 #include "trivia/util.h"
-#include "tt_uuid.h"
+#include "uuid/tt_uuid.h"
 #include "uri/uri.h"
 
 #include "xrow.h"
diff --git a/src/box/recovery.h b/src/box/recovery.h
index 662be3cac..6e68abc0b 100644
--- a/src/box/recovery.h
+++ b/src/box/recovery.h
@@ -35,7 +35,6 @@
 #include "third_party/tarantool_ev.h"
 #include "xlog.h"
 #include "vclock.h"
-#include "tt_uuid.h"
 
 #if defined(__cplusplus)
 extern "C" {
diff --git a/src/box/replication.h b/src/box/replication.h
index 2ac620d86..925af8bd6 100644
--- a/src/box/replication.h
+++ b/src/box/replication.h
@@ -30,7 +30,7 @@
  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-#include "tt_uuid.h"
+#include "uuid/tt_uuid.h"
 #include "trigger.h"
 #include <stdint.h>
 #define RB_COMPACT 1
diff --git a/src/box/tuple.c b/src/box/tuple.c
index 0770db66b..311813dc3 100644
--- a/src/box/tuple.c
+++ b/src/box/tuple.c
@@ -33,7 +33,6 @@
 #include "trivia/util.h"
 #include "memory.h"
 #include "fiber.h"
-#include "tt_uuid.h"
 #include "small/quota.h"
 #include "small/small.h"
 
diff --git a/src/box/tuple.h b/src/box/tuple.h
index 45d873d57..555611c5c 100644
--- a/src/box/tuple.h
+++ b/src/box/tuple.h
@@ -34,7 +34,7 @@
 #include "say.h"
 #include "diag.h"
 #include "error.h"
-#include "tt_uuid.h" /* tuple_field_uuid */
+#include "uuid/tt_uuid.h" /* tuple_field_uuid */
 #include "tuple_format.h"
 
 #if defined(__cplusplus)
diff --git a/src/box/xlog.h b/src/box/xlog.h
index 6b45c8604..18c513beb 100644
--- a/src/box/xlog.h
+++ b/src/box/xlog.h
@@ -33,7 +33,7 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <sys/stat.h>
-#include "tt_uuid.h"
+#include "uuid/tt_uuid.h"
 #include "vclock.h"
 
 #define ZSTD_STATIC_LINKING_ONLY
diff --git a/src/box/xrow.h b/src/box/xrow.h
index e37da1e0f..5317ae22d 100644
--- a/src/box/xrow.h
+++ b/src/box/xrow.h
@@ -35,7 +35,7 @@
 #include <stddef.h>
 #include <sys/uio.h> /* struct iovec */
 
-#include "tt_uuid.h"
+#include "uuid/tt_uuid.h"
 #include "diag.h"
 #include "vclock.h"
 
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index e06d35bf0..9e90c75ab 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -7,6 +7,8 @@ add_subdirectory(csv)
 add_subdirectory(json)
 add_subdirectory(uri)
 add_subdirectory(http_parser)
+add_subdirectory(core)
+add_subdirectory(uuid)
 if(ENABLE_BUNDLED_MSGPUCK)
     add_subdirectory(msgpuck EXCLUDE_FROM_ALL)
 endif()
diff --git a/src/lib/core/CMakeLists.txt b/src/lib/core/CMakeLists.txt
new file mode 100644
index 000000000..6238f3cee
--- /dev/null
+++ b/src/lib/core/CMakeLists.txt
@@ -0,0 +1,48 @@
+set(core_sources
+    diag.c
+    say.c
+    memory.c
+    clock.c
+    fiber.c
+    backtrace.cc
+    cbus.c
+    fiber_pool.c
+    fiber_cond.c
+    fiber_channel.c
+    latch.c
+    sio.c
+    evio.c
+    coio.cc
+    coio_task.c
+    coio_file.c
+    coio_buf.cc
+    fio.c
+    exception.cc
+    errinj.c
+    reflection.c
+    assoc.c
+    util.c
+    random.c
+    trigger.cc
+    coll.c
+    coll_def.c
+    mpstream.c
+    port.c
+)
+
+if (TARGET_OS_NETBSD)
+    # A workaround for "undefined reference to `__gcc_personality_v0'"
+    # on x86_64-rumprun-netbsd-gcc
+    set_source_files_properties(util.c PROPERTIES COMPILE_FLAGS
+        -fno-exceptions)
+endif()
+
+add_library(core STATIC ${core_sources})
+
+target_link_libraries(core salad small uri ${LIBEV_LIBRARIES}
+                      ${LIBEIO_LIBRARIES} ${LIBCORO_LIBRARIES}
+                      ${MSGPUCK_LIBRARIES})
+
+if (ENABLE_BACKTRACE AND NOT TARGET_OS_DARWIN)
+    target_link_libraries(core gcc_s ${UNWIND_LIBRARIES})
+endif()
diff --git a/src/assoc.c b/src/lib/core/assoc.c
similarity index 100%
rename from src/assoc.c
rename to src/lib/core/assoc.c
diff --git a/src/assoc.h b/src/lib/core/assoc.h
similarity index 100%
rename from src/assoc.h
rename to src/lib/core/assoc.h
diff --git a/src/backtrace.cc b/src/lib/core/backtrace.cc
similarity index 100%
rename from src/backtrace.cc
rename to src/lib/core/backtrace.cc
diff --git a/src/backtrace.h b/src/lib/core/backtrace.h
similarity index 100%
rename from src/backtrace.h
rename to src/lib/core/backtrace.h
diff --git a/src/cbus.c b/src/lib/core/cbus.c
similarity index 100%
rename from src/cbus.c
rename to src/lib/core/cbus.c
diff --git a/src/cbus.h b/src/lib/core/cbus.h
similarity index 100%
rename from src/cbus.h
rename to src/lib/core/cbus.h
diff --git a/src/clock.c b/src/lib/core/clock.c
similarity index 100%
rename from src/clock.c
rename to src/lib/core/clock.c
diff --git a/src/clock.h b/src/lib/core/clock.h
similarity index 100%
rename from src/clock.h
rename to src/lib/core/clock.h
diff --git a/src/coio.cc b/src/lib/core/coio.cc
similarity index 100%
rename from src/coio.cc
rename to src/lib/core/coio.cc
diff --git a/src/coio.h b/src/lib/core/coio.h
similarity index 100%
rename from src/coio.h
rename to src/lib/core/coio.h
diff --git a/src/coio_buf.cc b/src/lib/core/coio_buf.cc
similarity index 100%
rename from src/coio_buf.cc
rename to src/lib/core/coio_buf.cc
diff --git a/src/coio_buf.h b/src/lib/core/coio_buf.h
similarity index 100%
rename from src/coio_buf.h
rename to src/lib/core/coio_buf.h
diff --git a/src/coio_file.c b/src/lib/core/coio_file.c
similarity index 100%
rename from src/coio_file.c
rename to src/lib/core/coio_file.c
diff --git a/src/coio_file.h b/src/lib/core/coio_file.h
similarity index 100%
rename from src/coio_file.h
rename to src/lib/core/coio_file.h
diff --git a/src/coio_task.c b/src/lib/core/coio_task.c
similarity index 100%
rename from src/coio_task.c
rename to src/lib/core/coio_task.c
diff --git a/src/coio_task.h b/src/lib/core/coio_task.h
similarity index 100%
rename from src/coio_task.h
rename to src/lib/core/coio_task.h
diff --git a/src/coll.c b/src/lib/core/coll.c
similarity index 100%
rename from src/coll.c
rename to src/lib/core/coll.c
diff --git a/src/coll.h b/src/lib/core/coll.h
similarity index 100%
rename from src/coll.h
rename to src/lib/core/coll.h
diff --git a/src/coll_def.c b/src/lib/core/coll_def.c
similarity index 100%
rename from src/coll_def.c
rename to src/lib/core/coll_def.c
diff --git a/src/coll_def.h b/src/lib/core/coll_def.h
similarity index 100%
rename from src/coll_def.h
rename to src/lib/core/coll_def.h
diff --git a/src/diag.c b/src/lib/core/diag.c
similarity index 100%
rename from src/diag.c
rename to src/lib/core/diag.c
diff --git a/src/diag.h b/src/lib/core/diag.h
similarity index 100%
rename from src/diag.h
rename to src/lib/core/diag.h
diff --git a/src/errinj.c b/src/lib/core/errinj.c
similarity index 100%
rename from src/errinj.c
rename to src/lib/core/errinj.c
diff --git a/src/errinj.h b/src/lib/core/errinj.h
similarity index 100%
rename from src/errinj.h
rename to src/lib/core/errinj.h
diff --git a/src/evio.c b/src/lib/core/evio.c
similarity index 100%
rename from src/evio.c
rename to src/lib/core/evio.c
diff --git a/src/evio.h b/src/lib/core/evio.h
similarity index 100%
rename from src/evio.h
rename to src/lib/core/evio.h
diff --git a/src/exception.cc b/src/lib/core/exception.cc
similarity index 100%
rename from src/exception.cc
rename to src/lib/core/exception.cc
diff --git a/src/exception.h b/src/lib/core/exception.h
similarity index 100%
rename from src/exception.h
rename to src/lib/core/exception.h
diff --git a/src/fiber.c b/src/lib/core/fiber.c
similarity index 100%
rename from src/fiber.c
rename to src/lib/core/fiber.c
diff --git a/src/fiber.h b/src/lib/core/fiber.h
similarity index 100%
rename from src/fiber.h
rename to src/lib/core/fiber.h
diff --git a/src/fiber_channel.c b/src/lib/core/fiber_channel.c
similarity index 100%
rename from src/fiber_channel.c
rename to src/lib/core/fiber_channel.c
diff --git a/src/fiber_channel.h b/src/lib/core/fiber_channel.h
similarity index 100%
rename from src/fiber_channel.h
rename to src/lib/core/fiber_channel.h
diff --git a/src/fiber_cond.c b/src/lib/core/fiber_cond.c
similarity index 100%
rename from src/fiber_cond.c
rename to src/lib/core/fiber_cond.c
diff --git a/src/fiber_cond.h b/src/lib/core/fiber_cond.h
similarity index 100%
rename from src/fiber_cond.h
rename to src/lib/core/fiber_cond.h
diff --git a/src/fiber_pool.c b/src/lib/core/fiber_pool.c
similarity index 100%
rename from src/fiber_pool.c
rename to src/lib/core/fiber_pool.c
diff --git a/src/fiber_pool.h b/src/lib/core/fiber_pool.h
similarity index 100%
rename from src/fiber_pool.h
rename to src/lib/core/fiber_pool.h
diff --git a/src/fio.c b/src/lib/core/fio.c
similarity index 100%
rename from src/fio.c
rename to src/lib/core/fio.c
diff --git a/src/fio.h b/src/lib/core/fio.h
similarity index 100%
rename from src/fio.h
rename to src/lib/core/fio.h
diff --git a/src/latch.c b/src/lib/core/latch.c
similarity index 100%
rename from src/latch.c
rename to src/lib/core/latch.c
diff --git a/src/latch.h b/src/lib/core/latch.h
similarity index 100%
rename from src/latch.h
rename to src/lib/core/latch.h
diff --git a/src/memory.c b/src/lib/core/memory.c
similarity index 100%
rename from src/memory.c
rename to src/lib/core/memory.c
diff --git a/src/memory.h b/src/lib/core/memory.h
similarity index 100%
rename from src/memory.h
rename to src/lib/core/memory.h
diff --git a/src/mpstream.c b/src/lib/core/mpstream.c
similarity index 100%
rename from src/mpstream.c
rename to src/lib/core/mpstream.c
diff --git a/src/mpstream.h b/src/lib/core/mpstream.h
similarity index 100%
rename from src/mpstream.h
rename to src/lib/core/mpstream.h
diff --git a/src/port.c b/src/lib/core/port.c
similarity index 100%
rename from src/port.c
rename to src/lib/core/port.c
diff --git a/src/port.h b/src/lib/core/port.h
similarity index 100%
rename from src/port.h
rename to src/lib/core/port.h
diff --git a/src/random.c b/src/lib/core/random.c
similarity index 100%
rename from src/random.c
rename to src/lib/core/random.c
diff --git a/src/random.h b/src/lib/core/random.h
similarity index 100%
rename from src/random.h
rename to src/lib/core/random.h
diff --git a/src/ratelimit.h b/src/lib/core/ratelimit.h
similarity index 100%
rename from src/ratelimit.h
rename to src/lib/core/ratelimit.h
diff --git a/src/reflection.c b/src/lib/core/reflection.c
similarity index 100%
rename from src/reflection.c
rename to src/lib/core/reflection.c
diff --git a/src/reflection.h b/src/lib/core/reflection.h
similarity index 100%
rename from src/reflection.h
rename to src/lib/core/reflection.h
diff --git a/src/say.c b/src/lib/core/say.c
similarity index 100%
rename from src/say.c
rename to src/lib/core/say.c
diff --git a/src/say.h b/src/lib/core/say.h
similarity index 100%
rename from src/say.h
rename to src/lib/core/say.h
diff --git a/src/sio.c b/src/lib/core/sio.c
similarity index 100%
rename from src/sio.c
rename to src/lib/core/sio.c
diff --git a/src/sio.h b/src/lib/core/sio.h
similarity index 100%
rename from src/sio.h
rename to src/lib/core/sio.h
diff --git a/src/trigger.cc b/src/lib/core/trigger.cc
similarity index 100%
rename from src/trigger.cc
rename to src/lib/core/trigger.cc
diff --git a/src/trigger.h b/src/lib/core/trigger.h
similarity index 100%
rename from src/trigger.h
rename to src/lib/core/trigger.h
diff --git a/src/util.c b/src/lib/core/util.c
similarity index 100%
rename from src/util.c
rename to src/lib/core/util.c
diff --git a/src/lib/uuid/CMakeLists.txt b/src/lib/uuid/CMakeLists.txt
new file mode 100644
index 000000000..581e4495a
--- /dev/null
+++ b/src/lib/uuid/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(uuid STATIC tt_uuid.c)
+target_link_libraries(uuid core bit)
diff --git a/src/tt_uuid.c b/src/lib/uuid/tt_uuid.c
similarity index 100%
rename from src/tt_uuid.c
rename to src/lib/uuid/tt_uuid.c
diff --git a/src/tt_uuid.h b/src/lib/uuid/tt_uuid.h
similarity index 100%
rename from src/tt_uuid.h
rename to src/lib/uuid/tt_uuid.h
diff --git a/src/lua/httpc.c b/src/lua/httpc.c
index 976b2d4cf..7338799ca 100644
--- a/src/lua/httpc.c
+++ b/src/lua/httpc.c
@@ -39,7 +39,7 @@
 #include "say.h"
 #include "lua/utils.h"
 #include "lua/httpc.h"
-#include "src/fiber.h"
+#include "core/fiber.h"
 
 /** Internal util functions
  * {{{
diff --git a/src/main.cc b/src/main.cc
index b4bd3df0d..df7468907 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -67,7 +67,6 @@
 #include "box/error.h"
 #include "scoped_guard.h"
 #include "random.h"
-#include "tt_uuid.h"
 #include "cfg.h"
 #include "version.h"
 #include <readline/readline.h>
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 16739f75d..18118d374 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -123,9 +123,9 @@ add_executable(find_path.test find_path.c
 )
 
 add_executable(reflection_c.test reflection_c.c unit.c
-    ${CMAKE_SOURCE_DIR}/src/reflection.c)
+    ${CMAKE_SOURCE_DIR}/src/lib/core/reflection.c)
 add_executable(reflection_cxx.test reflection_cxx.cc unit.c
-    ${CMAKE_SOURCE_DIR}/src/reflection.c)
+    ${CMAKE_SOURCE_DIR}/src/lib/core/reflection.c)
 add_executable(csv.test csv.c)
 target_link_libraries(csv.test csv)
 
diff --git a/test/unit/uuid.c b/test/unit/uuid.c
index fbebee329..c43d93b4f 100644
--- a/test/unit/uuid.c
+++ b/test/unit/uuid.c
@@ -1,5 +1,5 @@
 #include "unit.h"
-#include <tt_uuid.h>
+#include "uuid/tt_uuid.h"
 #include <string.h>
 
 static void
diff --git a/test/unit/vy_iterators_helper.c b/test/unit/vy_iterators_helper.c
index 55d8504bb..9fd457664 100644
--- a/test/unit/vy_iterators_helper.c
+++ b/test/unit/vy_iterators_helper.c
@@ -1,7 +1,7 @@
 #include "vy_iterators_helper.h"
 #include "memory.h"
 #include "fiber.h"
-#include "tt_uuid.h"
+#include "uuid/tt_uuid.h"
 #include "say.h"
 
 struct tt_uuid INSTANCE_UUID;
diff --git a/test/unit/xrow.cc b/test/unit/xrow.cc
index 0a202ccea..d7c172955 100644
--- a/test/unit/xrow.cc
+++ b/test/unit/xrow.cc
@@ -34,7 +34,7 @@ extern "C" {
 #include "trivia/util.h"
 #include "box/xrow.h"
 #include "box/iproto_constants.h"
-#include "tt_uuid.h"
+#include "uuid/tt_uuid.h"
 #include "version.h"
 #include "random.h"
 #include "memory.h"
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 12:11 [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib Vladislav Shpilevoy
                   ` (2 preceding siblings ...)
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 3/4] Move 'core' and 'uuid' libs " Vladislav Shpilevoy
@ 2019-02-26 12:11 ` Vladislav Shpilevoy
  2019-02-26 12:23   ` [tarantool-patches] " Konstantin Osipov
  2019-02-26 16:55 ` [tarantool-patches] [PATCH 1/1] Move 'info' library to src/lib Vladislav Shpilevoy
  4 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:11 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

Core is supposed to be the most basic library, providing only
really common features used everywhere like fiber, diag, memory,
logging. Which can't be said about collations - they are used
only by high level things - SQL, Lua utf8, comparators.

Collations are built now as 'lib/coll' library.

The patch is not necessary for anything, but it is a right thing
to do, while some activity is happening there.
---
 src/CMakeLists.txt                | 2 +-
 src/box/coll_id.c                 | 2 +-
 src/box/coll_id_def.h             | 2 +-
 src/box/sql/expr.c                | 2 +-
 src/box/sql/fk_constraint.c       | 2 +-
 src/box/sql/func.c                | 2 +-
 src/box/sql/select.c              | 2 +-
 src/box/sql/vdbeaux.c             | 2 +-
 src/box/sql/where.c               | 2 +-
 src/box/sql/whereexpr.c           | 2 +-
 src/box/tuple_compare.cc          | 2 +-
 src/box/tuple_hash.cc             | 2 +-
 src/lib/CMakeLists.txt            | 1 +
 src/lib/coll/CMakeLists.txt       | 2 ++
 src/lib/{core => coll}/coll.c     | 0
 src/lib/{core => coll}/coll.h     | 0
 src/lib/{core => coll}/coll_def.c | 0
 src/lib/{core => coll}/coll_def.h | 0
 src/lib/core/CMakeLists.txt       | 2 --
 src/lua/utf8.c                    | 2 +-
 src/main.cc                       | 2 +-
 test/unit/CMakeLists.txt          | 2 +-
 test/unit/coll.cpp                | 4 ++--
 23 files changed, 20 insertions(+), 19 deletions(-)
 create mode 100644 src/lib/coll/CMakeLists.txt
 rename src/lib/{core => coll}/coll.c (100%)
 rename src/lib/{core => coll}/coll.h (100%)
 rename src/lib/{core => coll}/coll_def.c (100%)
 rename src/lib/{core => coll}/coll_def.h (100%)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b115e14c9..481618f20 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -162,7 +162,7 @@ endif()
 
 set_source_files_compile_flags(${server_sources})
 add_library(server STATIC ${server_sources})
-target_link_libraries(server core http_parser bit uri uuid ${ICU_LIBRARIES})
+target_link_libraries(server core coll http_parser bit uri uuid)
 
 # Rule of thumb: if exporting a symbol from a static library, list the
 # library here.
diff --git a/src/box/coll_id.c b/src/box/coll_id.c
index b56c74961..5abeaed21 100644
--- a/src/box/coll_id.c
+++ b/src/box/coll_id.c
@@ -30,7 +30,7 @@
  */
 #include "coll_id.h"
 #include "coll_id_def.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include "error.h"
 #include "diag.h"
 
diff --git a/src/box/coll_id_def.h b/src/box/coll_id_def.h
index 489280c00..859209274 100644
--- a/src/box/coll_id_def.h
+++ b/src/box/coll_id_def.h
@@ -33,7 +33,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <coll_def.h>
+#include "coll/coll_def.h"
 #include "opt_def.h"
 
 /** Collation identifier definition. */
diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
index c914cfb68..a75f23756 100644
--- a/src/box/sql/expr.c
+++ b/src/box/sql/expr.c
@@ -34,7 +34,7 @@
  * for generating VDBE code that evaluates expressions in sql.
  */
 #include "box/coll_id_cache.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include "sqlInt.h"
 #include "tarantoolInt.h"
 #include "box/schema.h"
diff --git a/src/box/sql/fk_constraint.c b/src/box/sql/fk_constraint.c
index 93c01a0e7..4066b1cf1 100644
--- a/src/box/sql/fk_constraint.c
+++ b/src/box/sql/fk_constraint.c
@@ -33,7 +33,7 @@
  * This file contains code used by the compiler to add foreign key
  * support to compiled SQL statements.
  */
-#include "coll.h"
+#include "coll/coll.h"
 #include "sqlInt.h"
 #include "box/fk_constraint.h"
 #include "box/schema.h"
diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index 79e2c0e18..775fc7cc1 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -37,7 +37,7 @@
 #include "sqlInt.h"
 #include "vdbeInt.h"
 #include "version.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include <unicode/ustring.h>
 #include <unicode/ucasemap.h>
 #include <unicode/ucnv.h>
diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index 6a465a616..7c55f2e0b 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -33,7 +33,7 @@
  * This file contains C code routines that are called by the parser
  * to handle SELECT statements in sql.
  */
-#include "coll.h"
+#include "coll/coll.h"
 #include "sqlInt.h"
 #include "tarantoolInt.h"
 #include "vdbeInt.h"
diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c
index e0f66ea1b..bb64dbdf7 100644
--- a/src/box/sql/vdbeaux.c
+++ b/src/box/sql/vdbeaux.c
@@ -34,7 +34,7 @@
  * a VDBE (or an "sql_stmt" as it is known to the outside world.)
  */
 #include "fiber.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include "box/session.h"
 #include "box/schema.h"
 #include "box/tuple_format.h"
diff --git a/src/box/sql/where.c b/src/box/sql/where.c
index 1bba9d65c..f494ead4c 100644
--- a/src/box/sql/where.c
+++ b/src/box/sql/where.c
@@ -37,7 +37,7 @@
  * so is applicable.  Because this module is responsible for selecting
  * indices, you might also think of this module as the "query optimizer".
  */
-#include "coll.h"
+#include "coll/coll.h"
 #include "sqlInt.h"
 #include "tarantoolInt.h"
 #include "vdbeInt.h"
diff --git a/src/box/sql/whereexpr.c b/src/box/sql/whereexpr.c
index fa906e305..6df28ad8a 100644
--- a/src/box/sql/whereexpr.c
+++ b/src/box/sql/whereexpr.c
@@ -38,7 +38,7 @@
  * analyzing Expr objects in the WHERE clause.
  */
 #include "box/coll_id_cache.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include "sqlInt.h"
 #include "whereInt.h"
 
diff --git a/src/box/tuple_compare.cc b/src/box/tuple_compare.cc
index cbdd150b8..cf4519ccb 100644
--- a/src/box/tuple_compare.cc
+++ b/src/box/tuple_compare.cc
@@ -30,7 +30,7 @@
  */
 #include "tuple_compare.h"
 #include "tuple.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include "trivia/util.h" /* NOINLINE */
 #include <math.h>
 
diff --git a/src/box/tuple_hash.cc b/src/box/tuple_hash.cc
index 0aed4c14c..9ee435503 100644
--- a/src/box/tuple_hash.cc
+++ b/src/box/tuple_hash.cc
@@ -32,7 +32,7 @@
 #include "tuple_hash.h"
 #include "tuple.h"
 #include "third_party/PMurHash.h"
-#include "coll.h"
+#include "coll/coll.h"
 #include <math.h>
 
 /* Tuple and key hasher */
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 9e90c75ab..39795bbae 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -9,6 +9,7 @@ add_subdirectory(uri)
 add_subdirectory(http_parser)
 add_subdirectory(core)
 add_subdirectory(uuid)
+add_subdirectory(coll)
 if(ENABLE_BUNDLED_MSGPUCK)
     add_subdirectory(msgpuck EXCLUDE_FROM_ALL)
 endif()
diff --git a/src/lib/coll/CMakeLists.txt b/src/lib/coll/CMakeLists.txt
new file mode 100644
index 000000000..c01e608bb
--- /dev/null
+++ b/src/lib/coll/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(coll STATIC coll.c coll_def.c)
+target_link_libraries(coll core ${ICU_LIBRARIES})
diff --git a/src/lib/core/coll.c b/src/lib/coll/coll.c
similarity index 100%
rename from src/lib/core/coll.c
rename to src/lib/coll/coll.c
diff --git a/src/lib/core/coll.h b/src/lib/coll/coll.h
similarity index 100%
rename from src/lib/core/coll.h
rename to src/lib/coll/coll.h
diff --git a/src/lib/core/coll_def.c b/src/lib/coll/coll_def.c
similarity index 100%
rename from src/lib/core/coll_def.c
rename to src/lib/coll/coll_def.c
diff --git a/src/lib/core/coll_def.h b/src/lib/coll/coll_def.h
similarity index 100%
rename from src/lib/core/coll_def.h
rename to src/lib/coll/coll_def.h
diff --git a/src/lib/core/CMakeLists.txt b/src/lib/core/CMakeLists.txt
index 6238f3cee..eb10b11c3 100644
--- a/src/lib/core/CMakeLists.txt
+++ b/src/lib/core/CMakeLists.txt
@@ -24,8 +24,6 @@ set(core_sources
     util.c
     random.c
     trigger.cc
-    coll.c
-    coll_def.c
     mpstream.c
     port.c
 )
diff --git a/src/lua/utf8.c b/src/lua/utf8.c
index 6d3e4d39a..a009a4655 100644
--- a/src/lua/utf8.c
+++ b/src/lua/utf8.c
@@ -30,7 +30,7 @@
  */
 #include <unicode/ucasemap.h>
 #include <unicode/uchar.h>
-#include <coll.h>
+#include "coll/coll.h"
 #include "lua/utils.h"
 #include "lua/utf8.h"
 #include "diag.h"
diff --git a/src/main.cc b/src/main.cc
index df7468907..39d5fb351 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -58,7 +58,7 @@
 #include <say.h>
 #include <rmean.h>
 #include <limits.h>
-#include "coll.h"
+#include "coll/coll.h"
 #include "trivia/util.h"
 #include "backtrace.h"
 #include "tt_pthread.h"
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 18118d374..04bc659e7 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -193,7 +193,7 @@ add_executable(vy_cache.test vy_cache.c ${ITERATOR_TEST_SOURCES})
 target_link_libraries(vy_cache.test ${ITERATOR_TEST_LIBS})
 
 add_executable(coll.test coll.cpp)
-target_link_libraries(coll.test core unit ${ICU_LIBRARIES} misc)
+target_link_libraries(coll.test coll unit misc)
 
 add_executable(tuple_bigref.test tuple_bigref.c)
 target_link_libraries(tuple_bigref.test tuple unit)
diff --git a/test/unit/coll.cpp b/test/unit/coll.cpp
index 94374a7b0..5a7f49195 100644
--- a/test/unit/coll.cpp
+++ b/test/unit/coll.cpp
@@ -7,8 +7,8 @@
 #include <diag.h>
 #include <fiber.h>
 #include <memory.h>
-#include "coll_def.h"
-#include "coll.h"
+#include "coll/coll_def.h"
+#include "coll/coll.h"
 #include "unit.h"
 #include "third_party/PMurHash.h"
 
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 1/4] Remove dead dependency of http_parser on httpc
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc Vladislav Shpilevoy
@ 2019-02-26 12:12   ` Vladislav Shpilevoy
  2019-02-26 12:21   ` Konstantin Osipov
  1 sibling, 0 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:12 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

Pushed to 2.1 as obvious.

On 26/02/2019 15:11, Vladislav Shpilevoy wrote:
> Http_parser is a standalone library, which in fact does not
> require httpc. And because of that it is going to be moved into
> lib/http_parser.
> ---
>   src/http_parser.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/src/http_parser.c b/src/http_parser.c
> index d485f5b44..e70f96164 100644
> --- a/src/http_parser.c
> +++ b/src/http_parser.c
> @@ -30,7 +30,6 @@
>    */
>   
>   #include <string.h>
> -#include "httpc.h"
>   #include "http_parser.h"
>   
>   #define LF     (unsigned char) '\n'
> -- 
> 2.17.2 (Apple Git-113)
> 
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 1/4] Remove dead dependency of http_parser on httpc
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc Vladislav Shpilevoy
  2019-02-26 12:12   ` [tarantool-patches] " Vladislav Shpilevoy
@ 2019-02-26 12:21   ` Konstantin Osipov
  1 sibling, 0 replies; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 12:21 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
> Http_parser is a standalone library, which in fact does not
> require httpc. And because of that it is going to be moved into
> lib/http_parser.

OK to push.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 2/4] Move 'http_parser' to src/lib
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 2/4] Move 'http_parser' to src/lib Vladislav Shpilevoy
@ 2019-02-26 12:21   ` Konstantin Osipov
  2019-02-26 16:57     ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 12:21 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
> Http_parser in fact does not depend on anything, even on the core.
> As a rule, such basic libraries are stored in src/lib.
> 
> The patch is not necessary for anything, but it is a right thing
> to do, while some activity is happening there.

OK to push.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 3/4] Move 'core' and 'uuid' libs to src/lib
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 3/4] Move 'core' and 'uuid' libs " Vladislav Shpilevoy
@ 2019-02-26 12:22   ` Konstantin Osipov
  2019-02-26 16:57     ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 12:22 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
> For the same reason why 'uri' was moved to src/lib - SWIM needs
> core and uuid, and SWIM will live in src/lib.
> 
> This commit follows 'uri' relocation as a separate one because
> 'uri' relocation required some changes in the files, moved by
> this commit.

ok to push


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 4/4] Extract 'coll' library from 'core' Vladislav Shpilevoy
@ 2019-02-26 12:23   ` Konstantin Osipov
  2019-02-26 12:37     ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 12:23 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
> Core is supposed to be the most basic library, providing only
> really common features used everywhere like fiber, diag, memory,
> logging. Which can't be said about collations - they are used
> only by high level things - SQL, Lua utf8, comparators.
> 
> Collations are built now as 'lib/coll' library.

Does it depend on core or compile without it?  The same question
applies to http_parser. I think as a follow up we also need to put
a small README file in each dir describing the purpose of each
library and what other key libraries it depends on.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 12:23   ` [tarantool-patches] " Konstantin Osipov
@ 2019-02-26 12:37     ` Vladislav Shpilevoy
  2019-02-26 12:55       ` Konstantin Osipov
  0 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 12:37 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches



On 26/02/2019 15:23, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
>> Core is supposed to be the most basic library, providing only
>> really common features used everywhere like fiber, diag, memory,
>> logging. Which can't be said about collations - they are used
>> only by high level things - SQL, Lua utf8, comparators.
>>
>> Collations are built now as 'lib/coll' library.
> 
> Does it depend on core or compile without it?

As you can see in src/lib/coll/CMakeLists.txt, it depends on
core. Because of diag.

> The same question
> applies to http_parser.

http_parser does not depend on core.

> I think as a follow up we also need to put
> a small README file in each dir describing the purpose of each
> library and what other key libraries it depends on.

We usually do not put such dependency links in any
library headers. A programmer can look at CMakeLists,
if he needs to know them. Secondly, it complicates update -
when we added or removed a dependency, we would have
had to update two files - source and CMakeLists.txt.
Thirdly, even if you added as a dependency a static library,
but did not add its own dependencies, it is ok - cmake
handles that.

> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 12:37     ` Vladislav Shpilevoy
@ 2019-02-26 12:55       ` Konstantin Osipov
  2019-02-26 13:09         ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 12:55 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:42]:

> We usually do not put such dependency links in any
> library headers. A programmer can look at CMakeLists,
> if he needs to know them. Secondly, it complicates update -
> when we added or removed a dependency, we would have
> had to update two files - source and CMakeLists.txt.
> Thirdly, even if you added as a dependency a static library,
> but did not add its own dependencies, it is ok - cmake
> handles that.

OK, but a library is a standalone thing and it does need a README
file - describing its purpose, scope, dependencies, limitations.

Don't you think so? 

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 12:55       ` Konstantin Osipov
@ 2019-02-26 13:09         ` Vladislav Shpilevoy
  2019-02-26 13:17           ` Konstantin Osipov
  0 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 13:09 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches



On 26/02/2019 15:55, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:42]:
> 
>> We usually do not put such dependency links in any
>> library headers. A programmer can look at CMakeLists,
>> if he needs to know them. Secondly, it complicates update -
>> when we added or removed a dependency, we would have
>> had to update two files - source and CMakeLists.txt.
>> Thirdly, even if you added as a dependency a static library,
>> but did not add its own dependencies, it is ok - cmake
>> handles that.
> 
> OK, but a library is a standalone thing and it does need a README
> file - describing its purpose, scope, dependencies, limitations.
> 
> Don't you think so?
> 

Usually we either do not write readme at all, or write it in
the main header, describing the main functionality. And it is
never about build details, dependencies, and limitations.

All limitations are usually described with corresponding enum
values and function comments.

> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 13:09         ` Vladislav Shpilevoy
@ 2019-02-26 13:17           ` Konstantin Osipov
  2019-02-26 13:43             ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 13:17 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 16:12]:
> Usually we either do not write readme at all, or write it in
> the main header, describing the main functionality. And it is
> never about build details, dependencies, and limitations.
> 
> All limitations are usually described with corresponding enum
> values and function comments.

I'd say it's mostly sloppiness:

kostja@chai ~/work/tarantool/src/lib
 % ls */README*
msgpuck/README.md  salad/README  small/README.md


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 13:17           ` Konstantin Osipov
@ 2019-02-26 13:43             ` Vladislav Shpilevoy
  2019-02-27 15:07               ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 13:43 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches



On 26/02/2019 16:17, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 16:12]:
>> Usually we either do not write readme at all, or write it in
>> the main header, describing the main functionality. And it is
>> never about build details, dependencies, and limitations.
>>
>> All limitations are usually described with corresponding enum
>> values and function comments.
> 
> I'd say it's mostly sloppiness:
> 
> kostja@chai ~/work/tarantool/src/lib
>   % ls */README*
> msgpuck/README.md  salad/README  small/README.md

msgpuck and small are separate repositories, with their
own rules. Msgpuck is even a separate project, not just
repo.

And even here you can see, that small README does not
speak about build and dependencies. It just speaks the
same, what should be written as function comments. What,
in fact, would be much more useful.

Talking of salad - it is ridiculous, howling shame, and
profanation. Just open that useless 'readme' and you will
see, that it consists of one single line:

	"salad - Some ALgorithms And Data structures"

That. Is. All. Readme just for readme.

You can name my opinion whatever you want - sloppiness, or
anything else, showing me that trumpery composed of empty
or not existing READMEs, but the fact is that we really
never write them, unfortunately, as a obligatory practice.

As an opposite to your 'readme's above I can show you
much more not described libs:

- small/rlist (part of small, by the way, but not described
   in small/README);
- small/lf_fifo (the same)
- small/rb (the same)
- all the salad/* libs (I do not count empty README as a readme)
- lib/bit
- lib/uri
- src/curl
- src/histogram
- src/httpc
- src/rmean
...
I can continue longer, but do not see any sense in it.

Libs, having their readme inside the header, as a special paragraph
or as a part of main struct comment:
- lsregion
- quota_lessor
- json
- lib/bit
- lib/bitset
- lib/coll (yes, touched in this patchset, and it has
   a description of struct coll and functions in the header)

> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] [PATCH 1/1] Move 'info' library to src/lib
  2019-02-26 12:11 [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib Vladislav Shpilevoy
                   ` (3 preceding siblings ...)
  2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 4/4] Extract 'coll' library from 'core' Vladislav Shpilevoy
@ 2019-02-26 16:55 ` Vladislav Shpilevoy
  2019-02-26 22:08   ` [tarantool-patches] " Konstantin Osipov
  4 siblings, 1 reply; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 16:55 UTC (permalink / raw)
  To: tarantool-patches; +Cc: kostja

'Info' is a header-only library consisting of one file. It is
going to be used by SWIM, stored in src/lib, but src/lib can not
depend on src/. This commit moves 'info' to lib/info.

Needed for #3234
---
 src/box/index.cc          | 2 +-
 src/box/lua/index.c       | 2 +-
 src/box/lua/info.c        | 2 +-
 src/box/lua/sql.c         | 2 +-
 src/box/lua/stat.c        | 2 +-
 src/box/sql.c             | 2 +-
 src/box/vinyl.c           | 2 +-
 src/{ => lib/info}/info.h | 0
 src/lua/info.c            | 2 +-
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename src/{ => lib/info}/info.h (100%)

diff --git a/src/box/index.cc b/src/box/index.cc
index 1dbf364a8..1bfdc6ebc 100644
--- a/src/box/index.cc
+++ b/src/box/index.cc
@@ -37,7 +37,7 @@
 #include "iproto_constants.h"
 #include "txn.h"
 #include "rmean.h"
-#include "info.h"
+#include "info/info.h"
 
 /* {{{ Utilities. **********************************************/
 
diff --git a/src/box/lua/index.c b/src/box/lua/index.c
index 6265c044a..4cf3c4d68 100644
--- a/src/box/lua/index.c
+++ b/src/box/lua/index.c
@@ -31,7 +31,7 @@
 #include "box/lua/index.h"
 #include "lua/utils.h"
 #include "lua/info.h"
-#include <info.h>
+#include "info/info.h"
 #include "box/box.h"
 #include "box/index.h"
 #include "box/lua/tuple.h"
diff --git a/src/box/lua/info.c b/src/box/lua/info.c
index 70672f271..76b5646ec 100644
--- a/src/box/lua/info.c
+++ b/src/box/lua/info.c
@@ -41,7 +41,7 @@
 #include "box/iproto.h"
 #include "box/wal.h"
 #include "box/replication.h"
-#include <info.h>
+#include "info/info.h"
 #include "box/gc.h"
 #include "box/engine.h"
 #include "box/vinyl.h"
diff --git a/src/box/lua/sql.c b/src/box/lua/sql.c
index e87ff7d6e..ee20faab7 100644
--- a/src/box/lua/sql.c
+++ b/src/box/lua/sql.c
@@ -3,7 +3,7 @@
 #include "lua/msgpack.h"
 
 #include "box/sql/sqlInt.h"
-#include <info.h>
+#include "info/info.h"
 #include "lua/info.h"
 #include "lua/utils.h"
 
diff --git a/src/box/lua/stat.c b/src/box/lua/stat.c
index 3fce81f61..c00315cdd 100644
--- a/src/box/lua/stat.c
+++ b/src/box/lua/stat.c
@@ -42,7 +42,7 @@
 #include "box/iproto.h"
 #include "box/engine.h"
 #include "box/vinyl.h"
-#include <info.h>
+#include "info/info.h"
 #include "lua/info.h"
 #include "lua/utils.h"
 
diff --git a/src/box/sql.c b/src/box/sql.c
index 580f3fa9c..a2937a089 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -38,7 +38,7 @@
 #include "mpstream.h"
 
 #include "index.h"
-#include <info.h>
+#include "info/info.h"
 #include "schema.h"
 #include "box.h"
 #include "txn.h"
diff --git a/src/box/vinyl.c b/src/box/vinyl.c
index 428bae1d4..f498410c9 100644
--- a/src/box/vinyl.c
+++ b/src/box/vinyl.c
@@ -67,7 +67,7 @@
 #include "index.h"
 #include "schema.h"
 #include "xstream.h"
-#include "info.h"
+#include "info/info.h"
 #include "column_mask.h"
 #include "trigger.h"
 #include "session.h"
diff --git a/src/info.h b/src/lib/info/info.h
similarity index 100%
rename from src/info.h
rename to src/lib/info/info.h
diff --git a/src/lua/info.c b/src/lua/info.c
index 5ccbc611c..71b268949 100644
--- a/src/lua/info.c
+++ b/src/lua/info.c
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  */
 #include "lua/info.h"
-#include <info.h>
+#include "info/info.h"
 #include "lua/utils.h"
 
 static void
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 2/4] Move 'http_parser' to src/lib
  2019-02-26 12:21   ` [tarantool-patches] " Konstantin Osipov
@ 2019-02-26 16:57     ` Vladislav Shpilevoy
  0 siblings, 0 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 16:57 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches

Pushed to 2.1.

On 26/02/2019 15:21, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
>> Http_parser in fact does not depend on anything, even on the core.
>> As a rule, such basic libraries are stored in src/lib.
>>
>> The patch is not necessary for anything, but it is a right thing
>> to do, while some activity is happening there.
> 
> OK to push.
> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 3/4] Move 'core' and 'uuid' libs to src/lib
  2019-02-26 12:22   ` [tarantool-patches] " Konstantin Osipov
@ 2019-02-26 16:57     ` Vladislav Shpilevoy
  0 siblings, 0 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-26 16:57 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches

Pushed to 2.1.

On 26/02/2019 15:22, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 15:16]:
>> For the same reason why 'uri' was moved to src/lib - SWIM needs
>> core and uuid, and SWIM will live in src/lib.
>>
>> This commit follows 'uri' relocation as a separate one because
>> 'uri' relocation required some changes in the files, moved by
>> this commit.
> 
> ok to push
> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH 1/1] Move 'info' library to src/lib
  2019-02-26 16:55 ` [tarantool-patches] [PATCH 1/1] Move 'info' library to src/lib Vladislav Shpilevoy
@ 2019-02-26 22:08   ` Konstantin Osipov
  2019-02-27 15:07     ` Vladislav Shpilevoy
  0 siblings, 1 reply; 21+ messages in thread
From: Konstantin Osipov @ 2019-02-26 22:08 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 19:55]:
> 'Info' is a header-only library consisting of one file. It is
> going to be used by SWIM, stored in src/lib, but src/lib can not
> depend on src/. This commit moves 'info' to lib/info.
> 
> Needed for #3234

OK to push.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH 1/1] Move 'info' library to src/lib
  2019-02-26 22:08   ` [tarantool-patches] " Konstantin Osipov
@ 2019-02-27 15:07     ` Vladislav Shpilevoy
  0 siblings, 0 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-27 15:07 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches

Pushed to 2.1.

On 27/02/2019 01:08, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 19:55]:
>> 'Info' is a header-only library consisting of one file. It is
>> going to be used by SWIM, stored in src/lib, but src/lib can not
>> depend on src/. This commit moves 'info' to lib/info.
>>
>> Needed for #3234
> 
> OK to push.
> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [tarantool-patches] Re: [PATCH v2 4/4] Extract 'coll' library from 'core'
  2019-02-26 13:43             ` Vladislav Shpilevoy
@ 2019-02-27 15:07               ` Vladislav Shpilevoy
  0 siblings, 0 replies; 21+ messages in thread
From: Vladislav Shpilevoy @ 2019-02-27 15:07 UTC (permalink / raw)
  To: Konstantin Osipov; +Cc: tarantool-patches

Not having any more comments on that, pushed to 2.1.

On 26/02/2019 16:43, Vladislav Shpilevoy wrote:
> 
> 
> On 26/02/2019 16:17, Konstantin Osipov wrote:
>> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/02/26 16:12]:
>>> Usually we either do not write readme at all, or write it in
>>> the main header, describing the main functionality. And it is
>>> never about build details, dependencies, and limitations.
>>>
>>> All limitations are usually described with corresponding enum
>>> values and function comments.
>>
>> I'd say it's mostly sloppiness:
>>
>> kostja@chai ~/work/tarantool/src/lib
>>   % ls */README*
>> msgpuck/README.md  salad/README  small/README.md
> 
> msgpuck and small are separate repositories, with their
> own rules. Msgpuck is even a separate project, not just
> repo.
> 
> And even here you can see, that small README does not
> speak about build and dependencies. It just speaks the
> same, what should be written as function comments. What,
> in fact, would be much more useful.
> 
> Talking of salad - it is ridiculous, howling shame, and
> profanation. Just open that useless 'readme' and you will
> see, that it consists of one single line:
> 
>      "salad - Some ALgorithms And Data structures"
> 
> That. Is. All. Readme just for readme.
> 
> You can name my opinion whatever you want - sloppiness, or
> anything else, showing me that trumpery composed of empty
> or not existing READMEs, but the fact is that we really
> never write them, unfortunately, as a obligatory practice.
> 
> As an opposite to your 'readme's above I can show you
> much more not described libs:
> 
> - small/rlist (part of small, by the way, but not described
>    in small/README);
> - small/lf_fifo (the same)
> - small/rb (the same)
> - all the salad/* libs (I do not count empty README as a readme)
> - lib/bit
> - lib/uri
> - src/curl
> - src/histogram
> - src/httpc
> - src/rmean
> ...
> I can continue longer, but do not see any sense in it.
> 
> Libs, having their readme inside the header, as a special paragraph
> or as a part of main struct comment:
> - lsregion
> - quota_lessor
> - json
> - lib/bit
> - lib/bitset
> - lib/coll (yes, touched in this patchset, and it has
>    a description of struct coll and functions in the header)
> 
>>
>>
>> -- 
>> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
>> http://tarantool.io - www.twitter.com/kostja_osipov
>>
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-02-27 15:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 12:11 [tarantool-patches] [PATCH v2 0/4] Move 'core' lib to src/lib Vladislav Shpilevoy
2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 1/4] Remove dead dependency of http_parser on httpc Vladislav Shpilevoy
2019-02-26 12:12   ` [tarantool-patches] " Vladislav Shpilevoy
2019-02-26 12:21   ` Konstantin Osipov
2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 2/4] Move 'http_parser' to src/lib Vladislav Shpilevoy
2019-02-26 12:21   ` [tarantool-patches] " Konstantin Osipov
2019-02-26 16:57     ` Vladislav Shpilevoy
2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 3/4] Move 'core' and 'uuid' libs " Vladislav Shpilevoy
2019-02-26 12:22   ` [tarantool-patches] " Konstantin Osipov
2019-02-26 16:57     ` Vladislav Shpilevoy
2019-02-26 12:11 ` [tarantool-patches] [PATCH v2 4/4] Extract 'coll' library from 'core' Vladislav Shpilevoy
2019-02-26 12:23   ` [tarantool-patches] " Konstantin Osipov
2019-02-26 12:37     ` Vladislav Shpilevoy
2019-02-26 12:55       ` Konstantin Osipov
2019-02-26 13:09         ` Vladislav Shpilevoy
2019-02-26 13:17           ` Konstantin Osipov
2019-02-26 13:43             ` Vladislav Shpilevoy
2019-02-27 15:07               ` Vladislav Shpilevoy
2019-02-26 16:55 ` [tarantool-patches] [PATCH 1/1] Move 'info' library to src/lib Vladislav Shpilevoy
2019-02-26 22:08   ` [tarantool-patches] " Konstantin Osipov
2019-02-27 15:07     ` Vladislav Shpilevoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox