From 21a2a00de258e4a12a4788fb238b3d2e0bb2c43a Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Fri, 10 Jul 2026 18:08:12 +0200 Subject: [PATCH] fix(sdk): correct the Apple to_chars guard macro spelling + release 0.16.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0.16.1's fallback guard checked __ENVIRONMENT_MACOS_VERSION_MIN_REQUIRED__, which does not exist — clang defines __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ (verified against clang's OSTargets.cpp) — so defined(...) was always false and every Apple build still hit the unavailable FP std::to_chars (CCI round 3 failed at the same line). The guard now uses the correct macro and is fail-safe: any Apple target not provably macOS >= 13.3 takes the snprintf path. Verified by preprocessing the header's exact #if line under deployment targets 13.0/13.3/26.0/undefined/non-Apple — fallback engages exactly when it should. PATCH bump 0.16.1 -> 0.16.2; CCI staging recipe re-seeded at 0.16.2 (placeholder sha256 until the tag exists). Build (debug+ASAN) + 49/49 tests pass. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 15 +++++++++++++++ CMakeLists.txt | 2 +- conanfile.py | 7 +++++-- packaging/conan-center-index/README.md | 17 +++++++++-------- .../recipes/plotjuggler_sdk/all/conandata.yml | 18 ++++++++++-------- .../recipes/plotjuggler_sdk/config.yml | 2 +- .../include/pj_base/sdk/plugin_data_api.hpp | 9 ++++++--- recipe.yaml | 2 +- 8 files changed, 48 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ed721d..4dec188 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to `plotjuggler_sdk` are recorded here. Versioning policy is in [`CLAUDE.md`](./CLAUDE.md) → "Release Versioning". +## [0.16.2] + +### Fix: 0.16.1's Apple `to_chars` guard tested a misspelled macro and never engaged (PATCH) + +The 0.16.1 fallback guard checked `__ENVIRONMENT_MACOS_VERSION_MIN_REQUIRED__`, +which does not exist — the compiler defines +`__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__` (verified against clang's +`OSTargets.cpp`) — so `defined(...)` was always false and every Apple build +still compiled the floating-point `std::to_chars` path. The guard now uses the +correct macro and is fail-safe: any Apple target not provably macOS ≥ 13.3 +(including non-macOS Apple platforms, which spell the macro differently) takes +the `snprintf` fallback. Guard behavior verified by preprocessing the header's +exact `#if` line under deployment targets 13.0 / 13.3 / 26.0 / undefined / +non-Apple. + ## [0.16.1] ### Fix: double formatting in `plugin_data_api.hpp` on older Apple deployment targets (PATCH) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e67d40..094e4b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,7 @@ endif() if(PJ_INSTALL_SDK) include(CMakePackageConfigHelpers) - set(PJ_PACKAGE_VERSION "0.16.1") + set(PJ_PACKAGE_VERSION "0.16.2") set(PJ_PACKAGE_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/plotjuggler_sdk) install(EXPORT plotjuggler_sdkTargets diff --git a/conanfile.py b/conanfile.py index 73a9296..a9d1ad1 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,7 +6,7 @@ plugin_sdk — umbrella for plugin authors (base + dialog SDK + parser SDK) plugin_host — umbrella for host loaders (data_source/parser/toolbox/dialog) -A consuming Conan recipe declares e.g. `plotjuggler_sdk/0.16.1` and then: +A consuming Conan recipe declares e.g. `plotjuggler_sdk/0.16.2` and then: find_package(plotjuggler_sdk REQUIRED COMPONENTS plugin_sdk) target_link_libraries(my_plugin PRIVATE plotjuggler_sdk::plugin_sdk) @@ -47,7 +47,10 @@ class PlotjugglerSdkConan(ConanFile): # 0.16.1 fixes plugin_data_api.hpp double formatting on Apple deployment # targets older than macOS 13.3 (FP std::to_chars unavailable there) — # PATCH, installed-header bug fix. See CHANGELOG.md. - version = "0.16.1" + # 0.16.2 fixes 0.16.1's guard, which tested a misspelled macro + # (__ENVIRONMENT_MACOS_... instead of __ENVIRONMENT_MAC_OS_X_...) and + # never engaged — PATCH. See CHANGELOG.md. + version = "0.16.2" # Apache-2.0 covers the whole SDK (pj_base + pj_plugins). See LICENSE. license = "Apache-2.0" url = "https://github.com/PlotJuggler/plotjuggler_sdk" diff --git a/packaging/conan-center-index/README.md b/packaging/conan-center-index/README.md index 8b9ff48..e8a7040 100644 --- a/packaging/conan-center-index/README.md +++ b/packaging/conan-center-index/README.md @@ -22,7 +22,7 @@ tree for local dev/consume. The CCI recipe instead downloads the released ## Prerequisites before submitting -The recipe is seeded with **`0.16.1`** — the first tag that satisfies these: +The recipe is seeded with **`0.16.2`** — the first tag that satisfies these: 1. **The `-Werror` gate ships in the consumed tag.** The recipe sets `-DPJ_WARNINGS_AS_ERRORS=OFF` so a not-yet-pinned compiler on CCI's build @@ -35,8 +35,9 @@ The recipe is seeded with **`0.16.1`** — the first tag that satisfies these: "no breaking changes within 0.x" promise for CCI consumers. 3. **The tag builds on CCI's macOS deployment target.** CCI's macOS builders target below 13.3, where libc++ marks the floating-point `std::to_chars` - overloads unavailable — `v0.16.0` failed there (`plugin_data_api.hpp`). - `0.16.1` adds the `snprintf` fallback. + overloads unavailable — `v0.16.0` failed there (`plugin_data_api.hpp`), and + `v0.16.1`'s fallback guard misspelled the availability macro and never + engaged. `0.16.2` carries the working `snprintf` fallback. 4. **Confirm dependencies exist in CCI** (verified 2026-07-01, all present): `nlohmann_json/3.12.0`, `fmt/12.1.0`, `fast_float/8.1.0`. @@ -57,10 +58,10 @@ cd recipes/plotjuggler_sdk # Build + run the test_package. The recipe validate()s C++20, so a profile # whose compiler.cppstd is < 20 (e.g. the common gnu17 default) is correctly # rejected — pass an explicit C++20 std: -conan create all --version=0.16.1 -s compiler.cppstd=20 --build=missing +conan create all --version=0.16.2 -s compiler.cppstd=20 --build=missing # Exercise the option matrix CCI will build: -conan create all --version=0.16.1 -s compiler.cppstd=20 -o "&:with_host=False" --build=missing -conan create all --version=0.16.1 -s compiler.cppstd=20 -o "&:assert_throws=True" --build=missing +conan create all --version=0.16.2 -s compiler.cppstd=20 -o "&:with_host=False" --build=missing +conan create all --version=0.16.2 -s compiler.cppstd=20 -o "&:assert_throws=True" --build=missing ``` Then run the Conan Center hooks locally (catches KB-Hxxx violations the reviewer @@ -69,13 +70,13 @@ bot will flag): ```bash conan config install https://github.com/conan-io/conan-center-index.git \ -sf .c3i/hooks -tf .conan2/extensions/hooks # one-time -conan create all --version=0.16.1 -s compiler.cppstd=20 --build=missing # hooks run inline +conan create all --version=0.16.2 -s compiler.cppstd=20 --build=missing # hooks run inline ``` ## Open the PR Fork `conan-io/conan-center-index`, drop this tree under `recipes/`, commit, and -open a PR titled `plotjuggler_sdk/0.16.1`. Expect one or more review rounds — +open a PR titled `plotjuggler_sdk/0.16.2`. Expect one or more review rounds — the usual notes are around option count (`with_host`, `assert_throws`), license packaging, and the compiler-minimum map. Acceptance is at CCI maintainer discretion. diff --git a/packaging/conan-center-index/recipes/plotjuggler_sdk/all/conandata.yml b/packaging/conan-center-index/recipes/plotjuggler_sdk/all/conandata.yml index f6014e5..56e933a 100644 --- a/packaging/conan-center-index/recipes/plotjuggler_sdk/all/conandata.yml +++ b/packaging/conan-center-index/recipes/plotjuggler_sdk/all/conandata.yml @@ -3,11 +3,13 @@ sources: # of these archive-by-tag tarballs, so this digest is fixed for the tag. # Recompute for a new release with: # curl -sL https://github.com/PlotJuggler/plotjuggler_sdk/archive/refs/tags/vX.Y.Z.tar.gz | sha256sum - # v0.16.1 is the seed version: the first tag that builds on CCI's macOS - # deployment target (FP std::to_chars fallback), carries the - # PJ_WARNINGS_AS_ERRORS gate, and has the thin post-#144 SDK surface — so CCI - # never publishes API a later 0.x removes. Older tags are intentionally not - # listed here. - "0.16.1": - url: "https://github.com/PlotJuggler/plotjuggler_sdk/archive/refs/tags/v0.16.1.tar.gz" - sha256: "e41266e9d0d827941e20f4a5dfb3cfff340170d649c4fe3351e027a9e81c42bf" + # v0.16.2 is the seed version: the first tag that builds on CCI's macOS + # deployment target (working FP std::to_chars fallback — v0.16.1's guard + # never engaged), carries the PJ_WARNINGS_AS_ERRORS gate, and has the thin + # post-#144 SDK surface — so CCI never publishes API a later 0.x removes. + # Older tags are intentionally not listed here. + "0.16.2": + url: "https://github.com/PlotJuggler/plotjuggler_sdk/archive/refs/tags/v0.16.2.tar.gz" + # PLACEHOLDER — v0.16.2 is not tagged yet. After tagging, recompute with the + # curl command above and replace before copying this tree into the CCI fork. + sha256: "0000000000000000000000000000000000000000000000000000000000000000" diff --git a/packaging/conan-center-index/recipes/plotjuggler_sdk/config.yml b/packaging/conan-center-index/recipes/plotjuggler_sdk/config.yml index 24d1594..62178f7 100644 --- a/packaging/conan-center-index/recipes/plotjuggler_sdk/config.yml +++ b/packaging/conan-center-index/recipes/plotjuggler_sdk/config.yml @@ -1,3 +1,3 @@ versions: - "0.16.1": + "0.16.2": folder: all diff --git a/pj_base/include/pj_base/sdk/plugin_data_api.hpp b/pj_base/include/pj_base/sdk/plugin_data_api.hpp index 18f3568..69470d8 100644 --- a/pj_base/include/pj_base/sdk/plugin_data_api.hpp +++ b/pj_base/include/pj_base/sdk/plugin_data_api.hpp @@ -1636,10 +1636,13 @@ class SettingsView { [[nodiscard]] Status setValue(std::string_view key, double value) const { char buf[40]; -#if defined(__APPLE__) && defined(__ENVIRONMENT_MACOS_VERSION_MIN_REQUIRED__) && \ - __ENVIRONMENT_MACOS_VERSION_MIN_REQUIRED__ < 130300 +#if defined(__APPLE__) && (!defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 130300) // libc++ marks the floating-point std::to_chars overloads unavailable below - // a macOS 13.3 deployment target; %.17g round-trips any IEEE double. + // a macOS 13.3 deployment target; %.17g round-trips any IEEE double. The + // guard is fail-safe: any Apple target that is not provably macOS >= 13.3 + // (including non-macOS Apple platforms, which spell the macro differently + // and have their own availability floors) takes the snprintf path. const int n = std::snprintf(buf, sizeof(buf), "%.17g", value); if (n <= 0 || static_cast(n) >= sizeof(buf)) { return unexpected("settings: failed to format double value"); diff --git a/recipe.yaml b/recipe.yaml index c5a60b2..768025d 100644 --- a/recipe.yaml +++ b/recipe.yaml @@ -1,7 +1,7 @@ schema_version: 1 context: - version: "0.16.1" + version: "0.16.2" package: name: plotjuggler_sdk