Skip to contentSkip to conversation

package/network-manager: fix build when jansson is enabled

PATCH Applied Thomas Petazzoni via buildroot 1 participant 3 messages Oct 20 – Oct 30 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#1 lore raw

PATCH v2 2/2 package/network-manager: rework jansson handling

In reply to Thomas Petazzoni via buildroot

jansson is needed for BR2_PACKAGE_NETWORK_MANAGER_OVS (which selects BR2_PACKAGE_JANSSON), but practicaly speaking, network-manager's meson.build detects jansson regardless of ovs=true. So we make this jansson optional dependency explicit.

This commit doesn't fix anything, it only makes the dependency more explicit.

---
Changes v1->v2:
- Change the correct variable: DEPENDENCIES, and not CONF_OPTS

---
 package/network-manager/network-manager.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/network-manager/network-manager.mk +5 -1
index 5071546c27..2a562db726 100644
@@ -107,9 +107,13 @@ else
 NETWORK_MANAGER_CONF_OPTS += -Dmodem_manager=false
 endif
 
+ifeq ($(BR2_PACKAGE_JANSSON),y)
+# No option available to explicitly enable/disable
+NETWORK_MANAGER_DEPENDENCIES += jansson
+endif
+
 ifeq ($(BR2_PACKAGE_NETWORK_MANAGER_OVS),y)
 NETWORK_MANAGER_CONF_OPTS += -Dovs=true
-NETWORK_MANAGER_DEPENDENCIES += jansson
 else
 NETWORK_MANAGER_CONF_OPTS += -Dovs=false
 endif
Signature · 6 lines
2.56.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#0 lore raw

PATCH v2 1/2 package/network-manager: fix build when jansson is enabled

Since upstream commit e5d2c7cc6dd5f8146954d52855fff36febd03d5b ("meson: fix cross-compilation issues"), which first came in release 1.58.0, the jansson detection logic is broken causing the sysroot path to be prepended twice, causing build failures:

../output-1/build/network-manager-1.58.1/meson.build:307:2: ERROR: Assert failed: Unable to determine Jansson SONAME

We fix this by doing a partial revert of the upstream commit. We have submitted this partial revert upstream.

Fixes 67cb61bea5876227226603e58d3f74e5032b734d ("package/network-manager: bump version to 1.58.1")

---
Changes v1->v2: None

---
 ...ial-revert-of-e5d2c7cc6dd5f8146954d5.patch | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/network-manager/0001-meson.build-partial-revert-of-e5d2c7cc6dd5f8146954d5.patch
package/network-manager/0001-meson.build-partial-revert-of-e5d2c7cc6dd5f8146954d5.patch new file +50 -0
new file mode 100644
index 0000000000..93810765fc
@@ -0,0 +1,50 @@
+From 57c96b61de76ab6fca79e075076c5d2e35fc1229 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Tue, 20 Oct 2026 15:27:21 +0200
+Subject: [PATCH] meson.build: partial revert of
+ e5d2c7cc6dd5f8146954d52855fff36febd03d5b
+
+Commit e5d2c7cc6dd5f8146954d52855fff36febd03d5b ("meson: fix
+cross-compilation issues") fixed some cross-compilation issues, but
+one of the change is incorrect:
+
+   jansson_libdir = jansson_dep.get_variable(pkgconfig: 'libdir')
+-  res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so'), check: false)
++  jansson_sysroot = meson.is_cross_build() ? meson.get_external_property('sys_root', '') : ''
++  res = run_command(find_program('eu-readelf', 'readelf'), '-d', jansson_sysroot + join_paths(jansson_libdir, 'libjansson.so'), check: false)
+
+This change is not correct as jansson_dep.get_variable(pkgconfig:
+'libdir') will already return a properly sysroot prepended path,
+assumming the pkg-config used is properly configured for
+cross-compilation (i.e the PKG_CONFIG_SYSROOT_DIR environment variable
+is set and points to the sysroot):
+
+The above change breaks the cross-compilation in Buildroot, which
+properly uses pkg-config with PKG_CONFIG_SYSROOT_DIR as we now have a
+path to jansson.so that has the sysroot path twice:
+
+  /home/thomas/buildroot/all/output-all/host/aarch64-buildroot-linux-gnu/sysroot/home/thomas/buildroot/all/output-all/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libjansson.so
+
+Upstream: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2575
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ meson.build | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 5345a650a0..cc1460460c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -296,8 +296,7 @@ config_h.set10('WITH_JANSSON', jansson_dep.found())
+ jansson_msg = 'no'
+ if jansson_dep.found()
+   jansson_libdir = jansson_dep.get_variable(pkgconfig: 'libdir')
+-  jansson_sysroot = meson.is_cross_build() ? meson.get_external_property('sys_root', '') : ''
+-  res = run_command(find_program('eu-readelf', 'readelf'), '-d', jansson_sysroot + join_paths(jansson_libdir, 'libjansson.so'), check: false)
++  res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so'), check: false)
+   jansson_soname = ''
+   foreach line: res.stdout().split('\n')
+     if line.strip().contains('SONAME')
+-- 
+2.56.0
+
Signature · 6 lines
2.56.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH v2 2/2] package/network-manager: rework jansson handling

In reply to Thomas Petazzoni via buildroot

In reply of:

Quoted 9 lines

jansson is needed for BR2_PACKAGE_NETWORK_MANAGER_OVS (which selects BR2_PACKAGE_JANSSON), but practicaly speaking, network-manager's meson.build detects jansson regardless of ovs=true. So we make this jansson optional dependency explicit.

This commit doesn't fix anything, it only makes the dependency more explicit.

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 16 lines

---
Changes v1->v2:
- Change the correct variable: DEPENDENCIES, and not CONF_OPTS

---
 package/network-manager/network-manager.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/network-manager/network-manager.mk +1 -0
index 5071546c27..2a562db726 100644
@@ -107,9 +107,13 @@ else
 NETWORK_MANAGER_CONF_OPTS += -Dmodem_manager=false
 endif
 
+ifeq ($(BR2_PACKAGE_JANSSON),y)

package/network-manager/network-manager.mk else · line 119

Quoted 10 lines
package/network-manager/network-manager.mk +4 -1
+# No option available to explicitly enable/disable
+NETWORK_MANAGER_DEPENDENCIES += jansson
+endif
+
 ifeq ($(BR2_PACKAGE_NETWORK_MANAGER_OVS),y)
 NETWORK_MANAGER_CONF_OPTS += -Dovs=true
-NETWORK_MANAGER_DEPENDENCIES += jansson
 else
 NETWORK_MANAGER_CONF_OPTS += -Dovs=false
 endif

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot