From 2eaf5f05b5b3d5e7a74fd2f10b151518ee2ba63b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 8 Sep 2026 05:12:06 +0000 Subject: [PATCH] microsoft-gsl: upgrade 4.2.2 -> 5.0.0 Release notes: https://github.com/microsoft/GSL/releases/tag/v5.0.0 Switch to the rel/5.0 branch. New in this release is the gsl::dyn_array container, so the -dev package gains include/gsl/dyn_array. Fix the build with clang 22. The tests are compiled with -Weverything -Werror, so every new clang diagnostic becomes a build failure; the newly added lifetime-safety suggestions produce: notnull_tests.cpp:63:19: error: parameter in intra-TU constructor should be marked [[clang::lifetimebound]] [-Werror,-Wlifetime-safety-intra-tu-constructor-suggestions] Signed-off-by: Khem Raj --- .../microsoft-gsl/microsoft-gsl/run-ptest | 14 +++++++++++-- ...ft-gsl_4.2.2.bb => microsoft-gsl_5.0.0.bb} | 20 +++++++++++-------- 2 files changed, 24 insertions(+), 10 deletions(-) rename meta-oe/recipes-devtools/microsoft-gsl/{microsoft-gsl_4.2.2.bb => microsoft-gsl_5.0.0.bb} (75%) diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/run-ptest b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/run-ptest index 2d5bdf4ff2..c6ce411029 100644 --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/run-ptest +++ b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/run-ptest @@ -1,4 +1,14 @@ #!/bin/sh -gsl_tests && echo "PASS: gsl_tests" || echo "FAIL: gsl_tests" -gsl_noexcept_tests && echo "PASS: gsl_noexcept_tests" || echo "FAIL: gsl_noexcept_tests" +# Upstream builds one executable per tests/*.cpp source, so iterate rather +# than naming them individually. +cd "$(dirname "$0")" || exit 1 + +for t in *_tests; do + [ -x "./$t" ] || continue + if "./$t"; then + echo "PASS: $t" + else + echo "FAIL: $t" + fi +done diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.2.bb b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_5.0.0.bb similarity index 75% rename from meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.2.bb rename to meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_5.0.0.bb index 3d795878b2..1521ed1111 100644 --- a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_4.2.2.bb +++ b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl_5.0.0.bb @@ -8,10 +8,10 @@ HOMEPAGE = "https://github.com/microsoft/GSL" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=363055e71e77071107ba2bb9a54bd9a7" -SRC_URI = "git://github.com/microsoft/GSL.git;protocol=https;branch=rel/4.2;tag=v${PV} \ +SRC_URI = "git://github.com/microsoft/GSL.git;protocol=https;branch=rel/5.0;tag=v${PV} \ file://run-ptest \ " -SRCREV = "152d6eb989a1ecd23fe9c9cfb2fb8cfc7c0cd0c1" +SRCREV = "417ef685eafd626db765f0027b7fc5a0057e0770" inherit cmake pkgconfig ptest @@ -24,18 +24,22 @@ PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'ptest','', d)}" PACKAGECONFIG[ptest] = "-DGSL_TEST=ON,-DGSL_TEST=OFF,googletest" # clang disagrees with https://github.com/google/googletest/pull/3457 -CXXFLAGS:append:toolchain-clang = " -Wno-error=switch-default" +# The tests are built with -Weverything -Werror, so each clang release turns +# its new diagnostics into build failures. +CXXFLAGS:append:toolchain-clang = "\ + -Wno-error=switch-default \ + -Wno-unknown-warning-option \ + -Wno-error=lifetime-safety-intra-tu-suggestions \ + -Wno-error=lifetime-safety-intra-tu-constructor-suggestions \ +" # Disable disabled-macro-expansion warning as error as its seen on musl CXXFLAGS:append:toolchain-clang:libc-musl = " -Wno-error=disabled-macro-expansion" do_install_ptest() { - install -d ${D}${bindir} - install -m 0755 ${B}/tests/gsl_tests ${D}${bindir} - install -m 0755 ${B}/tests/gsl_noexcept_tests ${D}${bindir} + install -d ${D}${PTEST_PATH} + install -m 0755 ${B}/tests/*_tests ${D}${PTEST_PATH} } -FILES:${PN}-ptest = "${bindir}/gsl*_tests" - # there is already other gsl recipe, so recipe name does not match the real component name CVE_PRODUCT = "microsoft:gsl"