1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
From 2940938b8c059f683109ef8aa3bb098ac6f998b8 Mon Sep 17 00:00:00 2001
From: Kefu Chai <tchaikov@gmail.com>
Date: Wed, 24 Dec 2025 11:35:18 +0800
Subject: [PATCH] cmake: remove Boost::system linkage for boost 1.89+
In boost 1.89, the stub compiled library for Boost.System was removed.
According to the boost 1.89 release notes: "The stub compiled library
has been removed; System has been header-only since release 1.69.",
See https://www.boost.org/releases/1.89.0/ .
This change removes or replaces Boost::system linkage throughout the
codebase:
1. Removed "system" from BOOST_COMPONENTS in the root CMakeLists.txt,
as the library no longer exists in boost 1.89+.
2. Where Boost::system was the only linked boost library, replaced it
with Boost::boost (the header-only meta-target) to maintain access
to Boost.System's header-only functionality.
3. Where other boost libraries were already linked (e.g., Boost::thread,
Boost::regex, Boost::filesystem), removed Boost::system entirely, as
the header-only System library dependency is automatically satisfied
by other boost components.
This is not a breaking change since the minimum required boost version
for this project is 1.87, where Boost.System was already header-only
(only the stub compiled library remained for compatibility).
Signed-off-by: Kefu Chai <kchai@redhat.com>
---
CMakeLists.txt | 2 +-
src/CMakeLists.txt | 1 -
src/test/common/CMakeLists.txt | 24 ++++++++++++------------
src/test/lazy-omap-stats/CMakeLists.txt | 2 +-
src/test/mon/CMakeLists.txt | 2 +-
src/test/neorados/CMakeLists.txt | 2 +-
6 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abb0e725ff881..0e0cb08a27a94 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -741,7 +741,7 @@ option(WITH_SYSTEM_BOOST "require and build with system Boost" OFF)
# Boost::thread depends on Boost::atomic, so list it explicitly.
set(BOOST_COMPONENTS
- atomic chrono thread system regex random program_options date_time
+ atomic chrono headers thread regex random program_options date_time
iostreams context coroutine url)
set(BOOST_HEADER_COMPONENTS container)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7a4a8acc5df0d..871d0aee18c77 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -588,7 +588,6 @@ set(ceph_common_deps
common_utf8 extblkdev arch crc32
${LIB_RESOLV}
Boost::thread
- Boost::system
Boost::random
Boost::program_options
Boost::date_time
diff --git a/src/test/common/CMakeLists.txt b/src/test/common/CMakeLists.txt
index 50ebf9166c123..c2190d7e9813e 100644
--- a/src/test/common/CMakeLists.txt
+++ b/src/test/common/CMakeLists.txt
@@ -379,44 +379,44 @@ add_ceph_unittest(unittest_hobject)
add_executable(unittest_async_completion test_async_completion.cc)
add_ceph_unittest(unittest_async_completion)
-target_link_libraries(unittest_async_completion ceph-common Boost::system)
+target_link_libraries(unittest_async_completion ceph-common Boost::headers)
add_executable(unittest_async_max_concurrent_for_each test_async_max_concurrent_for_each.cc)
add_ceph_unittest(unittest_async_max_concurrent_for_each)
-target_link_libraries(unittest_async_max_concurrent_for_each ceph-common Boost::system Boost::context)
+target_link_libraries(unittest_async_max_concurrent_for_each ceph-common Boost::boost Boost::context)
if(NOT WIN32)
add_executable(unittest_async_co_spawn_group test_async_co_spawn_group.cc)
add_ceph_unittest(unittest_async_co_spawn_group)
-target_link_libraries(unittest_async_co_spawn_group ceph-common Boost::system)
+target_link_libraries(unittest_async_co_spawn_group ceph-common Boost::boost)
add_executable(unittest_async_co_throttle test_async_co_throttle.cc)
add_ceph_unittest(unittest_async_co_throttle)
-target_link_libraries(unittest_async_co_throttle ceph-common Boost::system)
+target_link_libraries(unittest_async_co_throttle ceph-common Boost::boost)
endif(NOT WIN32)
add_executable(unittest_async_shared_mutex test_async_shared_mutex.cc)
add_ceph_unittest(unittest_async_shared_mutex)
-target_link_libraries(unittest_async_shared_mutex ceph-common Boost::system)
+target_link_libraries(unittest_async_shared_mutex ceph-common Boost::boost)
add_executable(unittest_async_spawn_throttle test_async_spawn_throttle.cc)
add_ceph_unittest(unittest_async_spawn_throttle)
-target_link_libraries(unittest_async_spawn_throttle ceph-common Boost::system Boost::context)
+target_link_libraries(unittest_async_spawn_throttle ceph-common Boost::boost Boost::context)
add_executable(unittest_async_yield_waiter test_async_yield_waiter.cc)
add_ceph_unittest(unittest_async_yield_waiter)
-target_link_libraries(unittest_async_yield_waiter ceph-common Boost::system Boost::context)
+target_link_libraries(unittest_async_yield_waiter ceph-common Boost::boost Boost::context)
add_executable(unittest_async_parallel_for_each test_async_parallel_for_each.cc)
add_ceph_unittest(unittest_async_parallel_for_each)
-target_link_libraries(unittest_async_parallel_for_each ceph-common Boost::system)
+target_link_libraries(unittest_async_parallel_for_each ceph-common Boost::boost)
add_executable(unittest_async_spawn_group test_async_spawn_group.cc)
add_ceph_unittest(unittest_async_spawn_group)
-target_link_libraries(unittest_async_spawn_group ceph-common Boost::system)
+target_link_libraries(unittest_async_spawn_group ceph-common Boost::boost)
add_executable(unittest_cdc test_cdc.cc
$<TARGET_OBJECTS:unit-main>)
@@ -437,7 +437,7 @@ add_ceph_unittest(unittest_fault_injector)
add_executable(unittest_blocked_completion test_blocked_completion.cc)
add_ceph_unittest(unittest_blocked_completion)
-target_link_libraries(unittest_blocked_completion Boost::system GTest::GTest)
+target_link_libraries(unittest_blocked_completion Boost::boost GTest::GTest)
add_executable(unittest_allocate_unique test_allocate_unique.cc)
add_ceph_unittest(unittest_allocate_unique)
@@ -492,14 +492,14 @@ set_tests_properties(unittest_decode_start_v_checker_expect_failure
endif(0)
add_executable(unittest_async_call test_async_call.cc)
-target_link_libraries(unittest_async_call ceph-common Boost::system
+target_link_libraries(unittest_async_call ceph-common Boost::boost
GTest::GTest)
add_ceph_unittest(unittest_async_call)
add_executable(unittest_librados_completion test_librados_completion.cc)
target_link_libraries(unittest_librados_completion librados ceph-common
- Boost::system GTest::GTest)
+ Boost::boost GTest::GTest)
add_ceph_unittest(unittest_librados_completion)
add_executable(unittest_async_cond test_async_cond.cc)
diff --git a/src/test/lazy-omap-stats/CMakeLists.txt b/src/test/lazy-omap-stats/CMakeLists.txt
index 2143a092f27e8..93ddc03a248cd 100644
--- a/src/test/lazy-omap-stats/CMakeLists.txt
+++ b/src/test/lazy-omap-stats/CMakeLists.txt
@@ -4,7 +4,7 @@ add_executable(ceph_test_lazy_omap_stats
main.cc
lazy_omap_stats_test.cc)
target_link_libraries(ceph_test_lazy_omap_stats
- librados Boost::system Boost::regex ceph-common ${UNITTEST_LIBS})
+ librados Boost::regex ceph-common ${UNITTEST_LIBS})
install(TARGETS
ceph_test_lazy_omap_stats
DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/test/mon/CMakeLists.txt b/src/test/mon/CMakeLists.txt
index 8c271407e9828..5601ca4b890fe 100644
--- a/src/test/mon/CMakeLists.txt
+++ b/src/test/mon/CMakeLists.txt
@@ -57,7 +57,7 @@ target_link_libraries(unittest_mon_montypes mon global)
# ceph_test_mon_memory_target
add_executable(ceph_test_mon_memory_target
test_mon_memory_target.cc)
-target_link_libraries(ceph_test_mon_memory_target Boost::system Threads::Threads)
+target_link_libraries(ceph_test_mon_memory_target Boost::boost Threads::Threads)
set_target_properties(ceph_test_mon_memory_target PROPERTIES
SKIP_RPATH TRUE
INSTALL_RPATH "")
diff --git a/src/test/neorados/CMakeLists.txt b/src/test/neorados/CMakeLists.txt
index 968ef609cdca7..f5f63e18b1c6a 100644
--- a/src/test/neorados/CMakeLists.txt
+++ b/src/test/neorados/CMakeLists.txt
@@ -11,7 +11,7 @@ target_link_libraries(ceph_test_neorados_start_stop global libneorados
${unittest_libs})
add_executable(ceph_test_neorados_completions completions.cc)
-target_link_libraries(ceph_test_neorados_completions Boost::system pthread
+target_link_libraries(ceph_test_neorados_completions Boost::boost pthread
${unittest_libs})
add_executable(ceph_test_neorados_op_speed op_speed.cc)
|