From d19dfe1efb2f6cb0dcf0a63b957df584d8ed5945 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 23 May 2022 07:54:06 +0200 Subject: [PATCH] third_party: Update waf to version 2.0.24 This fixes building of python libraries with Python 3.11! BUG: https://bugzilla.samba.org/show_bug.cgi?id=15071 Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Mon May 23 09:34:51 UTC 2022 on sn-devel-184 --- buildtools/bin/waf | 2 +- buildtools/wafsamba/wafsamba.py | 2 +- third_party/waf/waflib/Context.py | 8 ++++---- third_party/waf/waflib/Tools/ccroot.py | 1 + third_party/waf/waflib/Tools/msvc.py | 17 ++++++++++++++++- third_party/waf/waflib/Tools/python.py | 4 ++-- third_party/waf/waflib/Tools/tex.py | 1 + 7 files changed, 26 insertions(+), 9 deletions(-) diff --git buildtools/bin/waf buildtools/bin/waf index 2001ccdbd8a..d9cba343623 100755 --- buildtools/bin/waf +++ buildtools/bin/waf @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect -VERSION="2.0.23" +VERSION="2.0.24" REVISION="x" GIT="x" INSTALL="x" diff --git buildtools/wafsamba/wafsamba.py buildtools/wafsamba/wafsamba.py index 4bd4e9f7fe3..79fe8b5e575 100644 --- buildtools/wafsamba/wafsamba.py +++ buildtools/wafsamba/wafsamba.py @@ -38,7 +38,7 @@ LIB_PATH="shared" os.environ['PYTHONUNBUFFERED'] = '1' -if Context.HEXVERSION not in (0x2001700,): +if Context.HEXVERSION not in (0x2001800,): Logs.error(''' Please use the version of waf that comes with Samba, not a system installed version. See http://wiki.samba.org/index.php/Waf diff --git third_party/waf/waflib/Context.py third_party/waf/waflib/Context.py index 36d1ca74fef..4a0130b24a0 100644 --- third_party/waf/waflib/Context.py +++ third_party/waf/waflib/Context.py @@ -18,13 +18,13 @@ else: import imp # the following 3 constants are updated on each new release (do not touch) -HEXVERSION=0x2001700 +HEXVERSION=0x2001800 """Constant updated on new releases""" -WAFVERSION="2.0.23" +WAFVERSION="2.0.24" """Constant updated on new releases""" -WAFREVISION="cc6b34cf555d354c34f554c41206134072588de7" +WAFREVISION="1af97c71f5a6756abf36d0f78ed8fd551596d7cb" """Git revision when the waf version is updated""" WAFNAME="waf" @@ -144,7 +144,7 @@ class Context(ctx): :type fun: string .. inheritance-diagram:: waflib.Context.Context waflib.Build.BuildContext waflib.Build.InstallContext waflib.Build.UninstallContext waflib.Build.StepContext waflib.Build.ListContext waflib.Configure.ConfigurationContext waflib.Scripting.Dist waflib.Scripting.DistCheck waflib.Build.CleanContext - + :top-classes: waflib.Context.Context """ errors = Errors diff --git third_party/waf/waflib/Tools/ccroot.py third_party/waf/waflib/Tools/ccroot.py index 579d5b2b72b..76deff54dcb 100644 --- third_party/waf/waflib/Tools/ccroot.py +++ third_party/waf/waflib/Tools/ccroot.py @@ -128,6 +128,7 @@ class link_task(Task.Task): Base class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute *link_task*. See :py:func:`waflib.Tools.ccroot.apply_link`. .. inheritance-diagram:: waflib.Tools.ccroot.stlink_task waflib.Tools.c.cprogram waflib.Tools.c.cshlib waflib.Tools.cxx.cxxstlib waflib.Tools.cxx.cxxprogram waflib.Tools.cxx.cxxshlib waflib.Tools.d.dprogram waflib.Tools.d.dshlib waflib.Tools.d.dstlib waflib.Tools.ccroot.fake_shlib waflib.Tools.ccroot.fake_stlib waflib.Tools.asm.asmprogram waflib.Tools.asm.asmshlib waflib.Tools.asm.asmstlib + :top-classes: waflib.Tools.ccroot.link_task """ color = 'YELLOW' diff --git third_party/waf/waflib/Tools/msvc.py third_party/waf/waflib/Tools/msvc.py index 0c4703aaee9..026a4c7fc48 100644 --- third_party/waf/waflib/Tools/msvc.py +++ third_party/waf/waflib/Tools/msvc.py @@ -109,6 +109,21 @@ def options(opt): opt.add_option('--msvc_targets', type='string', help = 'msvc targets, eg: "x64,arm"', default='') opt.add_option('--no-msvc-lazy', action='store_false', help = 'lazily check msvc target environments', default=True, dest='msvc_lazy') +class MSVCVersion(object): + def __init__(self, ver): + m = re.search('^(.*)\s+(\d+[.]\d+)', ver) + if m: + self.name = m.group(1) + self.number = float(m.group(2)) + else: + self.name = ver + self.number = 0. + + def __lt__(self, other): + if self.number == other.number: + return self.name < other.name + return self.number < other.number + @conf def setup_msvc(conf, versiondict): """ @@ -125,7 +140,7 @@ def setup_msvc(conf, versiondict): platforms=Utils.to_list(conf.env.MSVC_TARGETS) or [i for i,j in all_msvc_platforms+all_icl_platforms+all_wince_platforms] desired_versions = getattr(Options.options, 'msvc_version', '').split(',') if desired_versions == ['']: - desired_versions = conf.env.MSVC_VERSIONS or list(reversed(sorted(versiondict.keys()))) + desired_versions = conf.env.MSVC_VERSIONS or list(sorted(versiondict.keys(), key=MSVCVersion, reverse=True)) # Override lazy detection by evaluating after the fact. lazy_detect = getattr(Options.options, 'msvc_lazy', True) diff --git third_party/waf/waflib/Tools/python.py third_party/waf/waflib/Tools/python.py index fb641e5e20d..a23bd019335 100644 --- third_party/waf/waflib/Tools/python.py +++ third_party/waf/waflib/Tools/python.py @@ -315,7 +315,7 @@ def check_python_headers(conf, features='pyembed pyext'): conf.fatal('Could not find the python executable') # so we actually do all this for compatibility reasons and for obtaining pyext_PATTERN below - v = 'prefix SO LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split() + v = 'prefix SO EXT_SUFFIX LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split() try: lst = conf.get_python_variables(["get_config_var('%s') or ''" % x for x in v]) except RuntimeError: @@ -328,7 +328,7 @@ def check_python_headers(conf, features='pyembed pyext'): x = 'MACOSX_DEPLOYMENT_TARGET' if dct[x]: env[x] = conf.environ[x] = str(dct[x]) - env.pyext_PATTERN = '%s' + dct['SO'] # not a mistake + env.pyext_PATTERN = '%s' + (dct['EXT_SUFFIX'] or dct['SO']) # SO is deprecated in 3.5 and removed in 3.11 # Try to get pythonX.Y-config diff --git third_party/waf/waflib/Tools/tex.py third_party/waf/waflib/Tools/tex.py index eaf9fdb5802..b4792c3fe87 100644 --- third_party/waf/waflib/Tools/tex.py +++ third_party/waf/waflib/Tools/tex.py @@ -90,6 +90,7 @@ class tex(Task.Task): Compiles a tex/latex file. .. inheritance-diagram:: waflib.Tools.tex.latex waflib.Tools.tex.xelatex waflib.Tools.tex.pdflatex + :top-classes: waflib.Tools.tex.tex """ bibtex_fun, _ = Task.compile_fun('${BIBTEX} ${BIBTEXFLAGS} ${SRCFILE}', shell=False) -- 2.37.3