Skip to contentSkip to conversation

Upgrade NNG from v1 to v2

PATCH New Nate Kent 1 participant 3 messages Oct 28

lore
Share & tools
lore

Nate Kent

author
#0 lore raw

cover Upgrade NNG from v1 to v2

This is a breaking change that will cause build issues for users of nngpp. Since the nngpp repository hasn't been touched in over six years, it seemed more appropriate to simply remove the recipe rather than patch it (and hope upstream accepts). If we have reason to think anybody is depending on that package, I would be perfectly willing to add it back and maintain it myself - I just don't want to do that if nobody is using it.

This probably doesn't matter but, for the record, I did have to use
QB_MEM = "-m 1024"
to run the NNG tests inside of qemu (all of which passed). The tests do allocations that are too large for the default settings. As far as I know, NNG is not included in any automated tests, so I would be surprised if this was an issue.

Nate Kent (2):
nngpp: remove recipe
nng: upgrade 1.12.3 -> 2.1.0

 .../nanomsg/nng/run-ptest                     |  3 +--
 .../nanomsg/{nng_1.12.3.bb => nng_2.1.0.bb}   |  7 +++---
 ...1-cmake-Bump-minimum-version-to-3.10.patch | 25 -------------------
 .../recipes-connectivity/nanomsg/nngpp_git.bb | 13 ----------
 .../packagegroup-meta-networking.bb           |  1 -
 5 files changed, 5 insertions(+), 44 deletions(-)
 rename meta-networking/recipes-connectivity/nanomsg/{nng_1.12.3.bb => nng_2.1.0.bb} (77%)
 delete mode 100644 meta-networking/recipes-connectivity/nanomsg/nngpp/0001-cmake-Bump-minimum-version-to-3.10.patch
 delete mode 100644 meta-networking/recipes-connectivity/nanomsg/nngpp_git.bb
Signature · 1 line
2.55.0
author
#1 lore raw

PATCH 1/2 nngpp: remove recipe

nngpp has not had any activity in the last six years and is not compatible with NNG v2.

---
 ...1-cmake-Bump-minimum-version-to-3.10.patch | 25 -------------------
 .../recipes-connectivity/nanomsg/nngpp_git.bb | 13 ----------
 .../packagegroup-meta-networking.bb           |  1 -
 3 files changed, 39 deletions(-)
 delete mode 100644 meta-networking/recipes-connectivity/nanomsg/nngpp/0001-cmake-Bump-minimum-version-to-3.10.patch
 delete mode 100644 meta-networking/recipes-connectivity/nanomsg/nngpp_git.bb
meta-networking/recipes-connectivity/nanomsg/nngpp/0001-cmake-Bump-minimum-version-to-3.10.patch deleted +0 -25
deleted file mode 100644
index 170d799502..0000000000
@@ -1,25 +0,0 @@
-From c5004770784dc5ff80b88487de38c22275a7960a Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 12 Jul 2025 16:04:38 -0700
-Subject: [PATCH] cmake: Bump minimum version to 3.10
-
-Cmake4+ has dropped support for cmake < 3.5 [1]
-
-[1] https://cmake.org/cmake/help/latest/release/4.0.html#deprecated-and-removed-features
-
-Upstream-Status: Submitted [https://github.com/cwzx/nngpp/pull/38]
-Signed-off-by: Khem Raj <[email protected]>
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index caa7145..45a5ad5 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -1,4 +1,4 @@
--cmake_minimum_required (VERSION 3.1)
-+cmake_minimum_required (VERSION 3.10)
- project(nngpp CXX)
- 
- include(GNUInstallDirs)
meta-networking/recipes-connectivity/nanomsg/nngpp_git.bb deleted +0 -13
deleted file mode 100644
index 81a85a7e27..0000000000
@@ -1,13 +0,0 @@
-DESCRIPTION = "C++ wrapper around the nanomsg NNG API"
-HOMEPAGE = "https://github.com/cwzx/nngpp"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://license.txt;md5=6d17d78c3597e0d4452fb1c63bf7c58e"
-DEPENDS = "nng"
-
-SRCREV = "8da8c026bd551b7685a8a140909ff96cfe91bf90"
-PV = "1.3.0+git"
-SRC_URI = "git://github.com/cwzx/nngpp;branch=master;protocol=https \
-           file://0001-cmake-Bump-minimum-version-to-3.10.patch \
-          "
-
-inherit cmake
meta-networking/recipes-core/packagegroups/packagegroup-meta-networking.bb +0 -1
index 085aebd455..0d3760ded8 100644
@@ -249,5 +249,4 @@ RDEPENDS:packagegroup-meta-networking-support:remove:libc-musl = "ypbind-mt"
 
 EXCLUDE_FROM_WORLD = "1"
 # Empty packages, only devel headers and libs
-# nngpp
 # Use ntp and not chrony or ntimed
Signature · 1 line
2.55.0
author
#2 lore raw

PATCH 2/2 nng: upgrade 1.12.3 -> 2.1.0

In reply to Nate Kent

This is a major release for NNG that includes breaking changes to the API.

Changelogs:
* https://github.com/nanomsg/nng/releases/tag/v2.0.0
* https://github.com/nanomsg/nng/releases/tag/v2.1.0

---
 meta-networking/recipes-connectivity/nanomsg/nng/run-ptest | 3 +--
 .../nanomsg/{nng_1.12.3.bb => nng_2.1.0.bb}                | 7 ++++---
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename meta-networking/recipes-connectivity/nanomsg/{nng_1.12.3.bb => nng_2.1.0.bb} (77%)
meta-networking/recipes-connectivity/nanomsg/nng/run-ptest +1 -2
index 57888a77c9..c521d41082 100644
@@ -4,8 +4,7 @@ RET=0
 cd tests
 
 for t in $(ls *); do
-    ./$t > /dev/null
-    if [ $? -eq 0 ]; then
+    if "./$t"; then
         echo PASS: $t
     else
         echo FAIL: $t
meta-networking/recipes-connectivity/nanomsg/nng_2.1.0.bb renamed from meta-networking/recipes-connectivity/nanomsg/nng_1.12.3.bb +4 -3
similarity index 77%
rename from meta-networking/recipes-connectivity/nanomsg/nng_1.12.3.bb
rename to meta-networking/recipes-connectivity/nanomsg/nng_2.1.0.bb
index 7f8a3986f2..0ed2299d51 100644
@@ -5,11 +5,11 @@ SECTION = "libs/networking"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a41e579bb4326c21c774f8e51e41d8a3"
 
-SRC_URI = "git://github.com/nanomsg/nng.git;branch=stable;protocol=https \
+SRC_URI = "git://github.com/nanomsg/nng.git;branch=main;protocol=https \
            file://run-ptest \
           "
 
-SRCREV = "73f715235967afc783e0b99c52d015dc10897fda"
+SRCREV = "0912dcbd63f2f44324fa974e9fc9695c7621abb9"
 
 inherit cmake pkgconfig ptest
 
@@ -23,7 +23,8 @@ PACKAGECONFIG[mbedtls] = "-DNNG_ENABLE_TLS=ON,-DNNG_ENABLE_TLS=OFF,mbedtls"
 
 do_install_ptest(){
     install -d ${D}/${PTEST_PATH}/tests
-    find ${B}/tests -type f -executable -exec install {} ${D}${PTEST_PATH}/tests/ \;
+    find ${B}/src -type f -executable -name '*_test' -exec install {} ${D}${PTEST_PATH}/tests/ \;
+    install ${B}/tests/cplusplus_pair ${D}${PTEST_PATH}/tests/
 }
 
 PACKAGES =+ "${PN}-tools"
Signature · 1 line
2.55.0