Reducing dependency on Boost.Regex

A quick note on our experience reducing dependency on Boost.Regex (and thus ICU) in build2 packages for Boost 1.81.0. Now only the following (leaf) libraries unconditionally depend on Boost.Regex: * Boost.Convert * Boost.DLL * Boost.Log While the following libraries now have an optional (direct or indirect) dependency (follow the link for details on what functionality is now optional and how to enable it): * Boost.Algorithm[1] * Boost.Asio[2] * Boost.Graph[3] * Boost.Iostreams[4] * Boost.Range[5] * Boost.Spirit[6] To achieve this we had to make the following two changes: 1. Make functionality that requires regex optional. This change was made in all the above-mentioned libraries. In all the cases except Boost.Spirit and arguably Boost.Graph, the regex-based functionality was fairly marginal and making it optional feels like a reasonable trade off. 2. Split Boost.Spirit into three logical "components", all optional: classic, v2, and x3. The rationale here is that only the classic component can be reasonably easily made to work without regex. And classic without regex is what's required by Boost.Serialization (we had to deal with Boost.Serialization because it is a dependency of the majority of Boost libraries). We only had to patch Boost.Graph and are working[7] to upstream our changes. Overall, while this required some effort, it's definitely achievable given appropriate tools (mainly support for dependency configuration in the package manager). [1] https://github.com/build2-packaging/boost/blob/master/downstream/libs/algori... [2] https://github.com/build2-packaging/boost/blob/master/downstream/libs/asio/P... [3] https://github.com/build2-packaging/boost/blob/master/downstream/libs/graph/... [4] https://github.com/build2-packaging/boost/blob/master/downstream/libs/iostre... [5] https://github.com/build2-packaging/boost/blob/master/downstream/libs/range/... [6] https://github.com/build2-packaging/boost/blob/master/downstream/libs/spirit... [7] https://github.com/boostorg/graph/issues/326
participants (1)
-
Boris Kolpackov