1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

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 <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Nov  1 01:09:06 CET 2015 on sn-devel-104
This commit is contained in:
Petr Viktorin 2015-08-14 12:17:48 +02:00 committed by Stefan Metzmacher
parent 2f619066fb
commit 9ef47d2531
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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,