refactor: drop direct dependency on Boost.Spirit (graphviz parser) - #533
Conversation
|
Compiler-warning counts vs
|
|
Boost dependency footprint vs Header-inclusion weights (graph files pulling each direct dependency in):
Transitive Boost modules: 66 → 66 (0) |
6679ea9 to
0478c2d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
0478c2d to
4a49846
Compare
4a49846 to
233a8a4
Compare
mborland
left a comment
There was a problem hiding this comment.
LGTM. Very straightforward, and helps remove a heavy dependency.
233a8a4 to
9247030
Compare
jeremy-murphy
left a comment
There was a problem hiding this comment.
One pedantic post-merge request. :)
| #ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS | ||
| #define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS | ||
| BOOST_PRAGMA_MESSAGE( | ||
| "BOOST_GRAPH_USE_SPIRIT_PARSER is deprecated and no longer has any effect: " |
There was a problem hiding this comment.
"Deprecated" means that something still exists (and works) but its use is not recommended, so it's not really the right meaning here. I think that text can simply be removed.
| "BOOST_GRAPH_USE_SPIRIT_PARSER is deprecated and no longer has any effect: " | |
| "BOOST_GRAPH_USE_SPIRIT_PARSER no longer has any effect: " |
There was a problem hiding this comment.
You're right! Fixed in #584
I added a comment with deprecated and 1.95 because I will use this in a grep tag to track what must be removed in 1.95.
So, removing Boost.Spirit didn't actually remove our dependency on any transitive modules? |
|
Correct, and it was expected (see the Notes in the PR description), because as long as Boost.PropertyTree is still a direct dependency, it will pull both Boost.Spirit and Boost.Serialization into the transitive dependency chain (those two libs are 55/68 = 80% of the dependency chain weight) #547 Aims at getting rid of that, with additional benefits:
I am running benchmarks on project compilation times before/after dependencies removal as we speak (compile time dominated by transitive header count). The figure is still a bit shitty, but interesting and kinda confirms that graphviz pulls half the boost galaxy and motivated #566 :
|
For what part of the library exactly? Just for GraphML or more broadly? |

Before submitting
developbranch.Type of change
Does this PR introduce a breaking change?
What this PR does
graphviz.hpp: removed both Boost.Spirit code paths in the tworead_graphvizoverloads (they now always callread_graphviz_new)classic_multi_passSpirit include.BOOST_GRAPH_USE_SPIRIT_PARSERstill recognized, but now emits aBOOST_PRAGMA_MESSAGEdeprecation notice and redirects to the default parser instead of selecting Spirit.detail/read_graphviz_spirit.hpp(the Spirit DOT reader that pulled in 10boost/spiritheaders).test/isomorphism.cpp: removed the incidental#define BOOST_GRAPH_USE_SPIRIT_PARSERbuild.jamandCMakeLists.txtdropped thespiritdependency.Motivation
The spirit-based graphviz parser has been non default, undocumented and untested for 16 years.
The Boost.Spirit library has 28 direct boost dependencies, and 54 indirect, effectively dragging most of Boost in BGL: https://alandefreitas.github.io/boostdep_graph/libs/spirit.html
This PR removes its implementation, effectively dropping spirit dependency and its direct+transitive chain.
The default parser uses Boost.Regex, that has a much better dependency chain: https://alandefreitas.github.io/boostdep_graph/libs/regex.html
Note: spirit is not effectively removed from the transitive dependencies chain, as Boost.Serialization pulls it in.
A next PR will drop Boost.Serialization for Boost.Core.Serialization.
Note: Boost.Spirit has several dependants that Boost.Graph uses:
Testing
Checklist
b2in thetest/directory).