From: Andrew Bartlett Date: Fri, 15 Feb 2019 03:28:38 +0000 (+1300) Subject: build: Remove --extra-python X-Git-Tag: talloc-2.2.0~11 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=270d04e4ea0e3a7f4443557f5ff65e6f9e426295;p=mdw%2Fsamba-autobuild%2F.git build: Remove --extra-python This option is quite invasive in waf and was mainly for the python3 transition. Testing with multiple python versions can be done by testing a full compile against multiple versions, likewise multiple different binding versions can be created the same way. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py index c07b2ce639a..07b01d6ac4b 100644 --- a/buildtools/wafsamba/samba_install.py +++ b/buildtools/wafsamba/samba_install.py @@ -62,9 +62,6 @@ def install_library(self): default_env = bld.all_envs['default'] try: - if self.env['IS_EXTRA_PYTHON']: - bld.all_envs['default'] = bld.all_envs['extrapython'] - install_ldflags = install_rpath(self) build_ldflags = build_rpath(bld) diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py index fac0e34b3f1..21fd3635e79 100644 --- a/buildtools/wafsamba/samba_python.py +++ b/buildtools/wafsamba/samba_python.py @@ -13,22 +13,6 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,6,0)): interpreters = [] - if conf.env['EXTRA_PYTHON']: - conf.all_envs['extrapython'] = conf.env.derive() - conf.setenv('extrapython') - conf.env['PYTHON'] = conf.env['EXTRA_PYTHON'] - conf.env['IS_EXTRA_PYTHON'] = 'yes' - conf.find_program('python', var='PYTHON', mandatory=True) - conf.load('python') - try: - conf.check_python_version(version) - except Exception: - Logs.warn('extra-python needs to be Python %s.%s.%s or later' % - (version[0], version[1], version[2])) - raise - interpreters.append(conf.env['PYTHON']) - conf.setenv('default') - conf.find_program('python3', var='PYTHON', mandatory=mandatory) conf.load('python') path_python = conf.find_program('python3') @@ -57,19 +41,9 @@ def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True): return if conf.env["python_headers_checked"] == []: - if conf.env['EXTRA_PYTHON']: - conf.setenv('extrapython') - _check_python_headers(conf, mandatory=True) - conf.setenv('default') - _check_python_headers(conf, mandatory) conf.env["python_headers_checked"] = "yes" - if conf.env['EXTRA_PYTHON']: - extraversion = conf.all_envs['extrapython']['PYTHON_VERSION'] - if extraversion == conf.env['PYTHON_VERSION']: - raise Errors.WafError("extrapython %s is same as main python %s" % ( - extraversion, conf.env['PYTHON_VERSION'])) else: conf.msg("python headers", "using cache") @@ -133,9 +107,6 @@ def SAMBA_PYTHON(bld, name, if not bld.PYTHON_BUILD_IS_ENABLED(): enabled = False - if bld.env['IS_EXTRA_PYTHON']: - name = 'extra-' + name - # when we support static python modules we'll need to gather # the list from all the SAMBA_PYTHON() targets if init_function_sentinel is not None: @@ -180,7 +151,7 @@ def SAMBA_PYTHON(bld, name, Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON -def pyembed_libname(bld, name, extrapython=False): +def pyembed_libname(bld, name): if bld.env['PYTHON_SO_ABI_FLAG']: return name + bld.env['PYTHON_SO_ABI_FLAG'] else: @@ -198,14 +169,4 @@ def gen_python_environments(bld, extra_env_vars=()): with the extra-python environment active. """ yield - - if bld.env['EXTRA_PYTHON']: - copied = ('GLOBAL_DEPENDENCIES', 'TARGET_TYPE') + tuple(extra_env_vars) - for name in copied: - bld.all_envs['extrapython'][name] = bld.all_envs['default'][name] - default_env = bld.all_envs['default'] - bld.all_envs['default'] = bld.all_envs['extrapython'] - yield - bld.all_envs['default'] = default_env - Build.BuildContext.gen_python_environments = gen_python_environments diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 1b98e1ceb2c..2809ba8038d 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -136,9 +136,6 @@ def SAMBA_LIBRARY(bld, libname, source, enabled=True): '''define a Samba library''' - if pyembed and bld.env['IS_EXTRA_PYTHON']: - public_headers = None - if private_library and public_headers: raise Errors.WafError("private library '%s' must not have public header files" % libname) @@ -222,7 +219,7 @@ def SAMBA_LIBRARY(bld, libname, source, if pc_files is None: raise Errors.WafError("public library '%s' must have pkg-config file" % libname) - if public_headers is None and not bld.env['IS_EXTRA_PYTHON']: + if public_headers is None: raise Errors.WafError("public library '%s' must have header files" % libname) diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index ab19859a83f..f1ebc1cea9e 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -203,12 +203,6 @@ def options(opt): help='do not generate python modules', action='store_true', dest='disable_python', default=False) - opt.add_option('--extra-python', type=str, - help=("build selected libraries for the specified " - "additional version of Python " - "(example: --extra-python=/usr/bin/python3)"), - metavar="PYTHON", dest='EXTRA_PYTHON', default=None) - @Utils.run_once def configure(conf): @@ -266,12 +260,6 @@ def configure(conf): conf.env.disable_python = Options.options.disable_python - conf.env.EXTRA_PYTHON = Options.options.EXTRA_PYTHON - - if (conf.env.disable_python and conf.env.EXTRA_PYTHON): - Logs.error('ERROR: cannot specify both --disable-python and --extra-python.') - sys.exit(1) - if (conf.env.AUTOCONF_HOST and conf.env.AUTOCONF_BUILD and conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST): diff --git a/lib/ldb-samba/wscript_build b/lib/ldb-samba/wscript_build index c8464261d61..396a3816c21 100644 --- a/lib/ldb-samba/wscript_build +++ b/lib/ldb-samba/wscript_build @@ -22,8 +22,6 @@ for env in bld.gen_python_environments(): pyparam_util = bld.pyembed_libname('pyparam_util') pyldb_util = bld.pyembed_libname('pyldb-util') pyauth = 'pyauth' - if bld.env['IS_EXTRA_PYTHON']: - pyauth = 'extra-' + pyauth bld.SAMBA_PYTHON('python_samba__ldb', 'pyldb.c', deps='ldbsamba %s ldbwrap %s %s' % (pyparam_util, pyldb_util, pyauth), realname='samba/_ldb.so') diff --git a/lib/ldb/wscript b/lib/ldb/wscript index 8f14b09b583..051c274f3c8 100644 --- a/lib/ldb/wscript +++ b/lib/ldb/wscript @@ -92,17 +92,6 @@ def configure(conf): implied_deps='replace talloc tdb tevent ldb'): using_system_pyldb_util = False - # We need to get a pyldb-util for all the python versions - # we are building for - if conf.env['EXTRA_PYTHON']: - name = 'pyldb-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG'] - if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, - minversion=VERSION, - maxversion=max_ldb_version_dots, - onlyif='talloc tdb tevent', - implied_deps='replace talloc tdb tevent ldb'): - using_system_pyldb_util = False - if using_system_pyldb_util: conf.define('USING_SYSTEM_PYLDB_UTIL', 1) diff --git a/lib/talloc/wscript b/lib/talloc/wscript index 6a0da625362..eb68279638b 100644 --- a/lib/talloc/wscript +++ b/lib/talloc/wscript @@ -81,13 +81,6 @@ def configure(conf): if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION, implied_deps='talloc replace'): using_system_pytalloc_util = False - # We need to get a pytalloc-util for all the python versions - # we are building for - if conf.env['EXTRA_PYTHON']: - name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG'] - if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION, - implied_deps='talloc replace'): - using_system_pytalloc_util = False if using_system_pytalloc_util: conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1) diff --git a/source3/wscript_build b/source3/wscript_build index e633c7046ca..f595b8ecfc0 100644 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -1327,8 +1327,6 @@ for env in bld.gen_python_environments(): for env in bld.gen_python_environments(): pycredentials = 'pycredentials' - if bld.env['IS_EXTRA_PYTHON']: - pycredentials = 'extra-' + pycredentials bld.SAMBA3_PYTHON('pylibsmb', source='libsmb/pylibsmb.c', deps='smbclient samba-credentials %s' % pycredentials, diff --git a/source4/auth/wscript_build b/source4/auth/wscript_build index 7d67c3dce5e..7f42042e05b 100644 --- a/source4/auth/wscript_build +++ b/source4/auth/wscript_build @@ -54,8 +54,6 @@ for env in bld.gen_python_environments(): pyparam_util = bld.pyembed_libname('pyparam_util') pyldb_util = bld.pyembed_libname('pyldb-util') pycredentials = 'pycredentials' - if bld.env['IS_EXTRA_PYTHON']: - pycredentials = 'extra-' + pycredentials bld.SAMBA_PYTHON('pyauth', source='pyauth.c', public_deps='auth_system_session', diff --git a/source4/libnet/wscript_build b/source4/libnet/wscript_build index 275b35420a7..25c15d7aa0b 100644 --- a/source4/libnet/wscript_build +++ b/source4/libnet/wscript_build @@ -6,8 +6,6 @@ for env in bld.gen_python_environments(): provision = bld.pyembed_libname('PROVISION') name = bld.pyembed_libname('samba-net') auto_proto='libnet_proto.h' - if bld.env['IS_EXTRA_PYTHON']: - auto_proto=None bld.SAMBA_LIBRARY(name, source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_join.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_vampire.c libnet_samdump.c libnet_samsync_ldb.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c libnet_samsync.c', autoproto=auto_proto, diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build index d9b7743c9d1..48ba1151a69 100644 --- a/source4/librpc/wscript_build +++ b/source4/librpc/wscript_build @@ -403,8 +403,6 @@ for env in bld.gen_python_environments(): ) python_netlogon = 'python_netlogon' - if bld.env['IS_EXTRA_PYTHON']: - python_netlogon = 'extra-' + python_netlogon bld.SAMBA_PYTHON('python_winbind', source='../../librpc/gen_ndr/py_winbind.c', deps='RPC_NDR_WINBIND %s %s %s' % (pytalloc_util, pyrpc_util, python_netlogon),