-
-
Notifications
You must be signed in to change notification settings - Fork 51
Full Rebuild (Sync) of August 2026: bump ros2-distro-mutex to 0.16.0 and build_number to 21 #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wolfv
wants to merge
28
commits into
main
Choose a base branch
from
full-rebuild-2026-08
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
124aa3c
Start August 2026 Jazzy full rebuild
wolfv 752d872
Refresh platform patches for updated sources
wolfv af739cd
Fix BehaviorTree.CPP build with Apple libc++
wolfv bfe66d2
Update migration pins and ARM smoke test
wolfv edc08d5
Apply jsoncpp 1.9.8 migration
wolfv 5ae53ef
Resume CI builds from cache
wolfv abfba6e
Keep Protobuf compatible with OpenCV
wolfv e6988a4
Require Protobuf 7 OpenCV builds
wolfv 307df6b
Fix OpenCV mutex match specs
wolfv 222b0fb
Use pre-HDF5-2 dependency stack
wolfv e93c1ad
Keep jsoncpp on pre-HDF5-2 stack
wolfv d726b43
Restore HDF5 2 dependency stack
wolfv 8895c07
Follow OpenCV FFmpeg 9 rebuild
wolfv b4fe92c
Retry with split GDAL Gazebo package
wolfv 96d5355
Map GDAL development dependency to core library
wolfv 464ca34
Remove deprecated packages from rosdistro configuration
Tobias-Fischer 787123f
Add navmap and easynav packages on Linux
traversaro 059caa1
Update dependencies.yaml with new hosts
traversaro 492a994
Add missing Qt dependency for swri_console
wolfv 5b4c1db
Address full rebuild review feedback
wolfv 473d73b
Drop upstreamed patches and constrain HDF5 ABI
wolfv 35755f3
Fix refreshed packages on Windows and Linux
wolfv d923f25
Support libmavconn with libc++ 19
wolfv 7ff0511
Fix swri_console signal macros on macOS
wolfv 69a78c9
Let the solver choose the coherent HDF5 stack
wolfv 9d4b735
Remove temporary mutex cache cleanup
wolfv d512b59
Disable temporary cache artifact uploads
wolfv e0638f1
Disable git maintenance during CI builds
wolfv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| diff --git a/include/behaviortree_cpp/basic_types.h b/include/behaviortree_cpp/basic_types.h | ||
| index eb4920b..eb89602 100644 | ||
| --- a/include/behaviortree_cpp/basic_types.h | ||
| +++ b/include/behaviortree_cpp/basic_types.h | ||
| @@ -175,6 +175,23 @@ template <> | ||
| template <> | ||
| [[nodiscard]] double convertFromString<double>(StringView str); | ||
|
|
||
| +/** | ||
| + * @brief Parse a double from a string using the semantics of | ||
| + * std::from_chars(std::chars_format::general): locale-independent (only '.' as | ||
| + * the decimal separator), rejecting leading whitespace, a leading '+', and hex | ||
| + * floats. Includes a thread-safe fallback for standard libraries that lack the | ||
| + * floating-point std::from_chars overload (e.g. Apple libc++). | ||
| + * | ||
| + * @param str the input string. | ||
| + * @param out set to the parsed value on success (left untouched on failure). | ||
| + * @param require_full_consumption when true, the whole string must be a valid | ||
| + * double (trailing characters cause failure); when false, parsing stops | ||
| + * at the first non-numeric character. | ||
| + * @return true on success. | ||
| + */ | ||
| +[[nodiscard]] bool parseDouble(StringView str, double& out, | ||
| + bool require_full_consumption); | ||
| + | ||
| // Integer numbers separated by the character ";" | ||
| template <> | ||
| [[nodiscard]] std::vector<int> convertFromString<std::vector<int>>(StringView str); | ||
| diff --git a/src/basic_types.cpp b/src/basic_types.cpp | ||
| index f7374ae..0c82b0d 100644 | ||
| --- a/src/basic_types.cpp | ||
| +++ b/src/basic_types.cpp | ||
| @@ -6,8 +6,16 @@ | ||
| #include <algorithm> | ||
| #include <array> | ||
| #include <charconv> | ||
| -#if __cpp_lib_to_chars < 201611L | ||
| -#include <clocale> | ||
| +// Apple's libc++ lacks the floating-point std::from_chars overload; parseDouble | ||
| +// falls back to strtod_l with a private "C" locale, which needs these headers. | ||
| +#if !defined(__cpp_lib_to_chars) || (__cpp_lib_to_chars < 201611L) | ||
| +#include <cctype> | ||
| +#include <cerrno> | ||
| + | ||
| +#include <locale.h> | ||
| +#if defined(__APPLE__) | ||
| +#include <xlocale.h> | ||
| +#endif | ||
| #endif | ||
| #include <cstdlib> | ||
| #include <cstring> | ||
| @@ -196,34 +204,88 @@ uint32_t convertFromString<uint32_t>(StringView str) | ||
| return ConvertWithBoundCheck<uint32_t>(str); | ||
| } | ||
|
|
||
| +bool parseDouble(StringView str, double& out, bool require_full_consumption) | ||
| +{ | ||
| +#if defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L) | ||
| + // std::from_chars is locale-independent and thread-safe. | ||
| + const char* begin = str.data(); | ||
| + const char* end = begin + str.size(); | ||
| + const auto [ptr, ec] = std::from_chars(begin, end, out); | ||
| + if(ec != std::errc()) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + return !require_full_consumption || ptr == end; | ||
| +#else | ||
| + // Apple's libc++ lacks the floating-point std::from_chars overload. Reproduce | ||
| + // its std::chars_format::general semantics with strtod_l under a "C" locale | ||
| + // created once (thread-safe, no global setlocale mutation), plus a guard that | ||
| + // rejects the leading whitespace, leading '+', and hex floats that strtod | ||
| + // would otherwise accept. | ||
| + if(str.empty()) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + const char first = str.front(); | ||
| + if(first == '+' || std::isspace(static_cast<unsigned char>(first)) != 0) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + // std::from_chars(general) does not recognise a "0x"/"0X" hex-float prefix; it | ||
| + // parses only the leading "0" and stops at the 'x'. strtod would consume the | ||
| + // whole hex float, so emulate from_chars here: the value is 0, and everything | ||
| + // from the 'x' onward is unparsed (a failure only in the full-consumption case). | ||
| + const std::size_t mantissa = (first == '-') ? 1u : 0u; | ||
| + if(str.size() > mantissa + 1 && str[mantissa] == '0' && | ||
| + (str[mantissa + 1] == 'x' || str[mantissa + 1] == 'X')) | ||
| + { | ||
| + if(require_full_consumption) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + out = (first == '-') ? -0.0 : 0.0; | ||
| + return true; | ||
| + } | ||
| + static ::locale_t c_locale = | ||
| + ::newlocale(LC_NUMERIC_MASK, "C", static_cast<::locale_t>(0)); | ||
| + if(c_locale == static_cast<::locale_t>(0)) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + // strtod_l needs a null-terminated buffer. | ||
| + const std::string buffer(str.data(), str.size()); | ||
| + errno = 0; | ||
| + char* parse_end = nullptr; | ||
| + const double value = ::strtod_l(buffer.c_str(), &parse_end, c_locale); | ||
| + if(parse_end == buffer.c_str() || errno == ERANGE) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + if(require_full_consumption && parse_end != buffer.c_str() + buffer.size()) | ||
| + { | ||
| + return false; | ||
| + } | ||
| + out = value; | ||
| + return true; | ||
| +#endif | ||
| +} | ||
| + | ||
| template <> | ||
| double convertFromString<double>(StringView str) | ||
| { | ||
| -#if __cpp_lib_to_chars >= 201611L | ||
| - // from_chars is locale-independent and thread-safe | ||
| double result = 0; | ||
| - const auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result); | ||
| - if(ec != std::errc()) | ||
| + if(!parseDouble(str, result, /*require_full_consumption=*/false)) | ||
| { | ||
| throw RuntimeError(StrCat("Can't convert string [", str, "] to double")); | ||
| } | ||
| return result; | ||
| -#else | ||
| - // Fallback: stod is locale-dependent, so force "C" locale. | ||
| - // See issue #120. Note: setlocale is not thread-safe. | ||
| - const std::string old_locale = setlocale(LC_NUMERIC, nullptr); | ||
| - std::ignore = setlocale(LC_NUMERIC, "C"); | ||
| - const std::string str_copy(str.data(), str.size()); | ||
| - const double val = std::stod(str_copy); | ||
| - std::ignore = setlocale(LC_NUMERIC, old_locale.c_str()); | ||
| - return val; | ||
| -#endif | ||
| } | ||
|
|
||
| template <> | ||
| float convertFromString<float>(StringView str) | ||
| { | ||
| #if __cpp_lib_to_chars >= 201611L | ||
| + // Parse directly as float to preserve std::from_chars<float> range semantics. | ||
| float result = 0; | ||
| const auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result); | ||
| if(ec != std::errc()) | ||
| @@ -232,12 +294,12 @@ float convertFromString<float>(StringView str) | ||
| } | ||
| return result; | ||
| #else | ||
| - const std::string old_locale = setlocale(LC_NUMERIC, nullptr); | ||
| - std::ignore = setlocale(LC_NUMERIC, "C"); | ||
| - const std::string str_copy(str.data(), str.size()); | ||
| - const double val = std::stod(str_copy); | ||
| - std::ignore = setlocale(LC_NUMERIC, old_locale.c_str()); | ||
| - return static_cast<float>(val); | ||
| + double result = 0; | ||
| + if(!parseDouble(str, result, /*require_full_consumption=*/false)) | ||
| + { | ||
| + throw RuntimeError(StrCat("Can't convert string [", str, "] to float")); | ||
| + } | ||
| + return static_cast<float>(result); | ||
| #endif | ||
| } | ||
|
|
||
| diff --git a/src/xml_parsing.cpp b/src/xml_parsing.cpp | ||
| index 73e06dc..132ebbf 100644 | ||
| --- a/src/xml_parsing.cpp | ||
| +++ b/src/xml_parsing.cpp | ||
| @@ -1189,8 +1189,7 @@ void BT::XMLParser::PImpl::recursivelyCreateSubtree( | ||
| if(!stored) | ||
| { | ||
| double dbl_val = 0; | ||
| - auto [ptr, ec] = std::from_chars(begin, end, dbl_val); | ||
| - if(ec == std::errc() && ptr == end) | ||
| + if(parseDouble(str_value, dbl_val, /*require_full_consumption=*/true)) | ||
| { | ||
| new_bb->set(attr_name, dbl_val); | ||
| stored = true; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a temporary workaround for CI, please remove.