diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e9c1703..40c7d148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,9 +115,6 @@ include(ExternalProject) # libs include(falcosecurity-libs) -# LuaJit provided by libs -include(luajit) - # jq include(jq) @@ -152,12 +149,6 @@ endif() include(cxxopts) -# libyaml -include(libyaml) - -# lyaml -include(lyaml) - # One TBB include(tbb) diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake index 777c66b0..35c79630 100644 --- a/cmake/modules/falcosecurity-libs.cmake +++ b/cmake/modules/falcosecurity-libs.cmake @@ -62,14 +62,9 @@ set(LIBSINSP_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}") set(CREATE_TEST_TARGETS OFF CACHE BOOL "") set(BUILD_LIBSCAP_EXAMPLES OFF CACHE BOOL "") -# todo(leogr): although Falco does not actually depend on chisels, we need this for the lua_parser. -# Hopefully, we can switch off this in the future -set(WITH_CHISEL ON CACHE BOOL "") - set(USE_BUNDLED_TBB ON CACHE BOOL "") set(USE_BUNDLED_B64 ON CACHE BOOL "") set(USE_BUNDLED_JSONCPP ON CACHE BOOL "") -set(USE_BUNDLED_LUAJIT ON CACHE BOOL "") list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules") diff --git a/cmake/modules/lyaml.cmake b/cmake/modules/lyaml.cmake deleted file mode 100644 index a764ae15..00000000 --- a/cmake/modules/lyaml.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (C) 2020 The Falco Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -set(LYAML_ROOT "${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml") -set(LYAML_LIB "${LYAML_ROOT}/ext/yaml/.libs/yaml.a") -set(LYAML_LUA_DIR "${LYAML_ROOT}/lib") -message(STATUS "Using bundled lyaml in '${LYAML_ROOT}'") -externalproject_add( - lyaml - DEPENDS luajit libyaml - URL "https://github.com/gvvaughan/lyaml/archive/release-v6.0.tar.gz" - URL_HASH "SHA256=9d7cf74d776999ff6f758c569d5202ff5da1f303c6f4229d3b41f71cd3a3e7a7" - BUILD_COMMAND ${CMD_MAKE} - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS ${LYAML_LIB} - INSTALL_COMMAND "" - CONFIGURE_COMMAND ./configure --enable-static CFLAGS=-I${LIBYAML_INSTALL_DIR}/include CPPFLAGS=-I${LIBYAML_INSTALL_DIR}/include LDFLAGS=-L${LIBYAML_INSTALL_DIR}/lib LIBS=-lyaml LUA=${LUAJIT_SRC}/luajit LUA_INCLUDE=-I${LUAJIT_INCLUDE} -) diff --git a/userspace/engine/CMakeLists.txt b/userspace/engine/CMakeLists.txt index 1c46ccb6..a5312b8a 100644 --- a/userspace/engine/CMakeLists.txt +++ b/userspace/engine/CMakeLists.txt @@ -24,37 +24,35 @@ set(FALCO_ENGINE_SOURCE_FILES lua_filter_helper.cpp) add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES}) -add_dependencies(falco_engine njson lyaml string-view-lite) +add_dependencies(falco_engine njson string-view-lite) if(USE_BUNDLED_DEPS) - add_dependencies(falco_engine libyaml) + add_dependencies(falco_engine yamlcpp) endif() if(MINIMAL_BUILD) target_include_directories( falco_engine PUBLIC - "${LUAJIT_INCLUDE}" "${NJSON_INCLUDE}" "${TBB_INCLUDE_DIR}" "${STRING_VIEW_LITE_INCLUDE}" "${LIBSCAP_INCLUDE_DIRS}" "${LIBSINSP_INCLUDE_DIRS}" - "${PROJECT_BINARY_DIR}/userspace/engine" - "${PROJECT_BINARY_DIR}/userspace/engine/lua") + "${YAMLCPP_INCLUDE_DIR}" + "${PROJECT_BINARY_DIR}/userspace/engine") else() target_include_directories( falco_engine PUBLIC - "${LUAJIT_INCLUDE}" "${NJSON_INCLUDE}" "${CURL_INCLUDE_DIR}" "${TBB_INCLUDE_DIR}" "${STRING_VIEW_LITE_INCLUDE}" "${LIBSCAP_INCLUDE_DIRS}" "${LIBSINSP_INCLUDE_DIRS}" - "${PROJECT_BINARY_DIR}/userspace/engine" - "${PROJECT_BINARY_DIR}/userspace/engine/lua") + "${YAMLCPP_INCLUDE_DIR}" + "${PROJECT_BINARY_DIR}/userspace/engine") endif() -target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${LYAML_LIB}" "${LIBYAML_LIB}" luafiles) +target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${YAMLCPP_LIB}") diff --git a/userspace/engine/lyaml.h b/userspace/engine/lyaml.h deleted file mode 100644 index 570b8e32..00000000 --- a/userspace/engine/lyaml.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright (C) 2019 The Falco Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#pragma once - -#include "lua.h" - -int luaopen_yaml (lua_State *L); - diff --git a/userspace/falco/CMakeLists.txt b/userspace/falco/CMakeLists.txt index c6634851..e42348c6 100644 --- a/userspace/falco/CMakeLists.txt +++ b/userspace/falco/CMakeLists.txt @@ -44,10 +44,7 @@ set( set( FALCO_DEPENDENCIES string-view-lite - libyaml b64 - luajit - lyaml cxxopts ) @@ -55,7 +52,6 @@ set( FALCO_LIBRARIES falco_engine sinsp - "${LIBYAML_LIB}" "${YAMLCPP_LIB}" ) @@ -107,7 +103,6 @@ if(NOT MINIMAL_BUILD) "${PROTOBUF_LIB}" "${CARES_LIB}" "${OPENSSL_LIBRARIES}" - "${LIBYAML_LIB}" "${YAMLCPP_LIB}" "${CIVETWEB_LIB}" "${CIVETWEB_CPP_LIB}"