|
2 | 2 | Changelog for package behaviortree_cpp |
3 | 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
4 | 4 |
|
| 5 | +Forthcoming |
| 6 | +----------- |
| 7 | +* reject trailing characters in SwitchNode numeric comparison (`#1178 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1178>`_) |
| 8 | +* Pin ament install destinations to lib/include/bin (fixes `#1175 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1175>`_) (`#1176 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1176>`_) |
| 9 | + The ROS build farm (bloom/debhelper) configures with |
| 10 | + -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since `#1152 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1152>`_ made the |
| 11 | + BTCPP\_*_DESTINATION variables honor GNUInstallDirs, farm binaries |
| 12 | + installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, |
| 13 | + which breaks ament_export_libraries lookup in downstream packages and is |
| 14 | + not on the LD_LIBRARY_PATH set by the ament environment hooks. |
| 15 | + Shadow the cache variables with plain set() in the ament build path, so |
| 16 | + ROS builds always install to $prefix/lib regardless of |
| 17 | + CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs |
| 18 | + override behavior introduced for `#1120 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1120>`_. |
| 19 | + Also add a ros2-lyrical CI job that emulates the build farm flags and |
| 20 | + asserts the library lands in $prefix/lib. |
| 21 | + Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
| 22 | +* fix out-of-bounds read in Groot2 hook insert handler (`#1170 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1170>`_) |
| 23 | + * fix out-of-bounds read in Groot2 hook insert handler |
| 24 | + * exclude Parallel.FailingParallel from macOS CI test run |
| 25 | +* Add scripted return status support for TestNode mocks (`#1169 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1169>`_) |
| 26 | + Introduce `return_status_script` on TestNodeConfig, allowing a mock's |
| 27 | + completion status to be computed at runtime from blackboard state instead |
| 28 | + of being fixed. When set, it takes precedence over `return_status`; it may |
| 29 | + reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it |
| 30 | + resolves to IDLE. |
| 31 | + The NodeStatus enum names are injected only into the return_status_script |
| 32 | + environment. The pre-existing success_script/failure_script/post_script |
| 33 | + continue to evaluate against the node's own enums, so a blackboard entry |
| 34 | + named like a status (e.g. "SUCCESS") is not shadowed. |
| 35 | + To pay the ABI break only once, TestNode's state is moved behind a PImpl, |
| 36 | + so future changes to it no longer alter the layout consumers link against |
| 37 | + (mirroring StatusChangeLogger). The new return_status_script field is |
| 38 | + appended at the end of TestNodeConfig, preserving the byte offsets of the |
| 39 | + existing fields. |
| 40 | + Also add JSON validation rejecting a TestNodeConfig with neither a |
| 41 | + return_status nor a return_status_script, and a tutorial example |
| 42 | + (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. |
| 43 | + Addresses `#995 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/995>`_. |
| 44 | + Co-authored-by: Pepe <pepe@ross-robotics.co.uk> |
| 45 | + Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
| 46 | +* Fix ROOT blackboard export in Groot2 publisher (`#1132 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1132>`_) (`#1168 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1168>`_) |
| 47 | + When a subtree's blackboard is backed by a separate root blackboard |
| 48 | + (e.g. created via `Blackboard::create(external_root)` to expose `@` |
| 49 | + globals), the Groot2 publisher never exported those root entries, so |
| 50 | + they were invisible in Groot2. Export the root blackboard under the |
| 51 | + reserved name `ROOT` whenever a requested subtree resolves to a |
| 52 | + distinct root blackboard. |
| 53 | + - Deduplicate the `ROOT` payload when several subtrees share the same |
| 54 | + root blackboard. |
| 55 | + - Return the dump as `Expected<>` and send an error reply for |
| 56 | + ambiguous requests: a subtree literally named `ROOT`, or a request |
| 57 | + spanning multiple distinct root blackboards. |
| 58 | + - Add functional coverage to gtest_groot2_publisher_integration.cpp |
| 59 | + using the shared Groot2Test helpers (makePublisher/Client). |
| 60 | + - Enable `/utf-8` for behaviortree_cpp_test on MSVC so the Unicode |
| 61 | + name-validation tests build on Windows. |
| 62 | + Closes `#1130 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1130>`_ |
| 63 | + Co-authored-by: magic-alt <zaqwerss@outlook.com> |
| 64 | + Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
| 65 | +* Add macOS CI and fix Apple libc++ build (`#1167 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1167>`_) |
| 66 | + * Add macOS build to CI |
| 67 | + Add a Conan + CMake workflow running on macos-latest (Apple Silicon, |
| 68 | + AppleClang + libc++). This exercises the Apple standard-library toolchain |
| 69 | + that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching |
| 70 | + Apple-specific breakage such as the missing floating-point std::from_chars. |
| 71 | + The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> |
| 72 | + cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the |
| 73 | + Windows job does. |
| 74 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 75 | + * Fix Apple libc++ build: guard floating-point std::from_chars |
| 76 | + Apple's libc++ deletes the floating-point std::from_chars overload (and |
| 77 | + undefines __cpp_lib_to_chars), so the unguarded double parse in |
| 78 | + recursivelyCreateSubtree fails to compile on macOS. This is the same code |
| 79 | + path the new cmake_macos.yml CI job exercises, so guard it here to keep that |
| 80 | + job green. |
| 81 | + Introduce parseDoubleStrict(), which uses std::from_chars where available and, |
| 82 | + where it is not (Apple libc++), falls back to strtod_l with a "C" locale |
| 83 | + created once. Unlike setlocale(), this does not mutate process-global state, |
| 84 | + so it is thread-safe. A small guard rejects the inputs strtod would accept but |
| 85 | + std::from_chars(general) rejects -- leading whitespace, a leading '+', and hex |
| 86 | + floats -- so the parsed blackboard-entry type is identical on every platform. |
| 87 | + Verified byte-for-byte against std::from_chars over a battery of inputs |
| 88 | + (including "+1.5", " 1.5", "0x1p4", "1.", ".5", inf/nan, overflow/underflow). |
| 89 | + The integer std::from_chars just above is available on Apple libc++ and is |
| 90 | + left unchanged. |
| 91 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 92 | + * CI: install Conan via Homebrew on macOS |
| 93 | + turtlebrowser/get-conan runs `pip3 install`, which fails on macOS runners with |
| 94 | + PEP 668 (externally-managed-environment). Use `brew install conan` instead, |
| 95 | + which provides Conan 2.x without touching the system Python. |
| 96 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 97 | + * Fix convertFromString<double/float> error type on Apple libc++ |
| 98 | + On platforms without floating-point std::from_chars (Apple libc++), the |
| 99 | + fallback used std::stod but let its std::invalid_argument/out_of_range escape, |
| 100 | + whereas the from_chars path throws BT::RuntimeError. This made |
| 101 | + BasicTypes.ConvertFromString_Double fail on macOS (it expects RuntimeError for |
| 102 | + "not_a_number"). The throw also skipped the setlocale restore, leaking the "C" |
| 103 | + locale process-wide. Wrap stod in try/catch: restore the locale and rethrow as |
| 104 | + RuntimeError on both success and failure paths. |
| 105 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 106 | + * CI: macOS diagnostics for remaining test failures (temporary) |
| 107 | + Add --output-on-failure and an lldb backtrace step (on failure) to capture |
| 108 | + assertion messages and stack traces for the macOS-only segfaults/timeouts. |
| 109 | + To be removed once those are fixed. |
| 110 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 111 | + * Fix macOS segfault: don't touch child in DelayNode destructor |
| 112 | + ~DelayNode called halt(), which via DecoratorNode::halt() -> resetChild() |
| 113 | + dereferences the child node (child_node\_->status()). During Tree destruction |
| 114 | + nodes are owned by a flat std::vector<TreeNode::Ptr> whose element-destruction |
| 115 | + order is unspecified: libstdc++ tears down front-to-back (child outlives the |
| 116 | + decorator) but libc++ back-to-front (child destroyed first). On libc++ (macOS) |
| 117 | + the child is already gone, so status() locks a mutex through a null PImpl and |
| 118 | + segfaults. This crashed every tree containing a <Delay> node on macOS |
| 119 | + (Decorator.DelayWithXML and the Substitution Issue930 tests). |
| 120 | + Only cancel the timer in the destructor, mirroring TimeoutNode's destructor, |
| 121 | + which already does exactly this. The halt() method is unchanged for normal |
| 122 | + (non-destruction) halting. |
| 123 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 124 | + * CI: retry timing-flaky tests on macOS (--repeat until-pass:3) |
| 125 | + The shared macOS runners cannot reliably meet several tests' tight wall-clock |
| 126 | + tolerances (e.g. elapsed 222 vs 200 ms), and the failing set varies run to run. |
| 127 | + Retry to absorb the flakiness without loosening assertions on other platforms. |
| 128 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 129 | + * tests: widen timing tolerances on macOS (platform-gated) |
| 130 | + The shared macOS CI runners are much slower/noisier than Linux/Windows, so a |
| 131 | + few tests with tight wall-clock tolerances fail there (not library bugs). Gate |
| 132 | + the tolerances behind __APPLE_\_ so other platforms keep the strict values: |
| 133 | + - gtest_coroutines: scale the sub-50ms action/timeout durations by 5x on macOS |
| 134 | + (only relative ordering matters), so the timeout reliably fires between the |
| 135 | + short and long actions instead of racing scheduling jitter. |
| 136 | + - gtest_parallel PauseWithRetry: widen margin_msec 80 -> 250 on macOS |
| 137 | + (observed overshoot was 130-150ms). |
| 138 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 139 | + * CI: bump macOS test retries to until-pass:5 |
| 140 | + A couple of timing tests (Parallel.Issue819, SwitchTest.CaseSwitchToDefault) |
| 141 | + are flaky under runner load rather than consistently over a single tolerance, |
| 142 | + so retry a bit more to absorb that. |
| 143 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 144 | + * CI: exclude timing-flaky tests on macOS; drop lldb diagnostic |
| 145 | + The shared macOS runners are too slow/noisy to reliably meet the tight |
| 146 | + wall-clock tolerances in ~11 tests (a rotating subset fails each run). They are |
| 147 | + not macOS-specific logic and keep running on Linux and Windows, so exclude them |
| 148 | + on macOS with ctest -E to make the job deterministic. --repeat until-pass:3 |
| 149 | + absorbs residual flakiness in the rest. The __APPLE_\_-gated tolerances added |
| 150 | + earlier (gtest_coroutines, gtest_parallel) remain so these can be re-enabled |
| 151 | + here later. |
| 152 | + Also remove the temporary lldb backtrace step now that the DelayNode |
| 153 | + destruction segfault is fixed. |
| 154 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 155 | + * Revert macOS timing-margin edits; rely on exclusion only |
| 156 | + Since the timing-sensitive tests are excluded on macOS (ctest -E), there is no |
| 157 | + reason to also widen their wall-clock tolerances. Restore gtest_coroutines.cpp |
| 158 | + and gtest_parallel.cpp to their original values so the shared tests stay |
| 159 | + pristine for every platform, and drop the stale workflow comment that mentioned |
| 160 | + the __APPLE_\_-gated tolerances. |
| 161 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 162 | + * Simplify: dedup convertFromString double/float Apple fallback |
| 163 | + /simplify cleanup. The macOS (no floating-point std::from_chars) fallback was |
| 164 | + duplicated between convertFromString<double> and <float>, each restoring the |
| 165 | + locale twice (catch + fall-through). Extract a single guarded file-local helper |
| 166 | + stodClassicLocale() with an RAII locale-restore, so the fallback lives in one |
| 167 | + place and the restore happens on every path without the duplicated try/catch. |
| 168 | + Behavior is unchanged (still stod under a temporary "C" locale, still throws |
| 169 | + RuntimeError on bad input). |
| 170 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 171 | + * Unify double parsing into a single BT::parseDouble primitive |
| 172 | + Previously the "parse a double locale-independently" logic existed in two |
| 173 | + divergent forms: xml_parsing.cpp's parseDoubleStrict (from_chars, or strtod_l + |
| 174 | + "C" locale on Apple libc++ -- thread-safe, strict) and basic_types.cpp's |
| 175 | + convertFromString<double>/<float> Apple fallback (stod + global setlocale -- |
| 176 | + thread-unsafe, lenient). They also disagreed on Apple: convertFromString |
| 177 | + accepted leading '+'/whitespace/hex that std::from_chars (and thus the other |
| 178 | + platforms) reject. |
| 179 | + Extract one shared BT::parseDouble(str, out, require_full_consumption) that both |
| 180 | + build on: |
| 181 | + - xml_parsing passes require_full_consumption=true (strict full-string check, |
| 182 | + so compound values like "2.2;2.4" stay strings). |
| 183 | + - convertFromString<double>/<float> pass false (lenient, matching the previous |
| 184 | + from_chars behavior of accepting trailing characters). |
| 185 | + The single implementation uses std::from_chars where available and the |
| 186 | + thread-safe strtod_l + static "C" locale fallback otherwise, reproducing |
| 187 | + from_chars(general) semantics exactly (verified against std::from_chars over a |
| 188 | + battery of inputs, both modes). This removes the duplicated fallback and the |
| 189 | + thread-unsafe setlocale path from basic_types.cpp. On Apple, convertFromString |
| 190 | + now rejects '+'/whitespace/hex, matching Linux/Windows. |
| 191 | + convertFromString<float> keeps std::from_chars<float> on platforms that have it |
| 192 | + (preserving float-range semantics) and uses parseDouble only on the fallback. |
| 193 | + Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
| 194 | + --------- |
| 195 | + Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
| 196 | +* test(test_node): cover script enum resolution (`#1166 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1166>`_) |
| 197 | +* Fix Groot2 publisher thread safety and hook handling (`#1165 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1165>`_) |
| 198 | + * Fix Groot2 publisher thread safety |
| 199 | + * Simplify Groot2 publisher thread-safety machinery |
| 200 | + Apply code-review cleanups to the thread-safety fix: |
| 201 | + - Extract the duplicated callback drain-gate (CallbackState/CallbackGuard |
| 202 | + and HookCallbackState/HookCallbackGuard were byte-identical) into a |
| 203 | + single shared BT::details::CallbackGate in utils/callback_gate.h. |
| 204 | + notify_all() now fires only when a drain is actually waiting. |
| 205 | + - Replace the 69-line injected hook lambda and its immediately-invoked |
| 206 | + inner lambda with PImpl::runHook(). The BREAKPOINT_REACHED message is |
| 207 | + now built and sent without holding hook->mutex, and only the ZMQ send |
| 208 | + holds publisher_mutex. |
| 209 | + - Drop the Hook::removed tombstone from the public protocol header: |
| 210 | + with the single lock order established (hooks_map_mutex before |
| 211 | + hook->mutex), enableAllHooks() and HOOKS_DUMP traverse the maps under |
| 212 | + hooks_map_mutex, so no stale snapshot can resurrect an erased hook and |
| 213 | + 'enabled = false' suffices for stale callback copies. |
| 214 | + - GET_TRANSITIONS: swap the transitions buffer out under status_mutex |
| 215 | + and serialize outside the lock the status callback contends on. |
| 216 | + - Call unsubscribeFromTreeChanges() in the destructors of the five other |
| 217 | + StatusChangeLogger subclasses; the base-class destructor call runs too |
| 218 | + late to protect derived state, so each dtor must drain callbacks first. |
| 219 | + - Deduplicate the hook-JSON literals in the Groot2 tests into |
| 220 | + Groot2Test::makeHook(); use make_unique for PImpl; rely on CTAD for |
| 221 | + lock guards in touched code. |
| 222 | + Verified: 495/495 tests (Release), 499/499 under TSan with the CI |
| 223 | + suppressions file, zero ThreadSanitizer warnings. |
| 224 | + Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
| 225 | + * Extend TSan suppressions to statically linked ZeroMQ |
| 226 | + CI builds zmq from source with Conan and links it statically, so the |
| 227 | + module-based rule 'race:libzmq.so' does not match and zmq-internal |
| 228 | + false positives (encoder_base_t::encode, msg_t::close) fail the |
| 229 | + Groot2 hook tests. Match the zmq namespace instead, which works |
| 230 | + regardless of how the library is linked. |
| 231 | + Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
| 232 | + * Move StatusChangeLogger state behind a PImpl |
| 233 | + StatusChangeLogger is the base class of a public extension point: every |
| 234 | + logger, including user-defined ones, embeds its layout. The thread-safety |
| 235 | + fix already changes that layout (and, being header-only, the old inlined |
| 236 | + implementation survives in consumer binaries even after a library |
| 237 | + upgrade), so take the opportunity to pay the ABI break only once: |
| 238 | + - all data members move into a PImpl defined in the new |
| 239 | + src/loggers/abstract_logger.cpp |
| 240 | + - the member functions are no longer inline, so future behavior fixes in |
| 241 | + this class can ship as an ABI-compatible library update |
| 242 | + Adding or changing state in StatusChangeLogger no longer affects the |
| 243 | + layout derived classes compile against. Note that changing its virtual |
| 244 | + interface would still break ABI. |
| 245 | + Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
| 246 | + --------- |
| 247 | + Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
| 248 | +* fix undefined float-to-integer cast at the numeric limit boundary (`#1162 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1162>`_) |
| 249 | +* fix out-of-bounds read in isBlackboardPointer whitespace trim (`#1161 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1161>`_) |
| 250 | + Co-authored-by: Davide Faconti <davide.faconti@gmail.com> |
| 251 | +* Fix package share path API for newer ament_index_cpp (`#1163 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1163>`_) |
| 252 | + * Fix package share path API for newer ament_index_cpp |
| 253 | + * Style: format package share path update |
| 254 | + --------- |
| 255 | + Co-authored-by: Davide Faconti <davide.faconti@gmail.com> |
| 256 | +* Fix WakeUp test flakiness by using steady_clock (`#1164 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1164>`_) |
| 257 | + The `WakeUp.BasicTest` previously used `system_clock`, which is not monotonic and can be affected by system time adjustments (NTP, DST). This made the test susceptible to flaky failures. |
| 258 | + This change switches to `steady_clock` for robust, monotonic time measurement. Additionally, the assertion threshold is increased from `25ms` to `100ms` to provide adequate headroom for scheduler jitter, especially on loaded CI environments. |
| 259 | +* Contributors: Aysha Afrah Ziya, Davide Faconti, Maurice Alexander Purnawan, pepeRossRobotics |
| 260 | + |
5 | 261 | 4.9.1 (2026-07-06) |
6 | 262 | ------------------ |
7 | 263 | * Merge pull request `#1139 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/1139>`_ from mini-1235/patch-3 |
|
0 commit comments