The branch, v4-16-test has been updated
       via  e3de2bdb859 s3/client: Restore '-E' handling
       via  239e0759db3 s3/script/tests: Test smbclient -E redirects output to 
stderr
       via  53ac81eef24 s3:libads: Clear previous CLDAP ping flags when reusing 
the ADS_STRUCT
       via  b09a37cd821 third_party: Update waf to version 2.0.24
       via  32a573463e8 third_party: Update waf to verison 2.0.23
       via  8385893f4c6 third_party:waf: Print the version of waf at the end of 
the update script
      from  f23f9132f7c srvsvc: Announce [username] in NetShareEnum

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


- Log -----------------------------------------------------------------
commit e3de2bdb8590684dfffa9974f1b45a571845e72b
Author: Noel Power <noel.po...@suse.com>
Date:   Mon May 23 17:23:41 2022 +0100

    s3/client: Restore '-E' handling
    
    Sometimes we really do need to redirect output to stderr
    e.g. when using the tar command to output the archive to stdout
    we don't want debug or cmdline status messages straying into stdout.
    
    was removed with commit: e4474ac0a540c56548b4d15e38f2e234455e19b6
    
    remove known fail for the test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075
    Signed-off-by: Noel Power <noel.po...@suse.com>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    
    Autobuild-User(master): Noel Power <npo...@samba.org>
    Autobuild-Date(master): Tue May 24 10:29:27 UTC 2022 on sn-devel-184
    
    (cherry picked from commit 56e179817123b40c3646476563d345d8f97efff9)
    
    Autobuild-User(v4-16-test): Jule Anger <jan...@samba.org>
    Autobuild-Date(v4-16-test): Mon May 30 09:10:47 UTC 2022 on sn-devel-184

commit 239e0759db3d3b52ff78b326b779635900b7551e
Author: Noel Power <noel.po...@suse.com>
Date:   Mon May 23 20:11:13 2022 +0100

    s3/script/tests: Test smbclient -E redirects output to stderr
    
    Add new test to ensure smbclient is writing to stderr (with '-E')
    Add knownfail for this test (will be removed when issue is fixed in
    later commit)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075
    Signed-off-by: Noel Power <noel.po...@suse.com>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    (cherry picked from commit 5b6493043fc90a2bed5aaedad3b4511621d0b9fd)

commit 53ac81eef24f1c60d2d9cdc9c5f21ade32275d81
Author: Samuel Cabrero <scabr...@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 <scabr...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Mon May 23 19:18:38 UTC 2022 on sn-devel-184
    
    (cherry picked from commit a26f535dedc651afa2a25dd37113ac71787197ff)

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

commit 32a573463e8ccd9d562832c3e7721305e34082a1
Author: Andreas Schneider <a...@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 <a...@samba.org>
    Reviewed-by: Alexander Bokovoy <a...@samba.org>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Mon Feb 21 10:06:27 UTC 2022 on sn-devel-184
    
    (cherry picked from commit fb175576b698f43224dab815fd6c0763a12db2b2)

commit 8385893f4c62605ea712904f44818a408a115d32
Author: Andreas Schneider <a...@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 <a...@samba.org>
    Reviewed-by: Alexander Bokovoy <a...@samba.org>
    (cherry picked from commit 6b8d30e0aa15fff7e831c0a3e34719e8cdc1ebec)

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

Summary of changes:
 buildtools/bin/waf                                 |  3 +-
 buildtools/wafsamba/wafsamba.py                    |  2 +-
 source3/client/client.c                            |  5 ++
 source3/libads/ldap.c                              |  7 ++
 source3/script/tests/test_smbclient_s3.sh          | 45 ++++++++++++
 third_party/waf/update.sh                          |  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               | 17 ++++-
 third_party/waf/waflib/Tools/python.py             | 11 ++-
 third_party/waf/waflib/Tools/qt5.py                |  4 +-
 third_party/waf/waflib/Tools/tex.py                |  1 +
 third_party/waf/waflib/Tools/winres.py             | 35 +++++++++
 .../waflib/extras/clang_compilation_database.py    |  2 +-
 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/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          | 26 +++----
 third_party/waf/waflib/fixpy2.py                   |  2 +-
 28 files changed, 406 insertions(+), 118 deletions(-)
 create mode 100644 third_party/waf/waflib/extras/classic_runner.py


Changeset truncated at 500 lines:

diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index b0ccb09a877..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.22"
+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 185ef3b73a2..7885ee720be 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 (0x2001600,):
+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/client/client.c b/source3/client/client.c
index 690f9deaec9..8ec4589a1cd 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -6552,6 +6552,11 @@ int main(int argc,char *argv[])
                                print_sockaddr(dest_ss_str, 
sizeof(dest_ss_str), &dest_ss);
                        }
                        break;
+               case 'E':
+                       setup_logging("smbclient", DEBUG_STDERR );
+                       display_set_stderr();
+                       break;
+
                case 'L':
                        query_host = talloc_strdup(frame, poptGetOptArg(pc));
                        if (!query_host) {
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/source3/script/tests/test_smbclient_s3.sh 
b/source3/script/tests/test_smbclient_s3.sh
index 3da37e699e6..fc608bdfc9b 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -2043,6 +2043,47 @@ EOF
     return 0
 }
 
+test_smbclient_minus_e_stderr()
+{
+    cmd='$SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -c ls'
+    eval echo "$cmd"
+    out=`eval $cmd`
+    if [ $? != 0 ] ; then
+       echo "$out"
+       echo "command failed"
+       return 1
+    fi
+
+    # test smbclient 'ls' command output went to stdout
+    echo "$out" | grep "blocks available" >/dev/null 2>&1
+    if [ $? != 0 ] ; then
+       # didn't get output to stdout
+       echo "expected output was NOT output to stdout"
+       return 1
+    fi
+
+    # this time execute ls but redirect stdout alone to /dev/null
+    cmd='$SMBCLIENT -E "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -c "ls"  2>&1 
> /dev/null'
+    eval echo "$cmd"
+    out=`eval $cmd`
+    if [ $? != 0 ] ; then
+       echo "$out"
+       echo "command failed"
+       return 1
+    fi
+
+    # test smbclient 'ls' command output went to stderr
+    echo "$out" | grep "blocks available" >/dev/null 2>&1
+    if [ $? != 0 ] ; then
+       # didn't get output to stderr
+       echo "expected output was NOT output to stderr"
+       return 1
+    fi
+
+    return 0
+
+}
+
 #
 #
 LOGDIR_PREFIX=test_smbclient_s3
@@ -2068,6 +2109,10 @@ testit "noninteractive smbclient -l does not prompt" \
    test_noninteractive_no_prompt -l $LOGDIR || \
     failed=`expr $failed + 1`
 
+testit "smbclient output goes to stderr when -E is passed" \
+    test_smbclient_minus_e_stderr || \
+    failed=`expr $failed + 1`
+
 testit "interactive smbclient prompts on stdout" \
    test_interactive_prompt_stdout || \
     failed=`expr $failed + 1`
diff --git a/third_party/waf/update.sh b/third_party/waf/update.sh
index 16bda84a3f0..95f57ed1d81 100755
--- a/third_party/waf/update.sh
+++ b/third_party/waf/update.sh
@@ -74,6 +74,8 @@ 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
+cleanup_and_exit 0
\ No newline at end of file
diff --git a/third_party/waf/waflib/Context.py 
b/third_party/waf/waflib/Context.py
index 07ee1201f03..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=0x2001600
+HEXVERSION=0x2001800
 """Constant updated on new releases"""
 
-WAFVERSION="2.0.22"
+WAFVERSION="2.0.24"
 """Constant updated on new releases"""
 
-WAFREVISION="816d5bc48ba2abc4ac22f2b44d94d322bf992b9c"
+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 0c4703aaee9..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)
diff --git a/third_party/waf/waflib/Tools/python.py 
b/third_party/waf/waflib/Tools/python.py
index 07442561dff..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:
@@ -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
@@ -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 82c83e18c8a..b3e61325e50 100644
--- a/third_party/waf/waflib/Tools/qt5.py
+++ b/third_party/waf/waflib/Tools/qt5.py
@@ -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>\\D+)' + '$')
-               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/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
+                       # response files and are best passed as environment 
variables
+                       replace_cmd = []
+                       incpaths = []
+                       while cmd:
+                               # filter include path flags
+                               flag = cmd.pop(0)
+                               if flag.upper().startswith('/I'):
+                                       if len(flag) == 2:
+                                               incpaths.append(cmd.pop(0))
+                                       else:
+                                               incpaths.append(flag[2:])
+                               else:
+                                       replace_cmd.append(flag)
+                       cmd = replace_cmd
+                       if incpaths:
+                               # append to existing environment variables in 
INCLUDE
+                               env = kw['env'] = dict(kw.get('env') or 
self.env.env or os.environ)
+                               pre_includes = env.get('INCLUDE', '')
+                               env['INCLUDE'] = pre_includes + os.pathsep + 
os.pathsep.join(incpaths)
+
+               return super(winrc, self).exec_command(cmd, **kw)
+
+       def quote_flag(self, flag):
+               if self.env.WINRC_TGT_F == '/fo':
+                       # winres does not support quotes around flags in 
response files
+                       return flag
+
+               return super(winrc, self).quote_flag(flag)
+
+
 def configure(conf):
        """
        Detects the programs RC or windres, depending on the C/C++ compiler in 
use
diff --git a/third_party/waf/waflib/extras/clang_compilation_database.py 
b/third_party/waf/waflib/extras/clang_compilation_database.py
index 17f66949376..bd29db93fd5 100644
--- a/third_party/waf/waflib/extras/clang_compilation_database.py
+++ b/third_party/waf/waflib/extras/clang_compilation_database.py
@@ -126,7 +126,7 @@ def patch_execute():
                Invoke clangdb command before build
                """
                if self.cmd.startswith('build'):
-                       Scripting.run_command('clangdb')
+                       
Scripting.run_command(self.cmd.replace('build','clangdb'))
 
                old_execute_build(self)
 
diff --git a/third_party/waf/waflib/extras/classic_runner.py 
b/third_party/waf/waflib/extras/classic_runner.py
new file mode 100644
index 00000000000..b08c794e880
--- /dev/null
+++ b/third_party/waf/waflib/extras/classic_runner.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2021 (ita)
+
+from waflib import Utils, Runner
+
+"""
+Re-enable the classic threading system from waf 1.x
+
+def configure(conf):
+       conf.load('classic_runner')
+"""
+
+class TaskConsumer(Utils.threading.Thread):


-- 
Samba Shared Repository

Reply via email to