Skip to content

Reduce backward-compatibility blast radius of the TestNode changes#1171

Closed
facontidavide wants to merge 2 commits into
masterfrom
compat/reduce-abi-blast-radius
Closed

Reduce backward-compatibility blast radius of the TestNode changes#1171
facontidavide wants to merge 2 commits into
masterfrom
compat/reduce-abi-blast-radius

Conversation

@facontidavide

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1169 that shrinks the remaining backward-compatibility impact of the TestNode rework, and makes sure the ABI break is signaled by the version number.

Restore TestNode source compatibility

  • Restore the transitive includes of script_parser.hpp and timer_queue.h in test_node.h (tagged IWYU pragma: keep). They had been part of this header since 4.x, so consumers using e.g. BT::ScriptFunction through it keep compiling.
  • Restore the protected _config member that subclasses have seen since TestNode was introduced, placed first in the class so it sits at the same byte offset as in 4.9.1. Only the internal machinery (script executors, timer, completed flag) stays behind the PImpl; any future state goes there.

Net effect: every pre-existing field of both TestNode and TestNodeConfig keeps its 4.9 byte offset; only sizeof grows, which is the irreducible part of the feature.

Bump version to 4.10.0

Master contains one-time ABI breaks (TestNodeConfig growth, TestNode and StatusChangeLogger PImpl) but still declared 4.9.1. Bumping the minor version prevents this from shipping as a patch release that package managers would treat as ABI-compatible.

Verification

  • Full build + all 510 tests pass (behaviortree_cpp_test)
  • clang-format / codespell clean

Not included (release-policy decisions)

  • The soname is unversioned (libbehaviortree_cpp.so, no SOVERSION), so an ABI-mismatched binary loads and corrupts silently instead of failing at load time. This release would be the cheapest moment to introduce a versioned soname, since consumers must relink anyway.
  • A migration note for the 4.10 release: recompile required; TestNode subclasses that touched members other than _config must migrate.

🤖 Generated with Claude Code

facontidavide and others added 2 commits July 17, 2026 13:10
The move of TestNode's state behind a PImpl (#1169) removed two things
that consumers may rely on:

- the transitive includes of script_parser.hpp and timer_queue.h, which
  test_node.h had always pulled in. Restore them (tagged IWYU keep) so
  code using e.g. BT::ScriptFunction through this header keeps compiling.

- the protected _config member, visible to subclasses since TestNode was
  introduced. Restore it as a direct member, first in the class so it
  also sits at the same byte offset as in 4.9. Only the internal
  machinery (executors, timer, completed flag) stays behind the PImpl;
  new state must be added there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The changes since 4.9.1 (TestNodeConfig gaining a field, TestNode and
StatusChangeLogger moving state behind a PImpl) are a one-time ABI break:
binaries built against 4.9 headers must be recompiled. Bump the minor
version so this cannot ship as a patch release that package managers
would treat as ABI-compatible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant