Skip to content

refactor: drop direct dependency on Boost.Spirit (graphviz parser) - #533

Open
Becheler wants to merge 1 commit into
boostorg:developfrom
Becheler:refactor/drop-spirit-dependency
Open

refactor: drop direct dependency on Boost.Spirit (graphviz parser)#533
Becheler wants to merge 1 commit into
boostorg:developfrom
Becheler:refactor/drop-spirit-dependency

Conversation

@Becheler

@BechelerBecheler commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Before submitting

  • This PR targets the develop branch.
  • I searched for an existing PR or issue covering the same change.
  • My contribution is licensed under the Boost Software License 1.0.

Type of change

  • Bug fix
  • New feature or API addition
  • Refactor (no behavior change)
  • Documentation
  • Build, CI, or tooling
  • Other (specify below)

Does this PR introduce a breaking change?

  • Yes (describe migration impact below)
  • No

What this PR does

  • graphviz.hpp: removed both Boost.Spirit code paths in the two read_graphviz overloads (they now always call read_graphviz_new)
  • dropped the unconditional classic_multi_pass Spirit include.
  • BOOST_GRAPH_USE_SPIRIT_PARSER still recognized, but now emits a BOOST_PRAGMA_MESSAGE deprecation notice and redirects to the default parser instead of selecting Spirit.
  • Deleted detail/read_graphviz_spirit.hpp (the Spirit DOT reader that pulled in 10 boost/spirit headers).
  • test/isomorphism.cpp: removed the incidental #define BOOST_GRAPH_USE_SPIRIT_PARSER
  • build.jam and CMakeLists.txt dropped the spirit dependency.

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.

Testing

Checklist

  • Existing tests pass (b2 in the test/ directory).
  • New behavior is covered by a test, or this is a docs / build / refactor change.
  • Documentation was updated if user-facing behavior changed.
  • No new compiler warnings on the platforms I built against.

@BechelerBecheler self-assigned this Jul 17, 2026
@BechelerBecheler added the technical debt Code that works but needs refactoring, cleanup, or modernization. Not user-facing. label Jul 17, 2026
@github-actions

github-actionsBot commented Jul 17, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 31210846512 vs develop run 31207793516 (0478c2d0d5).

JobBaselineAfterDelta
macos (clang, 14)6816810
macos (clang, 17)6416410
macos (clang, 20)6416410
ubuntu (clang-19, 14)6816810
ubuntu (clang-19, 17)6416410
ubuntu (clang-19, 20)6416410
ubuntu (clang-19, 23)6416410
ubuntu (gcc-14, 14)8278270
ubuntu (gcc-14, 17)9499490
ubuntu (gcc-14, 20)9499490
ubuntu (gcc-14, 23)9499490
windows_msvc_14_3 (msvc-14.3)9719710

@Becheler
Becheler marked this pull request as ready for review July 17, 2026 11:05
@github-actions

github-actionsBot commented Jul 17, 2026

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 31210846404 vs develop run 31207793080 (0478c2d0d5).

Header-inclusion weights (graph files pulling each direct dependency in):

DependencydevelopPRΔ
spirit20-2
config9493-1
core1312-1
function21-1
property_map7978-1
throw_exception1110-1
type_traits4140-1

Transitive Boost modules: 68 → 68 (0)

@BechelerBecheler changed the title refactor: remove boost.spirit graphviz parserrefactor: drop dependency on Boost.Spirit (graphviz parser)Jul 21, 2026
@BechelerBecheler changed the title refactor: drop dependency on Boost.Spirit (graphviz parser)refactor: drop direct dependency on Boost.Spirit (graphviz parser)Jul 21, 2026
@Becheler
Bechelerforce-pushed the refactor/drop-spirit-dependency branch from 41824db to 6679ea9CompareAugust 5, 2026 07:26
@Becheler
Bechelerforce-pushed the refactor/drop-spirit-dependency branch from 6679ea9 to 0478c2dCompareAugust 7, 2026 19:17
@codecov

codecovBot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (e8e3f01) to head (0478c2d).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@## develop #533 +/- ##
===========================================
+ Coverage 92.45% 92.66% +0.20% 
===========================================
Files 392 391 -1 Lines 28214 28007 -207 Branches 8008 7916 -92 ===========================================
- Hits 26086 25953 -133 + Misses 2024 1951 -73 + Partials 104 103 -1 
Files with missing linesCoverage Δ
include/boost/graph/graphviz.hpp96.44% <ø> (-0.06%)⬇️
test/isomorphism.cpp64.59% <ø> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d8dc81...0478c2d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical debtCode that works but needs refactoring, cleanup, or modernization. Not user-facing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Becheler