Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
06fc873
mv taskfiles/deps.yaml taskfiles/deps/main.yaml
kirkrodrigues Apr 24, 2025
b67730e
Update to latest yscope-dev-utils.
kirkrodrigues Apr 24, 2025
c6dac9a
Move dependency checksums into build/deps directory; Combine core's d…
kirkrodrigues Apr 25, 2025
2ce6e21
build(deps): Migrate ANTLR installation from Python script to task.
kirkrodrigues Apr 26, 2025
049e973
build(deps): Migrate outcome installation from submodule to task.
kirkrodrigues Apr 26, 2025
72d097f
build(deps): Migrate sqlite3 installation from Python script to task.
kirkrodrigues Apr 26, 2025
44cd30f
build(deps): Migrate utfcpp installation from submodule to task.
kirkrodrigues Apr 26, 2025
e36c516
build(deps): Migrate absl installation from submodule to task; Rename…
kirkrodrigues Apr 26, 2025
a44760a
build(deps): Migrate Catch2 installation from submodule to task; Rena…
kirkrodrigues Apr 26, 2025
d0e98b4
build(deps): Migrate nlohmann_json installation from submodule to tas…
kirkrodrigues Apr 26, 2025
27c3af7
build(deps): Migrate date installation from submodule to task.
kirkrodrigues Apr 26, 2025
8bd6419
build(deps): Migrate simdjson installation from submodule to task.
kirkrodrigues Apr 26, 2025
9aae9e1
build(deps): Migrate yaml-cpp installation from submodule to task.
kirkrodrigues Apr 26, 2025
6890338
build(deps): Migrate log-surgeon installation from submodule to task.
kirkrodrigues Apr 26, 2025
483565a
build(deps): Migrate ystdlib-cpp installation from submodule to task;…
kirkrodrigues Apr 26, 2025
8b1acc4
Remove obsolete download-dependency task.
kirkrodrigues Apr 26, 2025
598a8c2
Parallelize task-based core dependencies installation; Rename all-int…
kirkrodrigues Apr 26, 2025
1ee0360
Make install-remote-cmake-lib task depend on init so directories are …
kirkrodrigues Apr 26, 2025
bd2e81f
Add new taskfile to GH workflow deps and YAML linting.
kirkrodrigues Apr 26, 2025
3662dff
Apply suggestions from code review
kirkrodrigues Apr 27, 2025
a1eff8a
taskfiles/deps/utils.yaml: Fix lint violation.
kirkrodrigues Apr 27, 2025
5d24ee5
Rename clean-old-core-checksum-files to clean-outdated-core-checksum-…
kirkrodrigues Apr 27, 2025
152fb8a
Edit code review suggestions.
kirkrodrigues Apr 27, 2025
c955274
Remove unused G_DEPS_CORE_CMAKE_SETTINGS_FILE.
kirkrodrigues Apr 27, 2025
59b7a8e
Remove obsolete CMake include references to submodules directory.
kirkrodrigues Apr 27, 2025
3c87cba
Remove sqlite3ext.h.
kirkrodrigues Apr 27, 2025
f2790eb
Rename CLP_XXX_SOURCE_DIRECTORY to CLP_XXX_INCLUDES_DIRECTORY for hea…
kirkrodrigues Apr 27, 2025
1ee6482
Nest outcome header under outcome directory that's a symlink of the d…
kirkrodrigues Apr 27, 2025
b1ae815
Nest sqlite3 headers under sqlite3 directory that's a symlink of the …
kirkrodrigues Apr 27, 2025
84125e7
Add missing init step for sqlite3 and utfcpp dependencies.
kirkrodrigues Apr 27, 2025
2266e4a
Switch to outcome release tar that's not from githubusercontent.com.
kirkrodrigues Apr 27, 2025
23ac5bb
Rename includes to include to match Unix's naming-convention.
kirkrodrigues Apr 27, 2025
6c4469b
Switch to nlohmann_json release tar that's not from githubusercontent…
kirkrodrigues Apr 27, 2025
85ba10a
Grammar fix.
kirkrodrigues Apr 27, 2025
e08214c
Merge branch 'main' into core-taskfile-install-deps
kirkrodrigues Apr 27, 2025
b3b4ff5
Fix build error.
kirkrodrigues Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/clp-core-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "components/core/tools/scripts/deps-download/**"
- "components/core/tools/scripts/utils/build-and-run-unit-tests.py"
- "taskfile.yaml"
- "taskfiles/deps.yaml"
- "taskfiles/**"
- "tools/scripts/deps-download/**"
push:
paths:
Expand All @@ -27,7 +27,7 @@ on:
- "components/core/tools/scripts/deps-download/**"
- "components/core/tools/scripts/utils/build-and-run-unit-tests.py"
- "taskfile.yaml"
- "taskfiles/deps.yaml"
- "taskfiles/**"
- "tools/scripts/deps-download/**"
schedule:
# Run daily at 00:15 UTC (the 15 is to avoid periods of high load)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/clp-core-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- ".gitmodules"
- "components/core/**"
- "taskfile.yaml"
- "taskfiles/deps.yaml"
- "taskfiles/**"
- "tools/scripts/deps-download/**"
- "!components/core/tools/scripts/lib_install/macos/**"
push:
Expand All @@ -20,7 +20,7 @@ on:
- ".gitmodules"
- "components/core/**"
- "taskfile.yaml"
- "taskfiles/deps.yaml"
- "taskfiles/**"
- "tools/scripts/deps-download/**"
- "!components/core/tools/scripts/lib_install/macos/**"
schedule:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- "components/core/tests/**"
- "components/core/tools/scripts/utils/build-and-run-unit-tests.py"
- "taskfile.yaml"
- "taskfiles/deps.yaml"
- "taskfiles/**"
- "tools/scripts/deps-download/**"

centos-stream-9-deps-image:
Expand Down
31 changes: 0 additions & 31 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
[submodule "components/core/submodules/Catch2"]
path = components/core/submodules/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "components/core/submodules/date"]
path = components/core/submodules/date
url = https://github.com/HowardHinnant/date.git
[submodule "components/core/submodules/json"]
path = components/core/submodules/json
url = https://github.com/nlohmann/json.git
shallow = true
[submodule "components/core/submodules/yaml-cpp"]
path = components/core/submodules/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
[submodule "components/core/submodules/log-surgeon"]
path = components/core/submodules/log-surgeon
url = https://github.com/y-scope/log-surgeon.git
[submodule "components/core/submodules/simdjson"]
path = components/core/submodules/simdjson
url = https://github.com/simdjson/simdjson.git
[submodule "components/core/submodules/abseil-cpp"]
path = components/core/submodules/abseil-cpp
url = https://github.com/abseil/abseil-cpp.git
[submodule "tools/yscope-dev-utils"]
path = tools/yscope-dev-utils
url = https://github.com/y-scope/yscope-dev-utils.git
[submodule "components/core/submodules/outcome"]
path = components/core/submodules/outcome
url = https://github.com/ned14/outcome.git
[submodule "components/core/submodules/utfcpp"]
path = components/core/submodules/utfcpp
url = https://github.com/nemtrif/utfcpp.git
[submodule "components/core/submodules/ystdlib-cpp"]
path = components/core/submodules/ystdlib-cpp
url = https://github.com/y-scope/ystdlib-cpp.git
6 changes: 3 additions & 3 deletions components/core/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ IncludeCategories:
# NOTE: A header is grouped by first matching regex
# Library headers. Update when adding new libraries.
# NOTE: clang-format retains leading white-space on a line in violation of the YAML spec.
- Regex: "<(absl|antlr4|archive|boost|bsoncxx|catch2|curl|date|fmt|json|log_surgeon|lzma|mongocxx\
|msgpack|mysql|openssl|outcome|regex_utils|simdjson|spdlog|sqlite3|string_utils|yaml-cpp|ystdlib\
|zstd)"
- Regex: "<(absl|antlr4|archive|boost|bsoncxx|catch2|curl|date|fmt|log_surgeon|lzma|mongocxx\
|msgpack|mysql|nlohmann|openssl|outcome|regex_utils|simdjson|spdlog|sqlite3|string_utils|yaml-cpp\
|ystdlib|zstd)"
Priority: 3
# C system headers
- Regex: "^<.+\\.h>"
Expand Down
2 changes: 0 additions & 2 deletions components/core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
build/**
submodules/sqlite3/*
third-party/**
Comment thread
kirkrodrigues marked this conversation as resolved.
Resolved
82 changes: 63 additions & 19 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif ()
endif ()

if(PROJECT_IS_TOP_LEVEL)
# Include dependency settings if the project isn't being included as a subproject.
# NOTE: We mark the file optional because if the user happens to have the dependencies
# installed, this file isn't necessary.
Comment thread
kirkrodrigues marked this conversation as resolved.
Resolved
include("${CMAKE_SOURCE_DIR}/../../build/deps/core/cmake-settings/all.cmake"
OPTIONAL
RESULT_VARIABLE CLP_DEPS_SETTINGS_FILE_PATH
)

if(NOT CLP_DEPS_SETTINGS_FILE_PATH STREQUAL "NOTFOUND")
# Set CMP0144 since our minimum required CMake version is less than 3.27.
if(POLICY "CMP0144")
cmake_policy(SET "CMP0144" "NEW")
endif()
endif()
endif()

find_package(absl REQUIRED)
if (absl_FOUND)
message(STATUS "Found absl ${absl_VERSION}")
endif()

# Find and setup ANTLR Library
# We build and link to the static library
find_package(ANTLR REQUIRED)
Expand All @@ -116,6 +138,16 @@ else()
message(FATAL_ERROR "Could not find ${CLP_LIBS_STRING} libraries for Boost")
endif()

find_package(Catch2 REQUIRED)
if (Catch2_FOUND)
message(STATUS "Found Catch2 ${Catch2_VERSION}")
endif()

find_package(date REQUIRED)
if (date_FOUND)
message(STATUS "Found date ${date_VERSION}")
endif()

# Find and setup fmt
# NOTE:
# - We only try to link to the static library
Expand All @@ -127,6 +159,21 @@ else()
message(FATAL_ERROR "Could not find static libraries for fmt")
endif()

find_package(log_surgeon REQUIRED)
if(log_surgeon_FOUND)
message(STATUS "Found log_surgeon ${log_surgeon_VERSION}")
endif()

find_package(nlohmann_json REQUIRED)
if(nlohmann_json_FOUND)
message(STATUS "Found nlohmann_json ${nlohmann_json_VERSION}")
endif()

find_package(simdjson REQUIRED)
if(simdjson_FOUND)
message(STATUS "Found simdjson ${simdjson_VERSION}")
endif()

# Find and setup spdlog
if(CLP_USE_STATIC_LIBS)
# NOTE: On some Linux distributions (e.g. Ubuntu), the spdlog package only contains a dynamic
Expand Down Expand Up @@ -175,9 +222,6 @@ else ()
message(FATAL_ERROR "OpenSSL not found")
endif ()

# Add log surgeon
add_subdirectory(submodules/log-surgeon EXCLUDE_FROM_ALL)

# Find and setup MariaDBClient library
if(CLP_USE_STATIC_LIBS)
# NOTE: We can't statically link to MariaDBClient since it's GPL
Expand Down Expand Up @@ -212,21 +256,16 @@ else()
message(FATAL_ERROR "Could not find msgpack-cxx")
endif()

# Add abseil-cpp
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(submodules/abseil-cpp EXCLUDE_FROM_ALL)

# Add simdjson
add_subdirectory(submodules/simdjson EXCLUDE_FROM_ALL)

find_package(Threads REQUIRED)

# Add yaml-cpp
add_subdirectory(submodules/yaml-cpp EXCLUDE_FROM_ALL)
find_package(yaml-cpp REQUIRED)
if(yaml-cpp_FOUND)
message(STATUS "Found yaml-cpp ${yaml-cpp_VERSION}")
endif()

# Add ystdlib-cpp
# Add ystdlib
set(YSTDLIB_CPP_BUILD_TESTING OFF)
add_subdirectory(submodules/ystdlib-cpp EXCLUDE_FROM_ALL)
add_subdirectory("${CLP_YSTDLIB_SOURCE_DIRECTORY}" "${CMAKE_BINARY_DIR}/ystdlib" EXCLUDE_FROM_ALL)

# Find and setup ZStd Library
if(CLP_USE_STATIC_LIBS)
Expand Down Expand Up @@ -372,6 +411,9 @@ set(SOURCE_FILES_reducer_unitTest
)

set(SOURCE_FILES_unitTest
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3.c"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3.h"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3ext.h"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be out of this PR's scope: do we need sqlite3ext.h? It's not included in any of CLP core files, only referred in cmake configs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc, I did this for CLion, but I guess we could remove it now.

src/clp/aws/AwsAuthenticationSigner.cpp
src/clp/aws/AwsAuthenticationSigner.hpp
src/clp/aws/constants.hpp
Expand Down Expand Up @@ -594,9 +636,6 @@ set(SOURCE_FILES_unitTest
src/clp/version.hpp
src/clp/WriterInterface.cpp
src/clp/WriterInterface.hpp
submodules/sqlite3/sqlite3.c
submodules/sqlite3/sqlite3.h
submodules/sqlite3/sqlite3ext.h
tests/LogSuppressor.hpp
tests/TestOutputCleaner.hpp
tests/test-BoundedReader.cpp
Expand Down Expand Up @@ -639,30 +678,35 @@ add_executable(unitTest
)
target_include_directories(unitTest
PRIVATE
${CLP_OUTCOME_SOURCE_DIRECTORY}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Shall we use CLP_XXX_HEADER_DIRECTORY instead for non-cmake header-only libs?
It's a bit misleading that we include "source" directory where there're no source files being directly compiled.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about CLP_XXX_INCLUDES_DIRECTORY?

@LinZhihao-723 LinZhihao-723 Apr 27, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, sgtm

${CLP_SQLITE3_SOURCE_DIRECTORY}
${CMAKE_SOURCE_DIR}/submodules
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
)
target_link_libraries(unitTest
PRIVATE
absl::flat_hash_map
Boost::filesystem Boost::iostreams Boost::program_options Boost::regex Boost::url
Catch2::Catch2
${CURL_LIBRARIES}
clp_s::search::ast
clp_s::TimestampPattern
date::date
fmt::fmt
kql
log_surgeon::log_surgeon
LibArchive::LibArchive
MariaDBClient::MariaDBClient
${MONGOCXX_TARGET}
simdjson
nlohmann_json::nlohmann_json
simdjson::simdjson
spdlog::spdlog
sql
OpenSSL::Crypto
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
clp::regex_utils
clp::string_utils
yaml-cpp::yaml-cpp
yaml-cpp
ystdlib::containers
ystdlib::error_handling
${LIBLZMA_LIBRARIES}
Expand Down
1 change: 0 additions & 1 deletion components/core/cmake/Modules/FindANTLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ endif ()

set(ANTLR4_TAG 4.13.1)
add_definitions(-DANTLR4CPP_STATIC)
set(ANTLR_EXECUTABLE ${PROJECT_SOURCE_DIR}/third-party/antlr/antlr-${ANTLR4_TAG}-complete.jar)
include(ExternalAntlr4Cpp)

find_package(Java 11 REQUIRED COMPONENTS Runtime)
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/GlobalMetadataDBConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "GlobalMetadataDBConfig.hpp"

#include <fmt/core.h>
#include <yaml-cpp/include/yaml-cpp/yaml.h>
#include <yaml-cpp/yaml.h>

using std::exception;
using std::invalid_argument;
Expand Down
3 changes: 2 additions & 1 deletion components/core/src/clp/SQLiteDB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

#include <string>

#include <sqlite3.h>

#include "ErrorCode.hpp"
#include "sqlite3/sqlite3.h"
#include "SQLitePreparedStatement.hpp"
#include "TraceableException.hpp"

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/SQLitePreparedStatement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <string>

#include <sqlite3/sqlite3.h>
#include <sqlite3.h>

#include "ErrorCode.hpp"
#include "TraceableException.hpp"
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/TimestampPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <cstring>
#include <vector>

#include <date/include/date/date.h>
#include <date/date.h>

#include "spdlog_with_specializations.hpp"

Expand Down
17 changes: 12 additions & 5 deletions components/core/src/clp/clg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,35 @@ set(
../version.hpp
../WriterInterface.cpp
../WriterInterface.hpp
"${PROJECT_SOURCE_DIR}/submodules/sqlite3/sqlite3.c"
"${PROJECT_SOURCE_DIR}/submodules/sqlite3/sqlite3.h"
"${PROJECT_SOURCE_DIR}/submodules/sqlite3/sqlite3ext.h"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3.c"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3.h"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3ext.h"
clg.cpp
CommandLineArguments.cpp
CommandLineArguments.hpp
)

add_executable(clg ${CLG_SOURCES})
target_compile_features(clg PRIVATE cxx_std_20)
target_include_directories(clg PRIVATE "${PROJECT_SOURCE_DIR}/submodules")
target_include_directories(clg
PRIVATE
"${CLP_OUTCOME_SOURCE_DIRECTORY}"
"${CLP_SQLITE3_SOURCE_DIRECTORY}"
"${PROJECT_SOURCE_DIR}/submodules"
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
target_link_libraries(clg
PRIVATE
Boost::filesystem Boost::program_options
date::date
fmt::fmt
log_surgeon::log_surgeon
MariaDBClient::MariaDBClient
nlohmann_json::nlohmann_json
spdlog::spdlog
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
clp::string_utils
yaml-cpp::yaml-cpp
yaml-cpp
ystdlib::containers
ZStd::ZStd
)
Expand Down
15 changes: 11 additions & 4 deletions components/core/src/clp/clo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ set(
../version.hpp
../WriterInterface.cpp
../WriterInterface.hpp
"${PROJECT_SOURCE_DIR}/submodules/sqlite3/sqlite3.c"
"${PROJECT_SOURCE_DIR}/submodules/sqlite3/sqlite3.h"
"${PROJECT_SOURCE_DIR}/submodules/sqlite3/sqlite3ext.h"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3.c"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3.h"
"${CLP_SQLITE3_SOURCE_DIRECTORY}/sqlite3ext.h"
clo.cpp
CommandLineArguments.cpp
CommandLineArguments.hpp
Expand Down Expand Up @@ -155,14 +155,21 @@ set(

add_executable(clo ${CLO_SOURCES} ${REDUCER_SOURCES})
target_compile_features(clo PRIVATE cxx_std_20)
target_include_directories(clo PRIVATE "${PROJECT_SOURCE_DIR}/submodules")
target_include_directories(clo
PRIVATE
"${CLP_OUTCOME_SOURCE_DIRECTORY}"
"${CLP_SQLITE3_SOURCE_DIRECTORY}"
"${PROJECT_SOURCE_DIR}/submodules"
)
target_link_libraries(clo
PRIVATE
Boost::filesystem Boost::program_options
date::date
fmt::fmt
log_surgeon::log_surgeon
${MONGOCXX_TARGET}
msgpack-cxx
nlohmann_json::nlohmann_json
spdlog::spdlog
${sqlite_LIBRARY_DEPENDENCIES}
${STD_FS_LIBS}
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/clo/clo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <memory>
#include <string>

#include <json/single_include/nlohmann/json.hpp>
#include <mongocxx/instance.hpp>
#include <nlohmann/json.hpp>
#include <spdlog/sinks/stdout_sinks.h>

#include "../../reducer/network_utils.hpp"
Expand Down
Loading