Skip to content

refactor: remove boost.spirit graphviz parser#533

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

refactor: remove boost.spirit graphviz parser#533
Becheler wants to merge 1 commit into
boostorg:developfrom
Becheler:refactor/drop-spirit-dependency

Conversation

@Becheler

@Becheler Becheler 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.

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

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 29571816126 vs develop run 29503421610 (41824dbab2).

Job Baseline After Delta
macos (clang, 14) 4 4 0
macos (clang, 17) 4 4 0
macos (clang, 20) 4 4 0
ubuntu (clang-19, 14) 4 4 0
ubuntu (clang-19, 17) 4 4 0
ubuntu (clang-19, 20) 4 4 0
ubuntu (clang-19, 23) 4 4 0
ubuntu (gcc-14, 14) 10 10 0
ubuntu (gcc-14, 17) 10 10 0
ubuntu (gcc-14, 20) 10 10 0
ubuntu (gcc-14, 23) 10 10 0
windows_msvc_14_3 (msvc-14.3) 971 971 0

@Becheler
Becheler marked this pull request as ready for review July 17, 2026 11:05
@Becheler
Becheler requested a review from jeremy-murphy as a code owner July 17, 2026 11:05
@github-actions

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 29571816085 vs develop run 29503421582 (41824dbab2).

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

Dependency develop PR Δ
spirit 2 0 -2
config 94 93 -1
core 13 12 -1
function 2 1 -1
property_map 79 78 -1
throw_exception 11 10 -1
type_traits 40 39 -1

Transitive Boost modules: 69 → 69 (0)

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

Labels

technical debt Code 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