build: Remove --extra-python
authorAndrew Bartlett <abartlet@samba.org>
Fri, 15 Feb 2019 03:28:38 +0000 (16:28 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 21 Mar 2019 04:06:14 +0000 (04:06 +0000)
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 <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
buildtools/wafsamba/samba_install.py
buildtools/wafsamba/samba_python.py
buildtools/wafsamba/wafsamba.py
buildtools/wafsamba/wscript
lib/ldb-samba/wscript_build
lib/ldb/wscript
lib/talloc/wscript
source3/wscript_build
source4/auth/wscript_build
source4/libnet/wscript_build
source4/librpc/wscript_build

index c07b2ce639a5d390dcd217724588aae5097a8fa4..07b01d6ac4b14eab59245f2da89f88c4de9ba2e5 100644 (file)
@@ -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)
 
index fac0e34b3f16b6edb93ee1227efaebc041dec7e6..21fd3635e79a02e6df1f6996820676392f26720d 100644 (file)
@@ -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
index 1b98e1ceb2c686e71fc0e146784697d446e2412c..2809ba8038ddc2fff960267e6bba21bfd457f717 100644 (file)
@@ -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)
 
index ab19859a83fe789f778017795f6c5e1349901309..f1ebc1cea9e8f2c2ba94782a313493e02aab85f7 100644 (file)
@@ -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):
index c8464261d61fea9ca52dea6c144ee99f3392b10e..396a3816c219844f8a2517a9539f6ace6ad28caf 100644 (file)
@@ -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')
index 8f14b09b583e1323c134f05c7cd0088643ff7070..051c274f3c85b47eba448cd24f715d8ddf404fdc 100644 (file)
@@ -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)
 
index 6a0da625362dbeb40dde5070a846efbfca6fa856..eb68279638b4e020fe976f082888bc7b58bf175c 100644 (file)
@@ -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)
index e633c7046cab3187c0a7b7b568bc387b1c012df3..f595b8ecfc0892244e2adf787e0b7b6dd8e19f8e 100644 (file)
@@ -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,
index 7d67c3dce5ea2e069b8ae8856be032b64b3bbe46..7f42042e05b9bfea3248324cfeefd989aa974037 100644 (file)
@@ -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',
index 275b35420a70b27d4f77c25c5cf58eec65ea1115..25c15d7aa0bc6e53dcbdf8cc217b843cda6c0b7d 100644 (file)
@@ -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,
index d9b7743c9d1091fa13ba7e0b650fbf6c8c969638..48ba1151a69efef6a8b4b0d923d7e019fc277b01 100644 (file)
@@ -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),