From 9ef47d25317947248b0796059e6f0a851ba3cb07 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 14 Aug 2015 12:17:48 +0200 Subject: [PATCH] buildtools: Ignore exact Python version for ABI checking Utilities for Python libraries are built for a specific Python version. Starting with Python 3, the Python version is recorded in the shared library filename as an ABI tag, e.g. "pytalloc.cpython-34m.so. The exact version doesn't matter for Samba's ABI check. Replace the ABI tag with a simpler one that just records the major version of Python. Signed-off-by: Petr Viktorin Reviewed-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Sun Nov 1 01:09:06 CET 2015 on sn-devel-104 --- buildtools/wafsamba/samba_abi.py | 3 ++- buildtools/wafsamba/wafsamba.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py index 3ff6d77811c..82205945ce0 100644 --- a/buildtools/wafsamba/samba_abi.py +++ b/buildtools/wafsamba/samba_abi.py @@ -137,7 +137,8 @@ def abi_check(self): topsrc = self.bld.srcnode.abspath() abi_gen = os.path.join(topsrc, 'buildtools/scripts/abi_gen.sh') - abi_file = "%s/%s-%s.sigs" % (self.abi_directory, self.name, self.vnum) + abi_file = "%s/%s-%s.sigs" % (self.abi_directory, self.version_libname, + self.vnum) tsk = self.create_task('abi_check', self.link_task.outputs[0]) tsk.ABI_FILE = abi_file diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index fdd0371b63c..318dabf44e1 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -253,6 +253,15 @@ def SAMBA_LIBRARY(bld, libname, source, if abi_directory: features += ' abi_check' + if pyembed and bld.env['PYTHON_SO_ABI_FLAG']: + # For ABI checking, we don't care about the exact Python version. + # Replace the Python ABI tag (e.g. ".cpython-35m") by a generic ".py3" + abi_flag = bld.env['PYTHON_SO_ABI_FLAG'] + replacement = '.py%s' % bld.env['PYTHON_VERSION'].split('.')[0] + version_libname = libname.replace(abi_flag, replacement) + else: + version_libname = libname + vscript = None if bld.env.HAVE_LD_VERSION_SCRIPT: if private_library: @@ -263,7 +272,7 @@ def SAMBA_LIBRARY(bld, libname, source, version = None if version: vscript = "%s.vscript" % libname - bld.ABI_VSCRIPT(libname, abi_directory, version, vscript, + bld.ABI_VSCRIPT(version_libname, abi_directory, version, vscript, abi_match) fullname = apply_pattern(bundled_name, bld.env.shlib_PATTERN) fullpath = bld.path.find_or_declare(fullname) @@ -289,6 +298,7 @@ def SAMBA_LIBRARY(bld, libname, source, samba_deps = deps, samba_includes = includes, version_script = vscript, + version_libname = version_libname, local_include = local_include, global_include = global_include, vnum = vnum, -- 2.11.4.GIT