package/network-manager: fix build when jansson is enabled
PATCH 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.
--- ...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
@@ -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
PATCH 2/2 package/network-manager: rework jansson handling
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.
--- package/network-manager/network-manager.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
package/network-manager/network-manager.mk +5 -1
@@ -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_CONF_OPTS += 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
Re: [Buildroot] [PATCH 2/2] package/network-manager: rework jansson handling
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
jansson is needed for
BR2_PACKAGE_NETWORK_MANAGER_OVS(which selectsBR2_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.
Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
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:
Quoted 8 lines
../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")Signed-off-by Thomas Petazzoni <[email protected]>
Committed, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 11 lines
Quoted 10 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
"Peter" == Peter Korsgaard <[email protected]> writes:
"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:
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
Quoted 8 lines
Quoted 6 lines
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")Signed-off-by Thomas Petazzoni <[email protected]>Committed, thanks.
Ehh, the v2 series naturally.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot