[SCM] Samba Shared Repository - branch v4-15-test updated

Jule Anger janger at samba.org
Mon May 30 10:12:01 UTC 2022


The branch, v4-15-test has been updated
       via  c53efe8b481 s3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT
       via  5a4e0a40b42 third_party: Update waf to version 2.0.24
       via  e4361e407bc third_party: Update waf to verison 2.0.23
       via  fe22eec7eca third_party:waf: Print the version of waf at the end of the update script
       via  69c149f24b5 third_party: Update waf to version 2.0.22
       via  a10fd818566 third_party: Add a script to update waf
      from  e75837c115b s3: smbd: Allow a durable handle on a leased stat-open.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-15-test


- Log -----------------------------------------------------------------
commit c53efe8b48166a9ba7b42f37a7e9e712fba13486
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Mon May 23 14:11:24 2022 +0200

    s3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT
    
    Before commit 1d066f37b9217a475b6b84a935ad51fbec88fe04, when the LDAP
    connection wasn't established yet (ads->ldap.ld == NULL), the
    ads_current_time() function always allocated and initialized a new
    ADS_STRUCT even when ads->ldap.ss had a good address after having called
    ads_find_dc().
    
    After that commit, when the ADS_STRUCT is reused and passed to the
    ads_connect() call, ads_try_connect() may fail depending on the
    contacted DC because ads->config.flags field can contain the flags
    returned by the previous CLDAP call. For example, when having 5 DCs:
    
    * 192.168.101.31 has PDC FSMO role
    * 192.168.101.32
    * 192.168.101.33
    * 192.168.101.34
    * 192.168.101.35
    
    $> net ads info -S 192.168.101.35
    
    net_ads_info()
      ads_startup_nobind()
        ads_startup_int()
          ads_init()
          ads_connect()
            ads_try_connect(192.168.101.35)
              check_cldap_reply_required_flags(returned=0xF1FC, required=0x0)
      ads_current_time()
        ads_connect()
          ads_try_connect(192.168.101.35)
            check_cldap_reply_required_flags(returned=0xF1FC, required=0xF1FC)
    
    The check_cldap_reply_required_flags() call fails because
    ads->config.flags contain the flags returned by the previous CLDAP call,
    even when the returned and required values match because they have
    different semantics:
    
      if (req_flags & DS_PDC_REQUIRED)
            RETURN_ON_FALSE(ret_flags & NBT_SERVER_PDC);
    
      translates to:
    
      if (0xF1FC & 0x80)
            RETURN_ON_FALSE(0xF1FC & 0x01);
    
      which returns false because 192.168.101.35 has no PDC FSMO role.
    
    The easiest fix for now is to reset ads->config.flags in
    ads_current_time() when reusing an ADS_STRUCT before calling
    ads_connect(), but we should consider storing the required and returned
    flags in different fields or at least use the same bitmap for them
    because check_cldap_reply_required_flags() is checking a
    netr_DsRGetDCName_flags value using the nbt_server_type bitmap.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14674
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Mon May 23 19:18:38 UTC 2022 on sn-devel-184
    
    (cherry picked from commit a26f535dedc651afa2a25dd37113ac71787197ff)
    
    Autobuild-User(v4-15-test): Jule Anger <janger at samba.org>
    Autobuild-Date(v4-15-test): Mon May 30 10:11:03 UTC 2022 on sn-devel-184

commit 5a4e0a40b424061c1e87028a591dd09578516311
Author: Andreas Schneider <asn at samba.org>
Date:   Mon May 23 07:54:06 2022 +0200

    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 <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Mon May 23 09:34:51 UTC 2022 on sn-devel-184
    
    (cherry picked from commit d19dfe1efb2f6cb0dcf0a63b957df584d8ed5945)

commit e4361e407bc7802780270feab3dacea1ea76dd6d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Feb 17 15:40:20 2022 +0100

    third_party: Update waf to verison 2.0.23
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Mon Feb 21 10:06:27 UTC 2022 on sn-devel-184
    
    (cherry picked from commit fb175576b698f43224dab815fd6c0763a12db2b2)

commit fe22eec7eca23ceecbbd114bb67687dc8e1cf621
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Feb 17 15:40:38 2022 +0100

    third_party:waf: Print the version of waf at the end of the update script
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    (cherry picked from commit 6b8d30e0aa15fff7e831c0a3e34719e8cdc1ebec)

commit 69c149f24b50a25a5384f5a794ead77c63feedff
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 25 15:34:58 2021 +0200

    third_party: Update waf to version 2.0.22
    
    New in waf 2.0.22
    
    * Fix stdin propagation with faulty vcvarsall scripts #2315
    * Enable mixing Unix-style paths with destdir on Windows platforms #2337
    * Fix shell escaping unit test parameters #2314
    * Improve extras/clang_compilation_database and extras/swig compatibility #2336
    * Propagate C++ flags to the Cuda compiler in extras/cuda #2311
    * Fix detection of Qt 5.0.0 (preparation for Qt6) #2331
    * Enable Haxe processing #2308
    * Fix regression in MACOSX_DEPLOYMENT_TARGET caused by distutils #2330
    * Fix extras/wafcache concurrent trimming issues #2312
    * Fix extras/wafcache symlink handling #2327
    
    The import was done like this:
    
    ./third_party/waf/update.sh
    
    Then changing buildtools/bin/waf and buildtools/wafsamba/wafsamba.py
    by hand.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Sep  2 21:22:17 UTC 2021 on sn-devel-184
    
    (cherry picked from commit 59ed09928541d40df72592419247add608a54aca)

commit a10fd81856605732f280bc16ec1d21e5c8850551
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Aug 26 14:52:14 2021 +0200

    third_party: Add a script to update waf
    
        ./third_party/waf/update.sh
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit e41bc0f43f6d86d554f37881263c43c356994726)

-----------------------------------------------------------------------

Summary of changes:
 buildtools/bin/waf                                 |   3 +-
 buildtools/wafsamba/wafsamba.py                    |   2 +-
 source3/libads/ldap.c                              |   7 ++
 third_party/update.sh                              |   5 -
 third_party/waf/update.sh                          |  81 +++++++++++++
 third_party/waf/waflib/Build.py                    |   4 +-
 third_party/waf/waflib/Context.py                  |   8 +-
 third_party/waf/waflib/Runner.py                   |   4 +-
 third_party/waf/waflib/TaskGen.py                  |   8 +-
 third_party/waf/waflib/Tools/c_config.py           |   1 +
 third_party/waf/waflib/Tools/ccroot.py             |   1 +
 third_party/waf/waflib/Tools/compiler_c.py         |  25 ++--
 third_party/waf/waflib/Tools/compiler_cxx.py       |  25 ++--
 third_party/waf/waflib/Tools/msvc.py               |  19 ++-
 third_party/waf/waflib/Tools/python.py             |  13 +-
 third_party/waf/waflib/Tools/qt5.py                |   8 +-
 third_party/waf/waflib/Tools/tex.py                |   1 +
 third_party/waf/waflib/Tools/waf_unit_test.py      |   2 +-
 third_party/waf/waflib/Tools/winres.py             |  35 ++++++
 third_party/waf/waflib/Utils.py                    |  15 ++-
 .../waflib/extras/clang_compilation_database.py    |  30 ++---
 third_party/waf/waflib/extras/classic_runner.py    |  68 +++++++++++
 third_party/waf/waflib/extras/color_gcc.py         |   2 +-
 third_party/waf/waflib/extras/eclipse.py           |  74 +++++++++++-
 third_party/waf/waflib/extras/gccdeps.py           |  82 +++++++------
 third_party/waf/waflib/extras/haxe.py              | 131 +++++++++++++++++++++
 third_party/waf/waflib/extras/msvcdeps.py          |  54 ++++++---
 third_party/waf/waflib/extras/msvs.py              |   6 +-
 third_party/waf/waflib/extras/swig.py              |   2 +-
 third_party/waf/waflib/extras/wafcache.py          |  59 ++++++++--
 third_party/waf/waflib/fixpy2.py                   |   2 +-
 31 files changed, 630 insertions(+), 147 deletions(-)
 create mode 100755 third_party/waf/update.sh
 create mode 100644 third_party/waf/waflib/extras/classic_runner.py
 create mode 100644 third_party/waf/waflib/extras/haxe.py


Changeset truncated at 500 lines:

diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index 041450fc131..d9cba343623 100755
--- a/buildtools/bin/waf
+++ b/buildtools/bin/waf
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 import os, sys, inspect
 
-VERSION="2.0.21"
+VERSION="2.0.24"
 REVISION="x"
 GIT="x"
 INSTALL="x"
@@ -164,4 +164,3 @@ if __name__ == '__main__':
 
 	from waflib import Scripting
 	Scripting.waf_entry_point(cwd, VERSION, wafdir[0])
-
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 0427c90ca80..8a83576f89e 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -38,7 +38,7 @@ LIB_PATH="shared"
 
 os.environ['PYTHONUNBUFFERED'] = '1'
 
-if Context.HEXVERSION not in (0x2001500,):
+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 a/source3/libads/ldap.c b/source3/libads/ldap.c
index 647cdbd0459..6caeebe6037 100755
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -3305,6 +3305,13 @@ ADS_STATUS ads_current_time(ADS_STRUCT *ads)
 				goto done;
 			}
 		}
+
+		/*
+		 * Reset ads->config.flags as it can contain the flags
+		 * returned by the previous CLDAP ping when reusing the struct.
+		 */
+		ads_s->config.flags = 0;
+
 		ads_s->auth.flags = ADS_AUTH_ANON_BIND;
 		status = ads_connect( ads_s );
 		if ( !ADS_ERR_OK(status))
diff --git a/third_party/update.sh b/third_party/update.sh
index a510e8a7042..29456991874 100755
--- a/third_party/update.sh
+++ b/third_party/update.sh
@@ -23,9 +23,4 @@ hg clone https://bitbucket.org/micktwomey/pyiso8601 "$WORKDIR/pyiso8601"
 rm -rf "$WORKDIR/pyiso8601/.hg"
 rsync -avz --delete "$WORKDIR/pyiso8601/" "$THIRD_PARTY_DIR/pyiso8601/"
 
-echo "Updating waf..."
-git clone git://git.samba.org/third_party/waf.waf15/ "$WORKDIR/waf"
-rm -rf "$WORKDIR/waf/.git"
-rsync -C -avz --delete "$WORKDIR/waf/" "$THIRD_PARTY_DIR/waf/"
-
 rm -rf "$WORKDIR"
diff --git a/third_party/waf/update.sh b/third_party/waf/update.sh
new file mode 100755
index 00000000000..95f57ed1d81
--- /dev/null
+++ b/third_party/waf/update.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+if [[ $# -lt 1 ]]; then
+    echo "Usage: update.sh VERSION"
+    exit 1
+fi
+
+WAF_VERSION="${1}"
+WAF_GIT="https://gitlab.com/ita1024/waf.git"
+WAF_UPDATE_SCRIPT="$(readlink -f "$0")"
+WAF_SAMBA_DIR="$(dirname "${WAF_UPDATE_SCRIPT}")"
+WAF_TMPDIR=$(mktemp --tmpdir -d waf-XXXXXXXX)
+
+echo "VERSION:       ${WAF_VERSION}"
+echo "GIT URL:       ${WAF_GIT}"
+echo "WAF SAMBA DIR: ${WAF_SAMBA_DIR}"
+echo "WAF TMP DIR:    ${WAF_TMPDIR}"
+
+cleanup_tmpdir() {
+    popd 2>/dev/null || true
+    rm -rf "$WAF_TMPDIR"
+}
+trap cleanup_tmpdir SIGINT
+
+cleanup_and_exit() {
+    cleanup_tmpdir
+    if test "$1" = 0 -o -z "$1" ; then
+        exit 0
+    else
+        exit "$1"
+    fi
+}
+
+# Checkout the git tree
+mkdir -p "${WAF_TMPDIR}"
+pushd "${WAF_TMPDIR}" || cleanup_and_exit 1
+
+git clone "${WAF_GIT}"
+ret=$?
+if [ $ret -ne 0 ]; then
+    echo "ERROR: Failed to clone repository"
+    cleanup_and_exit 1
+fi
+
+
+pushd waf || cleanup_and_exit 1
+git checkout -b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}"
+ret=$?
+if [ $ret -ne 0 ]; then
+    echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository"
+    cleanup_and_exit 1
+fi
+popd || cleanup_and_exit 1
+
+popd || cleanup_and_exit 1
+
+# Update waflib
+pushd "${WAF_SAMBA_DIR}" || cleanup_and_exit 1
+pwd
+
+rm -rf waflib/
+rsync -av "${WAF_TMPDIR}/waf/waflib" .
+ret=$?
+if [ $ret -ne 0 ]; then
+    echo "ERROR: Failed copy waflib"
+    cleanup_and_exit 1
+fi
+chmod -x waflib/Context.py
+
+git add waflib
+
+popd || cleanup_and_exit 1
+
+echo
+echo "Now please change VERSION in buildtools/bin/waf and"
+echo "Context.HEXVERSION in buildtools/wafsamba/wafsamba.py"
+grep WAFVERSION "${WAF_SAMBA_DIR}/waflib/Context.py"
+grep HEXVERSION "${WAF_SAMBA_DIR}/waflib/Context.py"
+echo
+
+cleanup_and_exit 0
\ No newline at end of file
diff --git a/third_party/waf/waflib/Build.py b/third_party/waf/waflib/Build.py
index 52837618577..b49dd8302b1 100644
--- a/third_party/waf/waflib/Build.py
+++ b/third_party/waf/waflib/Build.py
@@ -1066,9 +1066,9 @@ class inst(Task.Task):
 		else:
 			dest = os.path.normpath(Utils.subst_vars(self.install_to, self.env))
 		if not os.path.isabs(dest):
-		    dest = os.path.join(self.env.PREFIX, dest)
+			dest = os.path.join(self.env.PREFIX, dest)
 		if destdir and Options.options.destdir:
-			dest = os.path.join(Options.options.destdir, os.path.splitdrive(dest)[1].lstrip(os.sep))
+			dest = Options.options.destdir.rstrip(os.sep) + os.sep + os.path.splitdrive(dest)[1].lstrip(os.sep)
 		return dest
 
 	def copy_fun(self, src, tgt):
diff --git a/third_party/waf/waflib/Context.py b/third_party/waf/waflib/Context.py
index 0ce9df6e91f..4a0130b24a0 100644
--- a/third_party/waf/waflib/Context.py
+++ b/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=0x2001500
+HEXVERSION=0x2001800
 """Constant updated on new releases"""
 
-WAFVERSION="2.0.21"
+WAFVERSION="2.0.24"
 """Constant updated on new releases"""
 
-WAFREVISION="edde20a6425a5c3eb6b47d5f3f5c4fbc93fed5f4"
+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 a/third_party/waf/waflib/Runner.py b/third_party/waf/waflib/Runner.py
index 91d55479e20..350c86a22c0 100644
--- a/third_party/waf/waflib/Runner.py
+++ b/third_party/waf/waflib/Runner.py
@@ -71,7 +71,7 @@ class Consumer(Utils.threading.Thread):
 		"""Task to execute"""
 		self.spawner = spawner
 		"""Coordinator object"""
-		self.setDaemon(1)
+		self.daemon = True
 		self.start()
 	def run(self):
 		"""
@@ -98,7 +98,7 @@ class Spawner(Utils.threading.Thread):
 		""":py:class:`waflib.Runner.Parallel` producer instance"""
 		self.sem = Utils.threading.Semaphore(master.numjobs)
 		"""Bounded semaphore that prevents spawning more than *n* concurrent consumers"""
-		self.setDaemon(1)
+		self.daemon = True
 		self.start()
 	def run(self):
 		"""
diff --git a/third_party/waf/waflib/TaskGen.py b/third_party/waf/waflib/TaskGen.py
index f8f92bd57c1..89f63169910 100644
--- a/third_party/waf/waflib/TaskGen.py
+++ b/third_party/waf/waflib/TaskGen.py
@@ -631,12 +631,8 @@ def process_rule(self):
 			cls.scan = self.scan
 		elif has_deps:
 			def scan(self):
-				nodes = []
-				for x in self.generator.to_list(getattr(self.generator, 'deps', None)):
-					node = self.generator.path.find_resource(x)
-					if not node:
-						self.generator.bld.fatal('Could not find %r (was it declared?)' % x)
-					nodes.append(node)
+				deps = getattr(self.generator, 'deps', None)
+				nodes = self.generator.to_nodes(deps)
 				return [nodes, []]
 			cls.scan = scan
 
diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py
index 03b6bf61bc0..f5ab19bf6ce 100644
--- a/third_party/waf/waflib/Tools/c_config.py
+++ b/third_party/waf/waflib/Tools/c_config.py
@@ -69,6 +69,7 @@ MACRO_TO_DEST_CPU = {
 '__sh__'      : 'sh',
 '__xtensa__'  : 'xtensa',
 '__e2k__'     : 'e2k',
+'__riscv'     : 'riscv',
 }
 
 @conf
diff --git a/third_party/waf/waflib/Tools/ccroot.py b/third_party/waf/waflib/Tools/ccroot.py
index 579d5b2b72b..76deff54dcb 100644
--- a/third_party/waf/waflib/Tools/ccroot.py
+++ b/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 a/third_party/waf/waflib/Tools/compiler_c.py b/third_party/waf/waflib/Tools/compiler_c.py
index 931dc57efec..e033ce6c5c3 100644
--- a/third_party/waf/waflib/Tools/compiler_c.py
+++ b/third_party/waf/waflib/Tools/compiler_c.py
@@ -36,18 +36,19 @@ from waflib import Utils
 from waflib.Logs import debug
 
 c_compiler = {
-'win32':  ['msvc', 'gcc', 'clang'],
-'cygwin': ['gcc', 'clang'],
-'darwin': ['clang', 'gcc'],
-'aix':    ['xlc', 'gcc', 'clang'],
-'linux':  ['gcc', 'clang', 'icc'],
-'sunos':  ['suncc', 'gcc'],
-'irix':   ['gcc', 'irixcc'],
-'hpux':   ['gcc'],
-'osf1V':  ['gcc'],
-'gnu':    ['gcc', 'clang'],
-'java':   ['gcc', 'msvc', 'clang', 'icc'],
-'default':['clang', 'gcc'],
+'win32':       ['msvc', 'gcc', 'clang'],
+'cygwin':      ['gcc', 'clang'],
+'darwin':      ['clang', 'gcc'],
+'aix':         ['xlc', 'gcc', 'clang'],
+'linux':       ['gcc', 'clang', 'icc'],
+'sunos':       ['suncc', 'gcc'],
+'irix':        ['gcc', 'irixcc'],
+'hpux':        ['gcc'],
+'osf1V':       ['gcc'],
+'gnu':         ['gcc', 'clang'],
+'java':        ['gcc', 'msvc', 'clang', 'icc'],
+'gnukfreebsd': ['gcc', 'clang'],
+'default':     ['clang', 'gcc'],
 }
 """
 Dict mapping platform names to Waf tools finding specific C compilers::
diff --git a/third_party/waf/waflib/Tools/compiler_cxx.py b/third_party/waf/waflib/Tools/compiler_cxx.py
index 09fca7e4dc6..42658c5847e 100644
--- a/third_party/waf/waflib/Tools/compiler_cxx.py
+++ b/third_party/waf/waflib/Tools/compiler_cxx.py
@@ -37,18 +37,19 @@ from waflib import Utils
 from waflib.Logs import debug
 
 cxx_compiler = {
-'win32':  ['msvc', 'g++', 'clang++'],
-'cygwin': ['g++', 'clang++'],
-'darwin': ['clang++', 'g++'],
-'aix':    ['xlc++', 'g++', 'clang++'],
-'linux':  ['g++', 'clang++', 'icpc'],
-'sunos':  ['sunc++', 'g++'],
-'irix':   ['g++'],
-'hpux':   ['g++'],
-'osf1V':  ['g++'],
-'gnu':    ['g++', 'clang++'],
-'java':   ['g++', 'msvc', 'clang++', 'icpc'],
-'default': ['clang++', 'g++']
+'win32':       ['msvc', 'g++', 'clang++'],
+'cygwin':      ['g++', 'clang++'],
+'darwin':      ['clang++', 'g++'],
+'aix':         ['xlc++', 'g++', 'clang++'],
+'linux':       ['g++', 'clang++', 'icpc'],
+'sunos':       ['sunc++', 'g++'],
+'irix':        ['g++'],
+'hpux':        ['g++'],
+'osf1V':       ['g++'],
+'gnu':         ['g++', 'clang++'],
+'java':        ['g++', 'msvc', 'clang++', 'icpc'],
+'gnukfreebsd': ['g++', 'clang++'],
+'default':     ['clang++', 'g++']
 }
 """
 Dict mapping the platform names to Waf tools finding specific C++ compilers::
diff --git a/third_party/waf/waflib/Tools/msvc.py b/third_party/waf/waflib/Tools/msvc.py
index 37233be8242..026a4c7fc48 100644
--- a/third_party/waf/waflib/Tools/msvc.py
+++ b/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)
@@ -193,7 +208,7 @@ echo PATH=%%PATH%%
 echo INCLUDE=%%INCLUDE%%
 echo LIB=%%LIB%%;%%LIBPATH%%
 """ % (vcvars,target))
-	sout = conf.cmd_and_log(['cmd.exe', '/E:on', '/V:on', '/C', batfile.abspath()])
+	sout = conf.cmd_and_log(['cmd.exe', '/E:on', '/V:on', '/C', batfile.abspath()], stdin=getattr(Utils.subprocess, 'DEVNULL', None))
 	lines = sout.splitlines()
 
 	if not lines[0]:
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py
index b1c8dd01285..a23bd019335 100644
--- a/third_party/waf/waflib/Tools/python.py
+++ b/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:
@@ -327,8 +327,8 @@ def check_python_headers(conf, features='pyembed pyext'):
 	dct = dict(zip(v, lst))
 	x = 'MACOSX_DEPLOYMENT_TARGET'
 	if dct[x]:
-		env[x] = conf.environ[x] = dct[x]
-	env.pyext_PATTERN = '%s' + dct['SO'] # not a mistake
+		env[x] = conf.environ[x] = str(dct[x])
+	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
@@ -416,9 +416,14 @@ def check_python_headers(conf, features='pyembed pyext'):
 
 		if not result:
 			path = [os.path.join(dct['prefix'], "libs")]
-			conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY name rather than pythonX.Y (win32)\n")
+			conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY rather than pythonX.Y (win32)\n")
 			result = conf.check(lib=name, uselib='PYEMBED', libpath=path, mandatory=False, msg='Checking for library %s in $prefix/libs' % name)
 
+		if not result:
+			path = [os.path.normpath(os.path.join(dct['INCLUDEPY'], '..', 'libs'))]
+			conf.to_log("\n\n# try again with -L$INCLUDEPY/../libs, and pythonXY rather than pythonX.Y (win32)\n")
+			result = conf.check(lib=name, uselib='PYEMBED', libpath=path, mandatory=False, msg='Checking for library %s in $INCLUDEPY/../libs' % name)
+
 		if result:
 			break # do not forget to set LIBPATH_PYEMBED
 
diff --git a/third_party/waf/waflib/Tools/qt5.py b/third_party/waf/waflib/Tools/qt5.py
index cff2028174f..b3e61325e50 100644
--- a/third_party/waf/waflib/Tools/qt5.py
+++ b/third_party/waf/waflib/Tools/qt5.py
@@ -566,7 +566,7 @@ def find_qt5_binaries(self):
 	# at the end, try to find qmake in the paths given
 	# keep the one with the highest version
 	cand = None
-	prev_ver = ['5', '0', '0']
+	prev_ver = ['0', '0', '0']
 	for qmk in ('qmake-qt5', 'qmake5', 'qmake'):
 		try:
 			qmake = self.find_program(qmk, path_list=paths)
@@ -580,7 +580,7 @@ def find_qt5_binaries(self):
 			else:
 				if version:
 					new_ver = version.split('.')
-					if new_ver > prev_ver:
+					if new_ver[0] == '5' and new_ver > prev_ver:
 						cand = qmake
 						prev_ver = new_ver
 
@@ -783,8 +783,8 @@ def set_qt5_libs_to_check(self):
 			pat = self.env.cxxstlib_PATTERN
 		if Utils.unversioned_sys_platform() == 'darwin':
 			pat = r"%s\.framework"
-		re_qt = re.compile(pat%'Qt5?(?P<name>.*)'+'$')
-		for x in dirlst:
+		re_qt = re.compile(pat % 'Qt5?(?P<name>\\w+)' + '$')
+		for x in sorted(dirlst):
 			m = re_qt.match(x)
 			if m:
 				self.qt5_vars.append("Qt5%s" % m.group('name'))
diff --git a/third_party/waf/waflib/Tools/tex.py b/third_party/waf/waflib/Tools/tex.py
index eaf9fdb5802..b4792c3fe87 100644
--- a/third_party/waf/waflib/Tools/tex.py
+++ b/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)
diff --git a/third_party/waf/waflib/Tools/waf_unit_test.py b/third_party/waf/waflib/Tools/waf_unit_test.py
index dc66fe9c184..8cff89bdeb9 100644
--- a/third_party/waf/waflib/Tools/waf_unit_test.py
+++ b/third_party/waf/waflib/Tools/waf_unit_test.py
@@ -206,7 +206,7 @@ class utest(Task.Task):
 		self.ut_exec = getattr(self.generator, 'ut_exec', [self.inputs[0].abspath()])
 		ut_cmd = getattr(self.generator, 'ut_cmd', False)
 		if ut_cmd:
-			self.ut_exec = shlex.split(ut_cmd % ' '.join(self.ut_exec))
+			self.ut_exec = shlex.split(ut_cmd % Utils.shell_escape(self.ut_exec))
 
 		return self.exec_command(self.ut_exec)
 
diff --git a/third_party/waf/waflib/Tools/winres.py b/third_party/waf/waflib/Tools/winres.py
index 9be1ed66009..73c0e95315b 100644
--- a/third_party/waf/waflib/Tools/winres.py
+++ b/third_party/waf/waflib/Tools/winres.py
@@ -4,10 +4,12 @@
 
 "Process *.rc* files for C/C++: X{.rc -> [.res|.rc.o]}"
 
+import os
 import re
 from waflib import Task
 from waflib.TaskGen import extension
 from waflib.Tools import c_preproc
+from waflib import Utils
 
 @extension('.rc')
 def rc_file(self, node):
@@ -61,6 +63,39 @@ class winrc(Task.Task):
 		tmp.start(self.inputs[0], self.env)
 		return (tmp.nodes, tmp.names)
 
+	def exec_command(self, cmd, **kw):
+		if self.env.WINRC_TGT_F == '/fo':
+			# Since winres include paths may contain spaces, they do not fit in


-- 
Samba Shared Repository



More information about the samba-cvs mailing list