Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
280ba24
Remove current libarchive installations from all os platforms
Bill-hbrhbr Jul 22, 2025
0f97d9b
Use task to install a fixed version of libarchive
Bill-hbrhbr Jul 22, 2025
0f686fd
Revert LibArchive static linking module
Bill-hbrhbr Jul 22, 2025
88f1eed
Add missing target links to make ubuntu-jammy compile
Bill-hbrhbr Jul 22, 2025
2cacc5d
Fix library name
Bill-hbrhbr Jul 22, 2025
2597a21
Misc fixes
Bill-hbrhbr Jul 22, 2025
3a53973
Add missing deps (bzip2)
Bill-hbrhbr Jul 23, 2025
3ff8669
Add missing bzip2 for manylinux
Bill-hbrhbr Jul 23, 2025
8a2407b
Address coderabbit ai review
Bill-hbrhbr Jul 23, 2025
3233f2f
Replace broken LibLZMA target with old-fashioned LZMA libraries variable
Bill-hbrhbr Jul 23, 2025
f61890b
Optimize package find logging statement
Bill-hbrhbr Jul 23, 2025
e78c035
Use existing helper to find dep modules for libarchive
Bill-hbrhbr Jul 23, 2025
5fdbc12
Make Pkgconf work in FindLibArchive
Bill-hbrhbr Jul 24, 2025
cb47228
restore cmakelists order to reduce clutter
Bill-hbrhbr Jul 24, 2025
8f5d04d
Remove centos restriction on avoiding static libs
Bill-hbrhbr Jul 24, 2025
5046d0d
Improve LibArchive find module
Bill-hbrhbr Aug 13, 2025
e65b433
Revert changes to find library deps
Bill-hbrhbr Aug 13, 2025
d54a1ea
Remove unnecessary find_package calls
Bill-hbrhbr Aug 13, 2025
2bb246b
Revert many/musllinux dep scripts and update ubuntujammy/centos/macos…
Bill-hbrhbr Aug 13, 2025
515e400
Merge branch 'main' into modernize-libarchive-install
Bill-hbrhbr Aug 13, 2025
a21c9ce
revert libarchive script
Bill-hbrhbr Aug 13, 2025
c6e03c0
Merge branch 'main' into modernize-libarchive-install
Bill-hbrhbr Sep 18, 2025
bc61453
Merge branch 'main' into modernize-libarchive-install
Bill-hbrhbr Sep 18, 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
30 changes: 22 additions & 8 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ if(CLP_NEED_BOOST)
endif()
endif()

if(CLP_NEED_BZIP2)
find_package(BZip2 REQUIRED)
message(STATUS "Found BZip2")
endif()

if(CLP_NEED_CATCH2)
find_package(Catch2 REQUIRED)
if (Catch2_FOUND)
Expand Down Expand Up @@ -183,6 +188,14 @@ if(CLP_NEED_LOG_SURGEON)
endif()
endif()

if(CLP_NEED_LZ4)
if(CLP_USE_STATIC_LIBS)
set(LZ4_USE_STATIC_LIBS ON)
endif()
find_package(LZ4 REQUIRED)
message(STATUS "Found LZ4 ${LZ4_VERSION}")
endif()

if(CLP_NEED_NLOHMANN_JSON)
find_package(nlohmann_json REQUIRED)
if(nlohmann_json_FOUND)
Expand All @@ -209,12 +222,8 @@ if(CLP_NEED_LIBARCHIVE)
if(CLP_USE_STATIC_LIBS)
set(LibArchive_USE_STATIC_LIBS ON)
endif()
find_package(LibArchive REQUIRED)
if(LibArchive_FOUND)
message(STATUS "Found LibArchive ${LibArchive_VERSION}")
else()
message(FATAL_ERROR "Could not find ${CLP_LIBS_STRING} libraries for LibArchive")
endif()
find_package(LibArchive 3.8.1 REQUIRED)
message(STATUS "Found LibArchive ${LibArchive_VERSION}")
endif()

# Find and setup libcurl
Expand Down Expand Up @@ -288,6 +297,12 @@ if(CLP_NEED_YSTDLIB)
add_subdirectory("${CLP_YSTDLIB_SOURCE_DIRECTORY}" "${CMAKE_BINARY_DIR}/ystdlib" EXCLUDE_FROM_ALL)
endif()

# Find and setup ZLIB
if(CLP_NEED_ZLIB)
find_package(ZLIB REQUIRED)
message(STATUS "Found ZLIB ${ZLIB_VERSION_STRING}")
endif()

# Find and setup ZStd Library
if(CLP_NEED_ZSTD)
if(CLP_USE_STATIC_LIBS)
Expand Down Expand Up @@ -742,7 +757,7 @@ if(CLP_BUILD_TESTING)
${CLP_SQLITE3_INCLUDE_DIRECTORY}
)
target_link_libraries(unitTest
PRIVATE
PRIVATE
absl::flat_hash_map
Boost::filesystem Boost::iostreams Boost::program_options Boost::regex Boost::url
Catch2::Catch2
Expand All @@ -768,7 +783,6 @@ if(CLP_BUILD_TESTING)
yaml-cpp
ystdlib::containers
ystdlib::error_handling
${LIBLZMA_LIBRARIES}
ZStd::ZStd
)
target_compile_features(unitTest
Expand Down
29 changes: 12 additions & 17 deletions components/core/cmake/Modules/FindLibArchive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@
# - Variables only for use within the script are prefixed with "libarchive_"
# - Variables that should be externally visible are prefixed with "LibArchive_"

set(libarchive_LIBNAME "archive")

include(cmake/Modules/FindLibraryDependencies.cmake)

# On macOS, libarchive installed through brew is not linked into prefix by default.
# So it cannot be found by pkg-config and we need to manually find it.
# For more details, see https://github.com/Homebrew/homebrew-core/issues/117642
# Find and setup libarchive
if(APPLE)
execute_process(COMMAND brew --prefix libarchive OUTPUT_VARIABLE libarchive_MACOS_PREFIX)
string(STRIP "${libarchive_MACOS_PREFIX}" libarchive_MACOS_PREFIX)
set(ENV{libarchive_PREV_CMAKE_PATH} "$ENV{CMAKE_PREFIX_PATH}") # save it so we can revert it later
set(ENV{CMAKE_PREFIX_PATH} "${libarchive_MACOS_PREFIX};$ENV{CMAKE_PREFIX_PATH}")
endif()
set(libarchive_LIBNAME "archive")
set(libarchive_PKGCONFIG_DIR "${LibArchive_ROOT}/lib/pkgconfig")

# Run pkg-config
find_package(PkgConfig)
set(ENV{PKG_CONFIG_PATH} "${libarchive_PKGCONFIG_DIR};$ENV{PKG_CONFIG_PATH}")
pkg_check_modules(libarchive_PKGCONF QUIET "lib${libarchive_LIBNAME}")

# Set include directory
Expand All @@ -52,7 +43,7 @@ find_library(LibArchive_LIBRARY
HINTS ${libarchive_PKGCONF_LIBDIR}
PATH_SUFFIXES lib
)
if (LibArchive_LIBRARY)
if(LibArchive_LIBRARY)
# NOTE: This must be set for find_package_handle_standard_args to work
set(LibArchive_FOUND ON)
endif()
Expand All @@ -66,8 +57,16 @@ if(LibArchive_USE_STATIC_LIBS)
unset(libarchive_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
endif()

if(APPLE)
set(libarchive_DYNAMIC_LIBS "${libarchive_PKGCONF_STATIC_LIBRARIES}")
endif()

FindDynamicLibraryDependencies(libarchive "${libarchive_DYNAMIC_LIBS}")

message(STATUS "libarchive_PKGCONF_STATIC_LIBRARIES = ${libarchive_PKGCONF_STATIC_LIBRARIES}")
message(STATUS "libarchive_DYNAMIC_LIBS = ${libarchive_DYNAMIC_LIBS}")
message(STATUS "libarchive_LIBRARY_DEPENDENCIES = ${libarchive_LIBRARY_DEPENDENCIES}")

# Set version
set(LibArchive_VERSION ${libarchive_PKGCONF_VERSION})

Expand Down Expand Up @@ -115,7 +114,3 @@ if(NOT TARGET LibArchive::LibArchive)
endif()
endif()

if(APPLE)
# remove LibArchive-specific path
set(ENV{CMAKE_PREFIX_PATH} "$ENV{libarchive_PREV_CMAKE_PATH}")
endif()
10 changes: 10 additions & 0 deletions components/core/cmake/Options/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ function(set_clp_binaries_dependencies)
set_clp_need_flags(
CLP_NEED_ABSL
CLP_NEED_BOOST
CLP_NEED_BZIP2
CLP_NEED_CURL
CLP_NEED_DATE
CLP_NEED_FMT
CLP_NEED_LIBARCHIVE
CLP_NEED_LOG_SURGEON
CLP_NEED_LZ4
CLP_NEED_LZMA
CLP_NEED_MARIADB
CLP_NEED_MONGOCXX
CLP_NEED_MSGPACKCXX
Expand All @@ -148,6 +151,7 @@ function(set_clp_binaries_dependencies)
CLP_NEED_SQLITE
CLP_NEED_YAMLCPP
CLP_NEED_YSTDLIB
CLP_NEED_ZLIB
CLP_NEED_ZSTD
)
endfunction()
Expand All @@ -167,11 +171,13 @@ function(set_clp_tests_dependencies)
set_clp_need_flags(
CLP_NEED_ABSL
CLP_NEED_BOOST
CLP_NEED_BZIP2
CLP_NEED_CATCH2
CLP_NEED_DATE
CLP_NEED_FMT
CLP_NEED_LIBARCHIVE
CLP_NEED_LOG_SURGEON
CLP_NEED_LZ4
CLP_NEED_LZMA
CLP_NEED_MARIADB
CLP_NEED_MONGOCXX
Expand All @@ -182,6 +188,7 @@ function(set_clp_tests_dependencies)
CLP_NEED_SQLITE
CLP_NEED_YAMLCPP
CLP_NEED_YSTDLIB
CLP_NEED_ZLIB
CLP_NEED_ZSTD
)
endfunction()
Expand Down Expand Up @@ -450,12 +457,14 @@ function (convert_clp_dependency_properties_to_variables)
CLP_NEED_ABSL
CLP_NEED_ANTLR
CLP_NEED_BOOST
CLP_NEED_BZIP2
CLP_NEED_CATCH2
CLP_NEED_CURL
CLP_NEED_DATE
CLP_NEED_FMT
CLP_NEED_LOG_SURGEON
CLP_NEED_LIBARCHIVE
CLP_NEED_LZ4
CLP_NEED_LZMA
CLP_NEED_MARIADB
CLP_NEED_MONGOCXX
Expand All @@ -467,6 +476,7 @@ function (convert_clp_dependency_properties_to_variables)
CLP_NEED_SQLITE
CLP_NEED_YAMLCPP
CLP_NEED_YSTDLIB
CLP_NEED_ZLIB
CLP_NEED_ZSTD
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ set -e
set -u

dnf install -y \
bzip2-devel \
cmake \
diffutils \
gcc-c++ \
git \
java-11-openjdk \
jq \
libarchive-devel \
libcurl-devel \
libzstd-devel \
lz4-devel \
make \
mariadb-connector-c-devel \
openssl-devel \
python3-devel \
python3-pip \
unzip

Expand Down
95 changes: 0 additions & 95 deletions components/core/tools/scripts/lib_install/libarchive.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ brew install \
coreutils \
gcc \
java11 \
libarchive \
llvm@16 \
lz4 \
mariadb-connector-c \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ lib_install_scripts_dir="${script_dir}/.."
"${lib_install_scripts_dir}/liblzma.sh" 5.8.1
"${lib_install_scripts_dir}/lz4.sh" 1.10.0
"${lib_install_scripts_dir}/zstandard.sh" 1.5.7
"${lib_install_scripts_dir}/libarchive.sh" 3.8.0

"${lib_install_scripts_dir}/msgpack.sh" 7.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eu
set -o pipefail

dnf install -y \
bzip2-devel \
gcc-c++ \
java-11-openjdk \
jq \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ lib_install_scripts_dir="${script_dir}/.."
"${lib_install_scripts_dir}/liblzma.sh" 5.8.1
"${lib_install_scripts_dir}/lz4.sh" 1.10.0
"${lib_install_scripts_dir}/zstandard.sh" 1.5.7
"${lib_install_scripts_dir}/libarchive.sh" 3.8.0

"${lib_install_scripts_dir}/msgpack.sh" 7.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ lib_install_scripts_dir=$script_dir/..
# NOTE: boost must be installed first since the remaining packages depend on it
"$lib_install_scripts_dir"/install-boost.sh 1.87.0

"$lib_install_scripts_dir"/libarchive.sh 3.5.1
"$lib_install_scripts_dir"/liblzma.sh 5.8.1
"$lib_install_scripts_dir"/lz4.sh 1.8.2
"$lib_install_scripts_dir"/msgpack.sh 7.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -u

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
libbz2-dev \
ca-certificates \
checkinstall \
cmake \
Expand All @@ -23,6 +24,7 @@ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
openjdk-11-jdk \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-venv \
software-properties-common \
Expand Down
Loading
Loading