From eca3fb723501383fd719353bbfb81239fdafa2e8 Mon Sep 17 00:00:00 2001 From: landry Date: Wed, 20 Nov 2024 13:34:07 +0000 Subject: [PATCH] geo/osrm-backend: update to a newer commit to unbreak with boost 1.87. it still builds against the in-tree boost 1.84. cf https://github.com/Project-OSRM/osrm-backend/pull/6432 and https://github.com/Project-OSRM/osrm-backend/pull/7073 and https://github.com/Project-OSRM/osrm-backend/pull/6903 (mapbox variant removal) --- geo/osrm-backend/Makefile | 10 ++-- geo/osrm-backend/distinfo | 4 +- .../patches/patch-include_server_server_hpp | 17 +++++++ ...src_extractor_edge_based_graph_factory_cpp | 27 +++++----- .../patches/patch-src_extractor_extractor_cpp | 50 ++++++++++--------- ...patch-src_guidance_guidance_processing_cpp | 24 ++++----- ...ch-src_partitioner_recursive_bisection_cpp | 16 +++--- geo/osrm-backend/pkg/PLIST | 6 --- 8 files changed, 82 insertions(+), 72 deletions(-) create mode 100644 geo/osrm-backend/patches/patch-include_server_server_hpp diff --git a/geo/osrm-backend/Makefile b/geo/osrm-backend/Makefile index 305fca8e2050..9bb31d002eed 100644 --- a/geo/osrm-backend/Makefile +++ b/geo/osrm-backend/Makefile @@ -6,9 +6,8 @@ COMMENT = high-performance road network routing engine GH_ACCOUNT = Project-OSRM GH_PROJECT = osrm-backend -GH_COMMIT = 31e31a63d062fb804f5f4695ed3036ca7a269ead -REVISION = 2 -DISTNAME = osrm-backend-5.27.1pl0 +GH_COMMIT = d9ce9cf780777c96d74e0430b7c6f1dee6930f9a +DISTNAME = osrm-backend-5.27.1pl1 CATEGORIES = geo @@ -18,9 +17,8 @@ HOMEPAGE = https://project-osrm.org/ PERMIT_PACKAGE = Yes WANTLIB += ${COMPILER_LIBCXX} ${MODLUA_WANTLIB} -WANTLIB += boost_chrono-mt boost_date_time-mt boost_filesystem-mt -WANTLIB += boost_iostreams-mt boost_program_options-mt boost_regex-mt -WANTLIB += boost_system-mt boost_thread-mt bz2 c expat m tbb z +WANTLIB += boost_date_time-mt boost_iostreams-mt boost_program_options-mt +WANTLIB += boost_regex-mt boost_thread-mt bz2 c expat m tbb z COMPILER = base-clang ports-gcc diff --git a/geo/osrm-backend/distinfo b/geo/osrm-backend/distinfo index 906422bb62ba..7f410c645336 100644 --- a/geo/osrm-backend/distinfo +++ b/geo/osrm-backend/distinfo @@ -1,2 +1,2 @@ -SHA256 (osrm-backend-5.27.1pl0-31e31a63.tar.gz) = 1BCHnp2wPyF7Eiz9AZvfVrOBCsyGortUCnyilOqK7ns= -SIZE (osrm-backend-5.27.1pl0-31e31a63.tar.gz) = 11087133 +SHA256 (osrm-backend-5.27.1pl1-d9ce9cf7.tar.gz) = 0vrwee0MEK1JrC2Nx6S7set+j1KScVpFN/5GGNfoj2w= +SIZE (osrm-backend-5.27.1pl1-d9ce9cf7.tar.gz) = 11546328 diff --git a/geo/osrm-backend/patches/patch-include_server_server_hpp b/geo/osrm-backend/patches/patch-include_server_server_hpp new file mode 100644 index 000000000000..2fcc51ced554 --- /dev/null +++ b/geo/osrm-backend/patches/patch-include_server_server_hpp @@ -0,0 +1,17 @@ +https://github.com/Project-OSRM/osrm-backend/pull/7073 + +fix build with boost 1.87.0 + +Index: include/server/server.hpp +--- include/server/server.hpp.orig ++++ include/server/server.hpp +@@ -53,8 +53,7 @@ class Server + const auto port_string = std::to_string(port); + + boost::asio::ip::tcp::resolver resolver(io_context); +- boost::asio::ip::tcp::resolver::query query(address, port_string); +- boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); ++ boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(address, port_string).begin(); + + acceptor.open(endpoint.protocol()); + #ifdef SO_REUSEPORT diff --git a/geo/osrm-backend/patches/patch-src_extractor_edge_based_graph_factory_cpp b/geo/osrm-backend/patches/patch-src_extractor_edge_based_graph_factory_cpp index ab1d54af20b8..292a02bdee76 100644 --- a/geo/osrm-backend/patches/patch-src_extractor_edge_based_graph_factory_cpp +++ b/geo/osrm-backend/patches/patch-src_extractor_edge_based_graph_factory_cpp @@ -4,7 +4,7 @@ https://github.com/Project-OSRM/osrm-backend/pull/6493 Index: src/extractor/edge_based_graph_factory.cpp --- src/extractor/edge_based_graph_factory.cpp.orig +++ src/extractor/edge_based_graph_factory.cpp -@@ -32,7 +32,11 @@ +@@ -31,7 +31,11 @@ #include #include @@ -14,23 +14,21 @@ Index: src/extractor/edge_based_graph_factory.cpp #include +#endif - namespace std + namespace osrm::extractor { -@@ -582,8 +586,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( +@@ -569,7 +573,11 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( const constexpr unsigned GRAINSIZE = 100; // First part of the pipeline generates iterator ranges of IDs in sets of GRAINSIZE +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t> generator_stage( -+ tbb::filter::serial_in_order, [&](tbb::flow_control &fc) { +#else tbb::filter> generator_stage( - tbb::filter_mode::serial_in_order, [&](tbb::flow_control &fc) { +#endif - if (current_node < node_count) - { - auto next_node = std::min(current_node + GRAINSIZE, node_count); -@@ -721,8 +730,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( + tbb::filter_mode::serial_in_order, + [&](tbb::flow_control &fc) + { +@@ -713,8 +721,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( // // Edge-based-graph stage // @@ -41,10 +39,10 @@ Index: src/extractor/edge_based_graph_factory.cpp tbb::filter, EdgesPipelineBufferPtr> processor_stage( tbb::filter_mode::parallel, +#endif - [&](const tbb::blocked_range &intersection_node_range) { + [&](const tbb::blocked_range &intersection_node_range) + { auto buffer = std::make_shared(); - buffer->nodes_processed = intersection_node_range.size(); -@@ -1132,8 +1146,13 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( +@@ -1124,9 +1137,14 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( util::UnbufferedLog log; util::Percent routing_progress(log, node_count); std::vector delayed_data; @@ -53,8 +51,9 @@ Index: src/extractor/edge_based_graph_factory.cpp + tbb::filter::serial_in_order, [&](auto buffer) { +#else tbb::filter output_stage( - tbb::filter_mode::serial_in_order, [&](auto buffer) { + tbb::filter_mode::serial_in_order, + [&](auto buffer) +#endif + { routing_progress.PrintAddition(buffer->nodes_processed); - m_connectivity_checksum = buffer->checksum.update_checksum(m_connectivity_checksum); diff --git a/geo/osrm-backend/patches/patch-src_extractor_extractor_cpp b/geo/osrm-backend/patches/patch-src_extractor_extractor_cpp index fd09940565a7..613a5772ca3b 100644 --- a/geo/osrm-backend/patches/patch-src_extractor_extractor_cpp +++ b/geo/osrm-backend/patches/patch-src_extractor_extractor_cpp @@ -16,33 +16,35 @@ Index: src/extractor/extractor.cpp #include #include -@@ -445,8 +449,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip - ExtractionRelationContainer relations; +@@ -443,8 +447,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip - const auto buffer_reader = [](osmium::io::Reader &reader) { + const auto buffer_reader = [](osmium::io::Reader &reader) + { +#if TBB_VERSION_MAJOR == 2020 + return tbb::filter_t( -+ tbb::filter::serial_in_order, [&reader](tbb::flow_control &fc) { ++ tbb::filter::serial_in_order, +#else return tbb::filter( - tbb::filter_mode::serial_in_order, [&reader](tbb::flow_control &fc) { + tbb::filter_mode::serial_in_order, +#endif + [&reader](tbb::flow_control &fc) + { if (auto buffer = reader.read()) - { - return std::make_shared(std::move(buffer)); -@@ -467,15 +476,25 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip +@@ -467,8 +476,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip osmium_index_type location_cache; osmium_location_handler_type location_handler(location_cache); +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t location_cacher( -+ tbb::filter::serial_in_order, [&location_handler](SharedBuffer buffer) { ++ tbb::filter::serial_in_order, +#else tbb::filter location_cacher( - tbb::filter_mode::serial_in_order, [&location_handler](SharedBuffer buffer) { + tbb::filter_mode::serial_in_order, +#endif + [&location_handler](SharedBuffer buffer) + { osmium::apply(buffer->begin(), buffer->end(), location_handler); - return buffer; +@@ -476,8 +490,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip }); // OSM elements Lua parser @@ -54,23 +56,23 @@ Index: src/extractor/extractor.cpp tbb::filter_mode::parallel, +#endif // NOLINTNEXTLINE(performance-unnecessary-value-param) - [&](const SharedBuffer buffer) { - ParsedBuffer parsed_buffer; -@@ -496,8 +515,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip + [&](const SharedBuffer buffer) + { +@@ -499,8 +518,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip unsigned number_of_ways = 0; unsigned number_of_restrictions = 0; unsigned number_of_maneuver_overrides = 0; +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t buffer_storage( -+ tbb::filter::serial_in_order, [&](const ParsedBuffer &parsed_buffer) { ++ tbb::filter::serial_in_order, +#else tbb::filter buffer_storage( - tbb::filter_mode::serial_in_order, [&](const ParsedBuffer &parsed_buffer) { + tbb::filter_mode::serial_in_order, +#endif + [&](const ParsedBuffer &parsed_buffer) + { number_of_nodes += parsed_buffer.resulting_nodes.size(); - // put parsed objects thru extractor callbacks - for (const auto &result : parsed_buffer.resulting_nodes) -@@ -523,8 +547,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip +@@ -528,8 +552,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip } }); @@ -82,9 +84,9 @@ Index: src/extractor/extractor.cpp tbb::filter_mode::parallel, +#endif // NOLINTNEXTLINE(performance-unnecessary-value-param) - [&](const SharedBuffer buffer) { - if (!buffer) -@@ -561,8 +590,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip + [&](const SharedBuffer buffer) + { +@@ -567,8 +596,13 @@ Extractor::ParsedOSMData Extractor::ParseOSMData(Scrip }); unsigned number_of_relations = 0; @@ -96,5 +98,5 @@ Index: src/extractor/extractor.cpp tbb::filter_mode::serial_in_order, +#endif // NOLINTNEXTLINE(performance-unnecessary-value-param) - [&](const std::shared_ptr parsed_relations) { - number_of_relations += parsed_relations->GetRelationsNum(); + [&](const std::shared_ptr parsed_relations) + { diff --git a/geo/osrm-backend/patches/patch-src_guidance_guidance_processing_cpp b/geo/osrm-backend/patches/patch-src_guidance_guidance_processing_cpp index 39e3831335d3..dcd4b80c0e1f 100644 --- a/geo/osrm-backend/patches/patch-src_guidance_guidance_processing_cpp +++ b/geo/osrm-backend/patches/patch-src_guidance_guidance_processing_cpp @@ -16,20 +16,20 @@ Index: src/guidance/guidance_processing.cpp #include -@@ -97,8 +101,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & +@@ -95,8 +99,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & const constexpr unsigned GRAINSIZE = 100; // First part of the pipeline generates iterator ranges of IDs in sets of GRAINSIZE +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t> generator_stage( -+ tbb::filter::serial_in_order, [&](tbb::flow_control &fc) { ++ tbb::filter::serial_in_order, +#else tbb::filter> generator_stage( - tbb::filter_mode::serial_in_order, [&](tbb::flow_control &fc) { + tbb::filter_mode::serial_in_order, +#endif + [&](tbb::flow_control &fc) + { if (current_node < node_count) - { - auto next_node = std::min(current_node + GRAINSIZE, node_count); @@ -116,8 +125,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & // // Guidance stage @@ -41,20 +41,20 @@ Index: src/guidance/guidance_processing.cpp tbb::filter, TurnsPipelineBufferPtr> guidance_stage( tbb::filter_mode::parallel, +#endif - [&](const tbb::blocked_range &intersection_node_range) { + [&](const tbb::blocked_range &intersection_node_range) + { auto buffer = std::make_shared(); - buffer->nodes_processed = intersection_node_range.size(); -@@ -308,8 +322,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & +@@ -307,8 +321,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & util::Percent guidance_progress(log, node_count); std::vector delayed_turn_data; +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t guidance_output_stage( -+ tbb::filter::serial_in_order, [&](auto buffer) { ++ tbb::filter::serial_in_order, +#else tbb::filter guidance_output_stage( - tbb::filter_mode::serial_in_order, [&](auto buffer) { + tbb::filter_mode::serial_in_order, +#endif + [&](auto buffer) + { guidance_progress.PrintAddition(buffer->nodes_processed); - - connectivity_checksum = buffer->checksum.update_checksum(connectivity_checksum); diff --git a/geo/osrm-backend/patches/patch-src_partitioner_recursive_bisection_cpp b/geo/osrm-backend/patches/patch-src_partitioner_recursive_bisection_cpp index 45033d7bb6fb..49b8a4c5ead0 100644 --- a/geo/osrm-backend/patches/patch-src_partitioner_recursive_bisection_cpp +++ b/geo/osrm-backend/patches/patch-src_partitioner_recursive_bisection_cpp @@ -4,9 +4,9 @@ https://github.com/Project-OSRM/osrm-backend/pull/6493 Index: src/partitioner/recursive_bisection.cpp --- src/partitioner/recursive_bisection.cpp.orig +++ src/partitioner/recursive_bisection.cpp -@@ -64,12 +64,20 @@ RecursiveBisection::RecursiveBisection(BisectionGraph - return TreeNode{std::move(graph), internal_state.SCCDepth()}; - }); +@@ -65,12 +65,20 @@ RecursiveBisection::RecursiveBisection(BisectionGraph + return TreeNode{std::move(graph), internal_state.SCCDepth()}; + }); +#if TBB_VERSION_MAJOR == 2020 + using Feeder = tbb::parallel_do_feeder; @@ -18,10 +18,10 @@ Index: src/partitioner/recursive_bisection.cpp // Bisect graph into two parts. Get partition point and recurse left and right in parallel. +#if TBB_VERSION_MAJOR == 2020 -+ tbb::parallel_do(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) { ++ tbb::parallel_do( +#else - tbb::parallel_for_each(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) { + tbb::parallel_for_each( +#endif - const auto cut = - computeInertialFlowCut(node.graph, num_optimizing_cuts, balance, boundary_factor); - const auto center = internal_state.ApplyBisection( + begin(forest), + end(forest), + [&](const TreeNode &node, Feeder &feeder) diff --git a/geo/osrm-backend/pkg/PLIST b/geo/osrm-backend/pkg/PLIST index aa2e28002d00..e34e71eafb1d 100644 --- a/geo/osrm-backend/pkg/PLIST +++ b/geo/osrm-backend/pkg/PLIST @@ -8,12 +8,6 @@ @bin bin/osrm-extract @bin bin/osrm-partition @bin bin/osrm-routed -include/mapbox/ -include/mapbox/optional.hpp -include/mapbox/recursive_wrapper.hpp -include/mapbox/variant.hpp -include/mapbox/variant_io.hpp -include/mapbox/variant_visitor.hpp include/osrm/ include/osrm/approach.hpp include/osrm/bearing.hpp