From 35ca32eb5f32181e2bf63cb9625e14a8477a8c88 Mon Sep 17 00:00:00 2001 From: Arnaud Becheler <8360330+Becheler@users.noreply.github.com> Date: Fri, 24 Jul 2026 09:27:31 +0200 Subject: [PATCH 1/4] fix: teach cmake install-test to use Boost::headers for B2 installs --- test/cmake_test/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt index cb7c991..d42e169 100644 --- a/test/cmake_test/CMakeLists.txt +++ b/test/cmake_test/CMakeLists.txt @@ -9,7 +9,21 @@ project(cmake_subdir_test LANGUAGES CXX) # Those 2 should work the same # while using find_package for the installed Boost avoids the need to manually specify dependencies if(BOOST_CI_INSTALL_TEST) - find_package(boost_property_map REQUIRED) + # property_map is header-only. B2 does not install a per-library CMake config + # for header-only libraries, so consume the generic Boost::headers target and + # alias it to keep the target name consistent with the installed-by-CMake case. + if(BOOST_CI_INSTALLED_BY STREQUAL "B2") + find_package(Boost REQUIRED) + if(CMAKE_VERSION VERSION_LESS 3.18) + add_library(Boost_property_map INTERFACE) + target_link_libraries(Boost_property_map INTERFACE Boost::headers) + add_library(Boost::property_map ALIAS Boost_property_map) + else() + add_library(Boost::property_map ALIAS Boost::headers) + endif() + else() + find_package(boost_property_map REQUIRED) + endif() else() set(BOOST_INCLUDE_LIBRARIES property_map) add_subdirectory(../../../.. deps/boost EXCLUDE_FROM_ALL) From a179d260f9655b776ef453baee36116918831432 Mon Sep 17 00:00:00 2001 From: Arnaud Becheler <8360330+Becheler@users.noreply.github.com> Date: Fri, 24 Jul 2026 10:11:20 +0200 Subject: [PATCH 2/4] fix: remove intentional memory leak so sanitizer jobs pass CI --- test/dynamic_properties_test.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/test/dynamic_properties_test.cpp b/test/dynamic_properties_test.cpp index d78aa71..779d31a 100644 --- a/test/dynamic_properties_test.cpp +++ b/test/dynamic_properties_test.cpp @@ -27,27 +27,22 @@ #include // generate a dynamic_property_map that maps strings to strings -// WARNING: This code leaks memory. For testing purposes only! // WARNING: This code uses library internals. For testing purposes only! boost::shared_ptr string2string_gen(const std::string&, const boost::any&, const boost::any&) { - typedef std::map map_t; - typedef - boost::associative_property_map< std::map > - property_t; + using map_t = std::map; + using property_t = boost::associative_property_map; + using adaptor_t = boost::detail::dynamic_property_map_adaptor; + // property_t only views mymap, so the returned shared_ptr's deleter holds + // mymap to keep it alive as long as the adaptor. + std::shared_ptr mymap = std::make_shared(); + adaptor_t* adaptor = new adaptor_t(property_t(*mymap)); - map_t* mymap = new map_t(); // hint: leaky memory here! - - property_t property_map(*mymap); - - boost::shared_ptr pm( - new - boost::detail::dynamic_property_map_adaptor(property_map)); - - return pm; + return boost::shared_ptr( + adaptor, [mymap](boost::dynamic_property_map* p) { delete p; }); } From 668eb1fcf4ecddded0ee3a68ab820df95943ef96 Mon Sep 17 00:00:00 2001 From: Arnaud Becheler <8360330+Becheler@users.noreply.github.com> Date: Fri, 24 Jul 2026 12:40:38 +0200 Subject: [PATCH 3/4] fix: apply peter dimov review, using REQUIRED COMPONENTS --- test/cmake_test/CMakeLists.txt | 16 +--------------- test/suppressions.txt | 2 -- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 test/suppressions.txt diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt index d42e169..fd13ea7 100644 --- a/test/cmake_test/CMakeLists.txt +++ b/test/cmake_test/CMakeLists.txt @@ -9,21 +9,7 @@ project(cmake_subdir_test LANGUAGES CXX) # Those 2 should work the same # while using find_package for the installed Boost avoids the need to manually specify dependencies if(BOOST_CI_INSTALL_TEST) - # property_map is header-only. B2 does not install a per-library CMake config - # for header-only libraries, so consume the generic Boost::headers target and - # alias it to keep the target name consistent with the installed-by-CMake case. - if(BOOST_CI_INSTALLED_BY STREQUAL "B2") - find_package(Boost REQUIRED) - if(CMAKE_VERSION VERSION_LESS 3.18) - add_library(Boost_property_map INTERFACE) - target_link_libraries(Boost_property_map INTERFACE Boost::headers) - add_library(Boost::property_map ALIAS Boost_property_map) - else() - add_library(Boost::property_map ALIAS Boost::headers) - endif() - else() - find_package(boost_property_map REQUIRED) - endif() + find_package(Boost REQUIRED COMPONENTS property_map) else() set(BOOST_INCLUDE_LIBRARIES property_map) add_subdirectory(../../../.. deps/boost EXCLUDE_FROM_ALL) diff --git a/test/suppressions.txt b/test/suppressions.txt deleted file mode 100644 index e842f62..0000000 --- a/test/suppressions.txt +++ /dev/null @@ -1,2 +0,0 @@ -leak:dynamic_properties_test -leak:dynamic_properties_no_rtti_test From 3629aac51868498e1fca11097042d4365bdf48ad Mon Sep 17 00:00:00 2001 From: Arnaud Becheler <8360330+Becheler@users.noreply.github.com> Date: Fri, 24 Jul 2026 13:06:01 +0200 Subject: [PATCH 4/4] ci: retrigger