Skip to content

Commit 9888c11

Browse files
build(deps): Bump ystdlib to y-scope/ystdlib-cpp@9ed78cd and install ystdlib via CMake; Lower minimum Clang version for Velox compatibility. (#1226)
Co-authored-by: kirkrodrigues <[email protected]>
1 parent bb89bfb commit 9888c11

File tree

6 files changed

+22
-71
lines changed

6 files changed

+22
-71
lines changed

.github/workflows/clp-core-build-macos.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
strategy:
4646
matrix:
4747
os:
48+
- "macos-14"
4849
- "macos-15"
4950
use_shared_libs:
5051
- true

components/core/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# ystdlib requires CMake v3.23 or higher
22
cmake_minimum_required(VERSION 3.23)
33

4-
# Toolchain setup must come before the first project() call in the entire CMake buildsystem.
5-
# If CLP is not the top-level project, the following setup has no effect.
6-
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/utils.cmake")
7-
setup_toolchains()
8-
94
project(CLP LANGUAGES CXX C)
105

6+
# Toolchain validation
7+
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/utils.cmake")
8+
119
validate_compiler_versions()
1210

1311
# Include options for CLP build
@@ -295,8 +293,8 @@ endif()
295293

296294
# Add ystdlib
297295
if(CLP_NEED_YSTDLIB)
298-
set(YSTDLIB_CPP_BUILD_TESTING OFF)
299-
add_subdirectory("${CLP_YSTDLIB_SOURCE_DIRECTORY}" "${CMAKE_BINARY_DIR}/ystdlib" EXCLUDE_FROM_ALL)
296+
find_package(ystdlib REQUIRED)
297+
message(STATUS "Found ystdlib-cpp ${ystdlib_VERSION}")
300298
endif()
301299

302300
if(CLP_NEED_ZSTD)

components/core/cmake/Toolchains/llvm-clang-16-toolchain.cmake

Lines changed: 0 additions & 21 deletions
This file was deleted.

components/core/cmake/Toolchains/utils.cmake

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
1-
# This file contains utility functions for setting up toolchains and validating toolchain versions
2-
# to ensure compatibility with the C++20 features required by the project.
3-
4-
# Sets up the appropriate toolchain file based on the host system.
5-
function(setup_toolchains)
6-
# For macOS versions below 15, use the LLVM 16 Clang toolchain.
7-
if("Darwin" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}")
8-
execute_process(
9-
COMMAND
10-
"sw_vers" "--productVersion"
11-
OUTPUT_VARIABLE MACOS_VERSION
12-
OUTPUT_STRIP_TRAILING_WHITESPACE
13-
)
14-
if("${MACOS_VERSION}" VERSION_LESS "15")
15-
set(CMAKE_TOOLCHAIN_FILE
16-
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/llvm-clang-16-toolchain.cmake"
17-
CACHE STRING
18-
"Toolchain file"
19-
)
20-
endif()
21-
endif()
22-
endfunction()
1+
# This file contains utility functions for validating toolchain versions to ensure compatibility
2+
# with the C++20 features required by the project.
233

244
# Checks if the compiler ID and version meet the minimum requirements to support C++20 features
25-
# required by the project:
26-
# - AppleClang: version 16+
27-
# - Clang: version 16+
28-
# - GNU: version 11+
5+
# required by the project.
296
function(validate_compiler_versions)
307
if("AppleClang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
31-
set(CXX_COMPILER_MIN_VERSION "16")
8+
set(CXX_COMPILER_MIN_VERSION "15")
329
elseif("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
33-
set(CXX_COMPILER_MIN_VERSION "16")
10+
set(CXX_COMPILER_MIN_VERSION "15")
3411
elseif("GNU" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
3512
set(CXX_COMPILER_MIN_VERSION "11")
3613
else()

docs/src/dev-docs/components-core/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ CLP core is the low-level component that performs compression, decompression, an
88
* If you have trouble building for another OS, file an issue, and we may be able to help.
99
* A recent compiler that fully supports C++20 features such as
1010
* std::span
11-
* std::source_location
1211
* [CMake] >= 3.23.0 and < 4.0.0
1312
* Minimum version 3.23.0 is required for [yscope-dev-utils].
1413
* We constrain the version to < 4.0.0 due to [y-scope/clp#795].
@@ -58,7 +57,7 @@ The task will download, build, and install (within the build directory) the foll
5857
| [utfcpp](https://github.com/nemtrif/utfcpp) | v4.0.6 |
5958
| [yaml-cpp](https://github.com/jbeder/yaml-cpp) | v0.7.0 |
6059
| [yscope-log-viewer](https://github.com/y-scope/yscope-log-viewer) | 3abe4cc |
61-
| [ystdlib-cpp](https://github.com/y-scope/ystdlib-cpp) | d80cf86 |
60+
| [ystdlib-cpp](https://github.com/y-scope/ystdlib-cpp) | 9ed78cd |
6261
| [zlib](https://github.com/madler/zlib) | v1.3.1 |
6362
| [zstd](https://github.com/facebook/zstd) | v1.5.7 |
6463

taskfiles/deps/main.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -512,23 +512,20 @@ tasks:
512512

513513
ystdlib:
514514
internal: true
515-
vars:
516-
LIB_NAME: "ystdlib"
517-
YSTDLIB_OUTPUT_DIR: "{{.G_DEPS_CORE_DIR}}/{{.LIB_NAME}}-src"
518515
run: "once"
519516
deps:
520-
- task: "utils:init"
517+
- task: "boost"
521518
cmds:
522-
- task: "yscope-dev-utils:remote:download-and-extract-tar"
519+
- task: "utils:install-remote-cmake-lib"
523520
vars:
524-
CHECKSUM_FILE: "{{.G_DEPS_CORE_CHECKSUMS_DIR}}/{{.LIB_NAME}}.md5"
525-
FILE_SHA256: "36fa0e9d96b7307ca92482343d6ba1091c5576370676e6d423cce32c20e34a3d"
526-
OUTPUT_DIR: "{{.YSTDLIB_OUTPUT_DIR}}"
527-
URL: "https://github.com/y-scope/ystdlib-cpp/archive/d80cf86.tar.gz"
528-
- >-
529-
echo "set(
530-
CLP_YSTDLIB_SOURCE_DIRECTORY \"{{.YSTDLIB_OUTPUT_DIR}}\"
531-
)" > "{{.G_DEPS_CORE_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake"
521+
CMAKE_GEN_ARGS:
522+
- "-C {{.G_DEPS_CORE_CMAKE_SETTINGS_DIR}}/{{.G_BOOST_LIB_NAME}}.cmake"
523+
- "-DCMAKE_BUILD_TYPE=Release"
524+
- "-DCMAKE_INSTALL_MESSAGE=LAZY"
525+
- "-Dystdlib_BUILD_TESTING=OFF"
526+
LIB_NAME: "ystdlib"
527+
TARBALL_SHA256: "65990dc2bcc4a355c2181bfe31a7800f492309d1bcd340f52a34e85047e61bc8"
528+
TARBALL_URL: "https://github.com/y-scope/ystdlib-cpp/archive/9ed78cd.tar.gz"
532529

533530
zlib:
534531
internal: true

0 commit comments

Comments
 (0)