From 93dc1db10d48943cee93fd283fd3e5d229ecfa59 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Mar 2026 08:30:51 +0000 Subject: [PATCH 1/2] fix(build): xml2 workaround for Tizen hal-api-common dependency bug This change adds explicit libxml2 references in Meson and packaging metadata\n(spec/debian) as a workaround for the Tizen hal-api-common package dependency bug\nthat causes unittest link failures when xml symbols are resolved transitively. Co-authored-by: MyungJoo Ham --- c/meson.build | 10 +++++++++- c/src/meson.build | 1 + debian/control | 2 +- debian/rules | 5 +++++ packaging/machine-learning-api.spec | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/c/meson.build b/c/meson.build index 1ff1b148..57e45419 100644 --- a/c/meson.build +++ b/c/meson.build @@ -8,6 +8,7 @@ endif # Dependencies nns_capi_common_deps = [glib_dep, gmodule_dep, nnstreamer_single_dep] +nns_capi_common_link_args = [] nns_capi_deps = [nnstreamer_dep, gst_dep, gst_app_dep] if (get_option('enable-tizen')) @@ -30,7 +31,14 @@ if (get_option('enable-tizen')) endif if get_option('enable-tizen-feature-check') - nns_capi_common_deps += dependency('capi-system-info') + sysinfo_dep = dependency('capi-system-info') + xml2_dep = dependency('libxml-2.0') + nns_capi_common_deps += [sysinfo_dep, xml2_dep] + # Resolve transitive xml2 dependencies used by HAL/pkgmgr in Tizen links. + xml2_libdir = xml2_dep.get_pkgconfig_variable('libdir', default: '') + if xml2_libdir != '' + nns_capi_common_link_args += '-Wl,-rpath-link,' + xml2_libdir + endif endif endif diff --git a/c/src/meson.build b/c/src/meson.build index e584cef3..feb15c1b 100644 --- a/c/src/meson.build +++ b/c/src/meson.build @@ -48,6 +48,7 @@ endif nns_capi_common_dep = declare_dependency(link_with: nns_capi_common_lib, dependencies: nns_capi_common_deps, + link_args: nns_capi_common_link_args, include_directories: nns_capi_include ) diff --git a/debian/control b/debian/control index 2315727e..34f0de67 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Build-Depends: gcc-9 | gcc-8 | gcc-7 | gcc-6 | gcc-5 (>=5.4), ninja-build, meson (>=0.50), debhelper (>=9), libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, gstreamer1.0-plugins-base, nnstreamer, nnstreamer-dev, nnstreamer-dev-internal, openjdk-11-jdk, - libglib2.0-dev, libgtest-dev, ssat, gstreamer1.0-plugins-good, nnstreamer-edge-dev + libglib2.0-dev, libxml2-dev, libgtest-dev, ssat, gstreamer1.0-plugins-good, nnstreamer-edge-dev Standards-Version: 3.9.6 Homepage: https://github.com/nnstreamer/api diff --git a/debian/rules b/debian/rules index 413303cd..8588de95 100755 --- a/debian/rules +++ b/debian/rules @@ -19,6 +19,11 @@ export BUILDDIR=build export MLAPI_SOURCE_ROOT_PATH=$(ROOT_DIR) export MLAPI_BUILD_ROOT_PATH=${MLAPI_SOURCE_ROOT_PATH}/${BUILDDIR} export JAVA_DIR ?= $(shell echo 'System.out.println(java.lang.System.getProperty("java.home"));' | jshell -) +export XML2_LIBDIR ?= $(shell pkg-config --variable=libdir libxml-2.0 2>/dev/null) + +ifneq ($(strip $(XML2_LIBDIR)),) +export LDFLAGS := $(LDFLAGS) -Wl,-rpath-link,$(XML2_LIBDIR) +endif %: dh $@ --parallel diff --git a/packaging/machine-learning-api.spec b/packaging/machine-learning-api.spec index 75733262..70f7d82c 100644 --- a/packaging/machine-learning-api.spec +++ b/packaging/machine-learning-api.spec @@ -118,6 +118,8 @@ BuildRequires: pkgconfig(mm-resource-manager) %if 0%{?enable_tizen_feature} BuildRequires: pkgconfig(capi-system-info) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: libxml2 %endif %endif # tizen From e1aece75336bf665ce29246106feba28948846da Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Mar 2026 08:35:45 +0000 Subject: [PATCH 2/2] revert(build): drop meson/debian xml2 workaround changes Keep only Tizen spec-side xml2 package references because the issue was missing libxml2 .so installation on Tizen, not Meson or Debian build wiring. Co-authored-by: MyungJoo Ham --- c/meson.build | 10 +--------- c/src/meson.build | 1 - debian/control | 2 +- debian/rules | 5 ----- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/c/meson.build b/c/meson.build index 57e45419..1ff1b148 100644 --- a/c/meson.build +++ b/c/meson.build @@ -8,7 +8,6 @@ endif # Dependencies nns_capi_common_deps = [glib_dep, gmodule_dep, nnstreamer_single_dep] -nns_capi_common_link_args = [] nns_capi_deps = [nnstreamer_dep, gst_dep, gst_app_dep] if (get_option('enable-tizen')) @@ -31,14 +30,7 @@ if (get_option('enable-tizen')) endif if get_option('enable-tizen-feature-check') - sysinfo_dep = dependency('capi-system-info') - xml2_dep = dependency('libxml-2.0') - nns_capi_common_deps += [sysinfo_dep, xml2_dep] - # Resolve transitive xml2 dependencies used by HAL/pkgmgr in Tizen links. - xml2_libdir = xml2_dep.get_pkgconfig_variable('libdir', default: '') - if xml2_libdir != '' - nns_capi_common_link_args += '-Wl,-rpath-link,' + xml2_libdir - endif + nns_capi_common_deps += dependency('capi-system-info') endif endif diff --git a/c/src/meson.build b/c/src/meson.build index feb15c1b..e584cef3 100644 --- a/c/src/meson.build +++ b/c/src/meson.build @@ -48,7 +48,6 @@ endif nns_capi_common_dep = declare_dependency(link_with: nns_capi_common_lib, dependencies: nns_capi_common_deps, - link_args: nns_capi_common_link_args, include_directories: nns_capi_include ) diff --git a/debian/control b/debian/control index 34f0de67..2315727e 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Build-Depends: gcc-9 | gcc-8 | gcc-7 | gcc-6 | gcc-5 (>=5.4), ninja-build, meson (>=0.50), debhelper (>=9), libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, gstreamer1.0-plugins-base, nnstreamer, nnstreamer-dev, nnstreamer-dev-internal, openjdk-11-jdk, - libglib2.0-dev, libxml2-dev, libgtest-dev, ssat, gstreamer1.0-plugins-good, nnstreamer-edge-dev + libglib2.0-dev, libgtest-dev, ssat, gstreamer1.0-plugins-good, nnstreamer-edge-dev Standards-Version: 3.9.6 Homepage: https://github.com/nnstreamer/api diff --git a/debian/rules b/debian/rules index 8588de95..413303cd 100755 --- a/debian/rules +++ b/debian/rules @@ -19,11 +19,6 @@ export BUILDDIR=build export MLAPI_SOURCE_ROOT_PATH=$(ROOT_DIR) export MLAPI_BUILD_ROOT_PATH=${MLAPI_SOURCE_ROOT_PATH}/${BUILDDIR} export JAVA_DIR ?= $(shell echo 'System.out.println(java.lang.System.getProperty("java.home"));' | jshell -) -export XML2_LIBDIR ?= $(shell pkg-config --variable=libdir libxml-2.0 2>/dev/null) - -ifneq ($(strip $(XML2_LIBDIR)),) -export LDFLAGS := $(LDFLAGS) -Wl,-rpath-link,$(XML2_LIBDIR) -endif %: dh $@ --parallel