From 0b7351142e2b1ff00617506a3e94c7a23ef91125 Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Mon, 28 Apr 2025 15:57:18 +0800 Subject: [PATCH] nlohmann-json: Upgrade 3.11.3 -> 3.12.0 * License-Update: Copyright year updated to 2025 * It seems snprintf in glibc is locale-aware. And it will format floating-point numbers according to the locale when the numeric locale is set (e.g., de_DE). But in musl, snprintf does not respect locale settings for number formatting. It will always use a period as the decimal separator regardless of the locale set. So exclude TEST CASE "locale-dependent test (LC_NUMERIC=de_DE)" [1] right now and add the case back once the issue resolved by upstream. # ./run-ptest PASS: test-algorithms_cpp11 PASS: test-allocator_cpp11 PASS: test-alt-string_cpp11 PASS: test-assert_macro_cpp11 PASS: test-binary_formats_cpp11 PASS: test-bjdata_cpp11 PASS: test-bson_cpp11 PASS: test-byte_container_with_subtype_cpp11 PASS: test-capacity_cpp11 PASS: test-cbor_cpp11 PASS: test-class_const_iterator_cpp11 PASS: test-class_iterator_cpp11 PASS: test-class_lexer_cpp11 PASS: test-class_parser_cpp11 [snip] [1] https://github.com/nlohmann/json/issues/4767 Signed-off-by: Mingli Yu Signed-off-by: Khem Raj --- meta-oe/recipes-devtools/nlohmann-json/files/run-ptest | 6 +++++- .../{nlohmann-json_3.11.3.bb => nlohmann-json_3.12.0.bb} | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) rename meta-oe/recipes-devtools/nlohmann-json/{nlohmann-json_3.11.3.bb => nlohmann-json_3.12.0.bb} (82%) diff --git a/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest b/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest index 2f00267d50..d39ee6df8f 100755 --- a/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest +++ b/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest @@ -3,7 +3,11 @@ cd tests for atest in test-* ; do rm -rf tests.log - ./${atest} > tests.log 2>&1 + if [ ${atest} = "test-locale-cpp_cpp11" ]; then + ./${atest} --test-case-exclude="locale-dependent test (LC_NUMERIC=de_DE)" > tests.log 2>&1 + else + ./${atest} > tests.log 2>&1 + fi if [ $? = 0 ] ; then echo "PASS: ${atest}" else diff --git a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.12.0.bb similarity index 82% rename from meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb rename to meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.12.0.bb index 194e80546e..58567a781e 100644 --- a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb +++ b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.12.0.bb @@ -2,16 +2,16 @@ SUMMARY = "JSON for modern C++" HOMEPAGE = "https://nlohmann.github.io/json/" SECTION = "libs" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588" +LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=3b489645de9825cca5beeb9a7e18b6eb" CVE_PRODUCT = "json-for-modern-cpp" -SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \ +SRC_URI = "git://github.com/nlohmann/json.git;branch=master;protocol=https \ git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \ file://run-ptest \ " -SRCREV = "9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03" +SRCREV = "55f93686c01528224f448c19128836e7df245f72" SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37" SRCREV_FORMAT .= "_json-test-data" @@ -25,7 +25,7 @@ EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests= # nlohmann-json is a header only C++ library, so the main package will be empty. ALLOW_EMPTY:${PN} = "1" RDEPENDS:${PN}-dev = "" -RDEPENDS:${PN}-ptest = "perl" +RDEPENDS:${PN}-ptest = "perl locale-base-de-de" BBCLASSEXTEND = "native nativesdk"