fix(pj_base): portable float parsing for libc++ (no std::from_chars)#99
Open
facontidavide wants to merge 3 commits into
Open
fix(pj_base): portable float parsing for libc++ (no std::from_chars)#99facontidavide wants to merge 3 commits into
facontidavide wants to merge 3 commits into
Conversation
|
Thank you for your contribution. Before we can merge it, please sign the Contributor License Agreement by posting a comment on this pull request with exactly the text below: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
0891eb1 to
8801a36
Compare
SettingsValue::toDouble instantiated std::from_chars<double>, a deleted overload in Apple Clang's libc++, which broke the macOS build of 0.4.1. Extract a reusable PJ::parseNumber<T> helper (pj_base/number_parse.hpp) that routes floating-point through std::strto* while keeping integers on std::from_chars, and have SettingsValue use it so plugins and PJ4 can reuse the same portable parse. Also add macOS and pre-commit CI workflows: core had Linux and Windows coverage but no macOS, which is why the libc++ break shipped unnoticed.
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
8801a36 to
5b29467
Compare
Contributor
Author
|
@copilot remove the CLA COMPLETELY from workflow and project in general, in this PR |
Done in commit |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SettingsValue::toDouble()instantiatedstd::from_chars<double>— a deleted overload in Apple Clang's libc++ — which broke the macOS build ofplotjuggler_core 0.4.1(pj_base/sdk/plugin_data_api.hpp,call to deleted function 'from_chars'). This surfaced downstream whenpj-official-pluginsPR #90 bumped to core0.4.1and macOS CI went red; core's own CI never caught it because there was no macOS workflow.Per maintainer feedback on this PR, CLA automation/docs added earlier in the branch were also removed from this PR.
Changes
pj_base/number_parse.hpp(new) — reusablePJ::parseNumber<T>(std::string_view) -> std::optional<T>. Parses the entire string (nullopt on empty / trailing garbage / overflow). IntegralTusesstd::from_chars; floating-pointTroutes throughstd::strto*(the libc++-portable path). Placed innamespace PJand auto-installed via the existinginstall(DIRECTORY include/), so plugins and PJ4 can reuse the same parse.SettingsValue::toInt/toDoublenow callparseNumber; the privateparse<T>is removed..github/workflows/macos-ci.yml(new) —macos-15-intel, conan + ninja, builds withwith_tests=Trueand runs ctest. Closes the macOS coverage gap..github/workflows/pre-commit.yml(new) — runs the existing.pre-commit-config.yaml(clang-format, etc.) on PRs..github/workflows/cla.ymlandCLA.mdso CLA is not part of this change set.Testing
-Werror: builds clean (0 errors),plugin_data_api_test+settings_store_host_testpass.pre-commit runpasses on all changed files.macos-ci.ymlon this PR.Follow-up
A patch release (e.g. 0.4.2) carrying this fix is needed before
pj-official-plugins#90 can go green on macOS.🤖 Generated with Claude Code