From 80223d8b3cc81f37b74f25b412252eb28d8f7e15 Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Tue, 3 Nov 2020 20:02:00 +0200 Subject: [PATCH] rpm/deb/cmake: remove the lua submodule instead use the official lua-dev/el packages Signed-off-by: Yuval Lifshitz --- .gitmodules | 5 ----- ceph.spec.in | 1 + debian/control | 1 + src/CMakeLists.txt | 2 +- src/cls/CMakeLists.txt | 3 ++- src/cls/lua/lua_bufferlist.cc | 2 +- src/lua | 1 - src/mds/CMakeLists.txt | 3 ++- src/rgw/CMakeLists.txt | 5 ++--- src/test/cls_lua/CMakeLists.txt | 3 ++- 10 files changed, 12 insertions(+), 14 deletions(-) delete mode 160000 src/lua diff --git a/.gitmodules b/.gitmodules index 6280d8e93eed2..173563ebdfcaf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -32,11 +32,6 @@ [submodule "src/isa-l"] path = src/isa-l url = https://github.com/ceph/isa-l -[submodule "src/lua"] - path = src/lua - url = https://github.com/ceph/lua.git - branch = lua-5.3-ceph - ignore = dirty [submodule "src/zstd"] path = src/zstd url = https://github.com/facebook/zstd diff --git a/ceph.spec.in b/ceph.spec.in index 79ad6779f0165..0f718fe3f9633 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -179,6 +179,7 @@ BuildRequires: xfsprogs BuildRequires: xfsprogs-devel BuildRequires: xmlstarlet BuildRequires: nasm +BuildRequires: lua-devel %if 0%{with amqp_endpoint} BuildRequires: librabbitmq-devel %endif diff --git a/debian/control b/debian/control index b0014c54e214f..13471e67c0ef3 100644 --- a/debian/control +++ b/debian/control @@ -43,6 +43,7 @@ Build-Depends: cmake (>= 3.10.2), libldap2-dev, libleveldb-dev, liblttng-ust-dev, + liblua5.3-dev, liblz4-dev (>= 0.0~r131), libncurses-dev, libnss3-dev, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ffcc74afc5b4..b8110eab6216c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -509,7 +509,7 @@ endif(${WITH_LTTNG}) add_subdirectory(global) -add_subdirectory(lua) +find_package(Lua REQUIRED) # rados object classes add_subdirectory(cls) diff --git a/src/cls/CMakeLists.txt b/src/cls/CMakeLists.txt index a18b6bf3ea76a..be7544a786688 100644 --- a/src/cls/CMakeLists.txt +++ b/src/cls/CMakeLists.txt @@ -243,8 +243,9 @@ set_target_properties(cls_lua PROPERTIES CXX_VISIBILITY_PRESET hidden) install(TARGETS cls_lua DESTINATION ${cls_dir}) target_link_libraries(cls_lua - liblua + ${LUA_LIBRARIES} json_spirit) +target_include_directories(cls_lua PRIVATE "${LUA_INCLUDE_DIR}") set(cls_lua_client_srcs lua/cls_lua_client.cc) diff --git a/src/cls/lua/lua_bufferlist.cc b/src/cls/lua/lua_bufferlist.cc index 995b40821b0e7..5d44d0aef26e9 100644 --- a/src/cls/lua/lua_bufferlist.cc +++ b/src/cls/lua/lua_bufferlist.cc @@ -163,7 +163,7 @@ static const struct luaL_Reg bllib_f[] = { {NULL, NULL} }; -LUALIB_API int luaopen_bufferlist(lua_State *L) +int luaopen_bufferlist(lua_State *L) { /* Setup bufferlist user-data type */ luaL_newmetatable(L, LUA_BUFFERLIST); diff --git a/src/lua b/src/lua deleted file mode 160000 index 1fce39c639705..0000000000000 --- a/src/lua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1fce39c6397056db645718b8f5821571d97869a4 diff --git a/src/mds/CMakeLists.txt b/src/mds/CMakeLists.txt index 38ea8adf2dda8..a12898f38c78e 100644 --- a/src/mds/CMakeLists.txt +++ b/src/mds/CMakeLists.txt @@ -49,4 +49,5 @@ set(mds_srcs ${CMAKE_SOURCE_DIR}/src/mgr/MDSPerfMetricTypes.cc) add_library(mds STATIC ${mds_srcs}) target_link_libraries(mds PRIVATE - heap_profiler cpu_profiler osdc liblua) + heap_profiler cpu_profiler osdc ${LUA_LIBRARIES}) +target_include_directories(mds PRIVATE "${LUA_INCLUDE_DIR}") diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 3a1838a21cd25..dc67f65c7a92a 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -173,8 +173,7 @@ target_include_directories(rgw_common SYSTEM PUBLIC "services") target_include_directories(rgw_common PUBLIC "${CMAKE_SOURCE_DIR}/src/dmclock/support/src") target_include_directories(rgw_common PUBLIC "${CMAKE_SOURCE_DIR}/src/fmt/include") target_include_directories(rgw_common PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw") -target_include_directories(rgw_common PRIVATE "${CMAKE_SOURCE_DIR}/src/lua/src") -target_include_directories(rgw_common PRIVATE "${CMAKE_BINARY_DIR}/src/lua") +target_include_directories(rgw_common PRIVATE "${LUA_INCLUDE_DIR}") target_include_directories(rgw_common PRIVATE @@ -256,7 +255,7 @@ if(WITH_CURL_OPENSSL) target_link_libraries(rgw_a PRIVATE OpenSSL::Crypto) endif() -target_link_libraries(rgw_a PRIVATE liblua) +target_link_libraries(rgw_a PRIVATE ${LUA_LIBRARIES}) target_link_libraries(rgw_a PUBLIC spawn) set(rgw_libs rgw_a) diff --git a/src/test/cls_lua/CMakeLists.txt b/src/test/cls_lua/CMakeLists.txt index a16fb6226d689..510bb58a65218 100644 --- a/src/test/cls_lua/CMakeLists.txt +++ b/src/test/cls_lua/CMakeLists.txt @@ -3,13 +3,14 @@ add_executable(ceph_test_cls_lua ) target_link_libraries(ceph_test_cls_lua cls_lua_client - liblua + ${LUA_LIBRARIES} librados global ${UNITTEST_LIBS} ${EXTRALIBS} ${CMAKE_DL_LIBS} radostest-cxx) +target_include_directories(ceph_test_cls_lua PRIVATE "${LUA_INCLUDE_DIR}") install(TARGETS ceph_test_cls_lua DESTINATION ${CMAKE_INSTALL_BINDIR})