[Tarantool-patches] [PATCH] console: drop unused serpent module

Alexander V. Tikhonov avtikhon at tarantool.org
Tue Dec 1 12:29:47 MSK 2020


Hi Cyrill, , thanks for the patch, as I see no new degradation found in
gitlab-ci testing commit criteria pipeline [1], patch LGTM.

[1] - https://gitlab.com/tarantool/tarantool/-/pipelines/215793322

On Fri, Nov 13, 2020 at 05:56:48PM +0300, Cyrill Gorcunov wrote:
> Since the commit ae7e210 we use internal serializer
> thus we no longer need serpent code.
> 
> The patch removes the references from the source code
> and .gitmodules file, still one might need to run
> 
>  | git submodule deinit -f third_party/serpent
> 
> manually to clean up the working tree depending
> on local git version.
> 
> Closes #5517
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
> issue https://github.com/tarantool/tarantool/issues/5517
> branch gorcunov/gh-5517-drop-serpent
> 
> Sasha, please take a very close look. While the commit works
> just fine locally we need to double check if submodule removed
> without any clash.
> 
>  .gitmodules             |  3 ---
>  .luacheckrc             |  1 -
>  src/box/CMakeLists.txt  |  1 -
>  src/box/lua/console.c   | 26 --------------------------
>  src/box/lua/serpent.lua |  1 -
>  third_party/serpent     |  1 -
>  6 files changed, 33 deletions(-)
>  delete mode 120000 src/box/lua/serpent.lua
>  delete mode 160000 third_party/serpent
> 
> diff --git a/.gitmodules b/.gitmodules
> index d45e9ce8b..8e3a17a63 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -34,9 +34,6 @@
>  [submodule "third_party/decNumber"]
>  	path = third_party/decNumber
>  	url = https://github.com/tarantool/decNumber.git
> -[submodule "third_party/serpent"]
> -	path = third_party/serpent
> -	url = https://github.com/tarantool/serpent.git
>  [submodule "third_party/curl"]
>  	path = third_party/curl
>  	url = https://github.com/tarantool/curl.git
> diff --git a/.luacheckrc b/.luacheckrc
> index 2a652cd06..6fe34c2e1 100644
> --- a/.luacheckrc
> +++ b/.luacheckrc
> @@ -29,7 +29,6 @@ include_files = {
>  exclude_files = {
>      "build/**/*.lua",
>      -- Third-party source code.
> -    "src/box/lua/serpent.lua",
>      "test-run/**/*.lua",
>      "test/**/*.lua",
>      "third_party/**/*.lua",
> diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt
> index d1667796a..04d53f740 100644
> --- a/src/box/CMakeLists.txt
> +++ b/src/box/CMakeLists.txt
> @@ -17,7 +17,6 @@ endif()
>  lua_source(lua_sources lua/net_box.lua)
>  lua_source(lua_sources lua/upgrade.lua)
>  lua_source(lua_sources lua/console.lua)
> -lua_source(lua_sources lua/serpent.lua)
>  lua_source(lua_sources lua/xlog.lua)
>  lua_source(lua_sources lua/key_def.lua)
>  lua_source(lua_sources lua/merger.lua)
> diff --git a/src/box/lua/console.c b/src/box/lua/console.c
> index ea5385c74..2e8204db6 100644
> --- a/src/box/lua/console.c
> +++ b/src/box/lua/console.c
> @@ -48,8 +48,6 @@
>  #include <stdlib.h>
>  #include <ctype.h>
>  
> -extern char serpent_lua[];
> -
>  static struct luaL_serializer *serializer_yaml;
>  static struct luaL_serializer *serializer_lua;
>  
> @@ -578,24 +576,6 @@ console_session_push(struct session *session, struct port *port)
>  				     TIMEOUT_INFINITY);
>  }
>  
> -static void
> -lua_serpent_init(struct lua_State *L)
> -{
> -	static const char modname[] = "serpent";
> -	const char *modfile;
> -
> -	lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
> -	modfile = lua_pushfstring(L, "@builtin/%s.lua", modname);
> -	if (luaL_loadbuffer(L, serpent_lua, strlen(serpent_lua), modfile)) {
> -		panic("Error loading Lua module %s...: %s",
> -		      modname, lua_tostring(L, -1));
> -	}
> -
> -	lua_call(L, 0, 1);
> -	lua_setfield(L, -3, modname);  /* _LOADED[modname] = new table */
> -	lua_pop(L, 2);
> -}
> -
>  void
>  tarantool_lua_console_init(struct lua_State *L)
>  {
> @@ -663,12 +643,6 @@ tarantool_lua_console_init(struct lua_State *L)
>  	};
>  	session_vtab_registry[SESSION_TYPE_CONSOLE] = console_session_vtab;
>  	session_vtab_registry[SESSION_TYPE_REPL] = console_session_vtab;
> -
> -	/*
> -	 * Register serpent serializer as we
> -	 * need it inside console REPL mode.
> -	 */
> -	lua_serpent_init(L);
>  }
>  
>  /*
> diff --git a/src/box/lua/serpent.lua b/src/box/lua/serpent.lua
> deleted file mode 120000
> index 816be0875..000000000
> --- a/src/box/lua/serpent.lua
> +++ /dev/null
> @@ -1 +0,0 @@
> -../../../third_party/serpent/src/serpent.lua
> \ No newline at end of file
> diff --git a/third_party/serpent b/third_party/serpent
> deleted file mode 160000
> index 879580fb2..000000000
> --- a/third_party/serpent
> +++ /dev/null
> @@ -1 +0,0 @@
> -Subproject commit 879580fb21933f63eb23ece7d60ba2349a8d2848
> -- 
> 2.26.2
> 


More information about the Tarantool-patches mailing list