From: Michael Jeanson Date: Wed, 3 Mar 2021 17:10:20 +0000 (-0500) Subject: Python agent lib soname major bump X-Git-Tag: v2.13.0-rc1~192 X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=commitdiff_plain;h=50d2bb48d09d5b6ae23185e8f916152e2371d04a Python agent lib soname major bump Make the python agent library follow the main library soname for co-installability with previous versions. Also use the value provided by the build system instead of manually synchronizing it. Change-Id: Ieef9b9ca6dcfd08b7834e5faafef3935a6a1a232 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/.gitignore b/.gitignore index 15d19b64..78ecf88f 100644 --- a/.gitignore +++ b/.gitignore @@ -100,7 +100,7 @@ org_lttng_ust_agent_jul_LttngJulApi.h org_lttng_ust_agent_log4j_LttngLog4jApi.h # Python agent -python-lttngust/lttngust/__init__.py +python-lttngust/lttngust/version.py python-lttngust/**/*.pyc python-lttngust/build python-lttngust/setup.py diff --git a/configure.ac b/configure.ac index 09ba4ed0..5c060fb5 100644 --- a/configure.ac +++ b/configure.ac @@ -489,6 +489,9 @@ AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$ac_cv_header_linux_perf_event_h" = "x AC_SUBST([LTTNG_UST_LIBRARY_VERSION], ust_lib_version) AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], ust_ctl_lib_version) +# Major soname for python-lttngust +AC_SUBST([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current]) + AM_CFLAGS="-Wall $URCU_CFLAGS $PTHREAD_CFLAGS" AC_SUBST(AM_CFLAGS) @@ -541,7 +544,7 @@ AC_CONFIG_FILES([ liblttng-ust-python-agent/Makefile python-lttngust/Makefile python-lttngust/setup.py - python-lttngust/lttngust/__init__.py + python-lttngust/lttngust/version.py tools/Makefile tests/Makefile tests/compile/Makefile diff --git a/liblttng-ust-python-agent/Makefile.am b/liblttng-ust-python-agent/Makefile.am index 2b316a7b..e5de2e0b 100644 --- a/liblttng-ust-python-agent/Makefile.am +++ b/liblttng-ust-python-agent/Makefile.am @@ -8,3 +8,6 @@ lib_LTLIBRARIES = liblttng-ust-python-agent.la liblttng_ust_python_agent_la_SOURCES = lttng_ust_python.c lttng_ust_python.h liblttng_ust_python_agent_la_LIBADD = -lc \ $(top_builddir)/liblttng-ust/liblttng-ust.la + +# Follow the main library soname for co-installability +liblttng_ust_python_agent_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION) diff --git a/python-lttngust/Makefile.am b/python-lttngust/Makefile.am index 33a968f5..f95482d3 100644 --- a/python-lttngust/Makefile.am +++ b/python-lttngust/Makefile.am @@ -3,6 +3,7 @@ INSTALLED_FILES=$(builddir)/installed_files.txt STATIC_BINDINGS_DEPS = \ + lttngust/__init__.py \ lttngust/agent.py \ lttngust/cmd.py \ lttngust/compat.py \ diff --git a/python-lttngust/lttngust/__init__.py b/python-lttngust/lttngust/__init__.py new file mode 100644 index 00000000..22d3e09c --- /dev/null +++ b/python-lttngust/lttngust/__init__.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (C) 2015 Philippe Proulx + +from __future__ import unicode_literals + +from .version import __version__ +from .version import __soname_major__ + +# this creates the daemon threads and registers the application +import lttngust.agent diff --git a/python-lttngust/lttngust/__init__.py.in b/python-lttngust/lttngust/__init__.py.in deleted file mode 100644 index 6aae1002..00000000 --- a/python-lttngust/lttngust/__init__.py.in +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (C) 2015 Philippe Proulx - -from __future__ import unicode_literals - -# this creates the daemon threads and registers the application -import lttngust.agent - - -__version__ = '@PACKAGE_VERSION@' diff --git a/python-lttngust/lttngust/loghandler.py b/python-lttngust/lttngust/loghandler.py index 406cc58b..745d9637 100644 --- a/python-lttngust/lttngust/loghandler.py +++ b/python-lttngust/lttngust/loghandler.py @@ -9,9 +9,10 @@ from __future__ import unicode_literals import logging import ctypes +from .version import __soname_major__ class _Handler(logging.Handler): - _LIB_NAME = 'liblttng-ust-python-agent.so.0' + _LIB_NAME = 'liblttng-ust-python-agent.so.' + __soname_major__ def __init__(self): super(self.__class__, self).__init__(level=logging.NOTSET) diff --git a/python-lttngust/lttngust/version.py.in b/python-lttngust/lttngust/version.py.in new file mode 100644 index 00000000..d3a904bc --- /dev/null +++ b/python-lttngust/lttngust/version.py.in @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (C) 2021 Michael Jeanson + +__version__ = '@PACKAGE_VERSION@' +__soname_major__ = '@LTTNG_UST_LIB_SONAME_MAJOR@'