Python agent lib soname major bump
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 3 Mar 2021 17:10:20 +0000 (12:10 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 29 Mar 2021 17:59:55 +0000 (13:59 -0400)
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 <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
.gitignore
configure.ac
liblttng-ust-python-agent/Makefile.am
python-lttngust/Makefile.am
python-lttngust/lttngust/__init__.py [new file with mode: 0644]
python-lttngust/lttngust/__init__.py.in [deleted file]
python-lttngust/lttngust/loghandler.py
python-lttngust/lttngust/version.py.in [new file with mode: 0644]

index 15d19b6454e6d81ee466c2dafe6c12ab86b96a50..78ecf88f2d6c96aa01c7b229833f7dce5e30cabd 100644 (file)
@@ -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
index 09ba4ed071c7aad745ef8169515e15f6cf7db65d..5c060fb58dab142ae532b093a6eb2b355b61af04 100644 (file)
@@ -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
index 2b316a7b437d040c8115536bedd3b84bd03bda9d..e5de2e0b73f4e79e7333205dd73cded8e5ed4e6f 100644 (file)
@@ -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)
index 33a968f5a6393d322bfe12823e4fb0bee4325738..f95482d3e15822dcffe2698a21d3ce40391855d2 100644 (file)
@@ -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 (file)
index 0000000..22d3e09
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+#
+# SPDX-License-Identifier: LGPL-2.1-only
+#
+# Copyright (C) 2015 Philippe Proulx <pproulx@efficios.com>
+
+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 (file)
index 6aae100..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# SPDX-License-Identifier: LGPL-2.1-only
-#
-# Copyright (C) 2015 Philippe Proulx <pproulx@efficios.com>
-
-from __future__ import unicode_literals
-
-# this creates the daemon threads and registers the application
-import lttngust.agent
-
-
-__version__ = '@PACKAGE_VERSION@'
index 406cc58b565025ea23d5959477ab8959153a1dca..745d96371efe344ca28d3c67b71e4cf94b214dca 100644 (file)
@@ -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 (file)
index 0000000..d3a904b
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+#
+# SPDX-License-Identifier: LGPL-2.1-only
+#
+# Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+
+__version__ = '@PACKAGE_VERSION@'
+__soname_major__ = '@LTTNG_UST_LIB_SONAME_MAJOR@'
This page took 0.027449 seconds and 4 git commands to generate.