[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Thu Sep 2 21:23:01 UTC 2021
The branch, master has been updated
via 59ed0992854 third_party: Update waf to version 2.0.22
via e41bc0f43f6 third_party: Add a script to update waf
from d0f6d54354b winbind: ensure wb_parent_idmap_setup_send() gets called in winbindd_allocate_uid_send()
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 59ed09928541d40df72592419247add608a54aca
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
commit e41bc0f43f6d86d554f37881263c43c356994726
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>
-----------------------------------------------------------------------
Summary of changes:
buildtools/bin/waf | 2 +-
buildtools/wafsamba/wafsamba.py | 2 +-
third_party/update.sh | 5 -
third_party/waf/update.sh | 79 +++++++++++++
third_party/waf/waflib/Build.py | 4 +-
third_party/waf/waflib/Context.py | 6 +-
third_party/waf/waflib/Tools/msvc.py | 2 +-
third_party/waf/waflib/Tools/python.py | 2 +-
third_party/waf/waflib/Tools/qt5.py | 6 +-
third_party/waf/waflib/Tools/waf_unit_test.py | 2 +-
third_party/waf/waflib/Utils.py | 15 ++-
.../waflib/extras/clang_compilation_database.py | 28 +++--
third_party/waf/waflib/extras/haxe.py | 131 +++++++++++++++++++++
third_party/waf/waflib/extras/wafcache.py | 59 ++++++++--
14 files changed, 294 insertions(+), 49 deletions(-)
create mode 100755 third_party/waf/update.sh
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..b0ccb09a877 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.22"
REVISION="x"
GIT="x"
INSTALL="x"
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 4fe9daf160e..dee007bf84e 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 (0x2001600,):
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/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..16bda84a3f0
--- /dev/null
+++ b/third_party/waf/update.sh
@@ -0,0 +1,79 @@
+#!/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"
+echo
+
+cleanup_and_exit 0
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..07ee1201f03 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=0x2001600
"""Constant updated on new releases"""
-WAFVERSION="2.0.21"
+WAFVERSION="2.0.22"
"""Constant updated on new releases"""
-WAFREVISION="edde20a6425a5c3eb6b47d5f3f5c4fbc93fed5f4"
+WAFREVISION="816d5bc48ba2abc4ac22f2b44d94d322bf992b9c"
"""Git revision when the waf version is updated"""
WAFNAME="waf"
diff --git a/third_party/waf/waflib/Tools/msvc.py b/third_party/waf/waflib/Tools/msvc.py
index 37233be8242..0c4703aaee9 100644
--- a/third_party/waf/waflib/Tools/msvc.py
+++ b/third_party/waf/waflib/Tools/msvc.py
@@ -193,7 +193,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..07442561dff 100644
--- a/third_party/waf/waflib/Tools/python.py
+++ b/third_party/waf/waflib/Tools/python.py
@@ -327,7 +327,7 @@ 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[x] = conf.environ[x] = str(dct[x])
env.pyext_PATTERN = '%s' + dct['SO'] # not a mistake
diff --git a/third_party/waf/waflib/Tools/qt5.py b/third_party/waf/waflib/Tools/qt5.py
index cff2028174f..82c83e18c8a 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,7 +783,7 @@ 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>.*)'+'$')
+ re_qt = re.compile(pat % 'Qt5?(?P<name>\\D+)' + '$')
for x in dirlst:
m = re_qt.match(x)
if m:
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/Utils.py b/third_party/waf/waflib/Utils.py
index fc64fa05154..669490ca908 100644
--- a/third_party/waf/waflib/Utils.py
+++ b/third_party/waf/waflib/Utils.py
@@ -11,7 +11,7 @@ through Python versions 2.5 to 3.X and across different platforms (win32, linux,
from __future__ import with_statement
-import atexit, os, sys, errno, inspect, re, datetime, platform, base64, signal, functools, time
+import atexit, os, sys, errno, inspect, re, datetime, platform, base64, signal, functools, time, shlex
try:
import cPickle
@@ -577,10 +577,13 @@ def quote_define_name(s):
fu = fu.upper()
return fu
-re_sh = re.compile('\\s|\'|"')
-"""
-Regexp used for shell_escape below
-"""
+# shlex.quote didn't exist until python 3.3. Prior to that it was a non-documented
+# function in pipes.
+try:
+ shell_quote = shlex.quote
+except AttributeError:
+ import pipes
+ shell_quote = pipes.quote
def shell_escape(cmd):
"""
@@ -589,7 +592,7 @@ def shell_escape(cmd):
"""
if isinstance(cmd, str):
return cmd
- return ' '.join(repr(x) if re_sh.search(x) else x for x in cmd)
+ return ' '.join(shell_quote(x) for x in cmd)
def h_list(lst):
"""
diff --git a/third_party/waf/waflib/extras/clang_compilation_database.py b/third_party/waf/waflib/extras/clang_compilation_database.py
index ff71f22ecfd..17f66949376 100644
--- a/third_party/waf/waflib/extras/clang_compilation_database.py
+++ b/third_party/waf/waflib/extras/clang_compilation_database.py
@@ -29,22 +29,9 @@ from waflib import Logs, TaskGen, Task, Build, Scripting
Task.Task.keep_last_cmd = True
- at TaskGen.feature('c', 'cxx')
- at TaskGen.after_method('process_use')
-def collect_compilation_db_tasks(self):
- "Add a compilation database entry for compiled tasks"
- if not isinstance(self.bld, ClangDbContext):
- return
-
- tup = tuple(y for y in [Task.classes.get(x) for x in ('c', 'cxx')] if y)
- for task in getattr(self, 'compiled_tasks', []):
- if isinstance(task, tup):
- self.bld.clang_compilation_database_tasks.append(task)
-
class ClangDbContext(Build.BuildContext):
'''generates compile_commands.json by request'''
cmd = 'clangdb'
- clang_compilation_database_tasks = []
def write_compilation_database(self):
"""
@@ -78,6 +65,8 @@ class ClangDbContext(Build.BuildContext):
Build dry run
"""
self.restore()
+ self.cur_tasks = []
+ self.clang_compilation_database_tasks = []
if not self.all_envs:
self.load_envs()
@@ -103,8 +92,21 @@ class ClangDbContext(Build.BuildContext):
lst = [tg]
else: lst = tg.tasks
for tsk in lst:
+ if tsk.__class__.__name__ == "swig":
+ tsk.runnable_status()
+ if hasattr(tsk, 'more_tasks'):
+ lst.extend(tsk.more_tasks)
+ # Not all dynamic tasks can be processed, in some cases
+ # one may have to call the method "run()" like this:
+ #elif tsk.__class__.__name__ == 'src2c':
+ # tsk.run()
+ # if hasattr(tsk, 'more_tasks'):
+ # lst.extend(tsk.more_tasks)
+
tup = tuple(y for y in [Task.classes.get(x) for x in ('c', 'cxx')] if y)
if isinstance(tsk, tup):
+ self.clang_compilation_database_tasks.append(tsk)
+ tsk.nocache = True
old_exec = tsk.exec_command
tsk.exec_command = exec_command
tsk.run()
diff --git a/third_party/waf/waflib/extras/haxe.py b/third_party/waf/waflib/extras/haxe.py
new file mode 100644
index 00000000000..cb3ba6a949c
--- /dev/null
+++ b/third_party/waf/waflib/extras/haxe.py
@@ -0,0 +1,131 @@
+import os, re
+from waflib import Utils, Task, Errors
+from waflib.TaskGen import extension, taskgen_method, feature
+from waflib.Configure import conf
+
+ at conf
+def libname_haxe(self, libname):
+ return libname
+
+ at conf
+def check_lib_haxe(self, libname, uselib_store=None):
+ haxe_libs = [node.name for node in self.root.find_node('haxe_libraries').ant_glob()]
+ changed = False
+ self.start_msg('Checking for library %s' % libname)
+ if libname + '.hxml' in haxe_libs:
+ self.end_msg('yes')
+ else:
+ changed = True
+ try:
+ cmd = self.env.LIX + ['+lib', libname]
+ res = self.cmd_and_log(cmd)
+ if (res):
+ raise Errors.WafError(res)
+ else:
+ self.end_msg('downloaded', color = 'YELLOW')
+ except Errors.WafError as e:
+ self.end_msg('no', color = 'RED')
+ self.fatal('Getting %s has failed' % libname)
+
+ postfix = uselib_store if uselib_store else libname.upper()
+ self.env['LIB_' + postfix] += [self.libname_haxe(libname)]
+ return changed
+
+ at conf
+def check_libs_haxe(self, libnames, uselib_store=None):
+ changed = False
+ for libname in Utils.to_list(libnames):
+ if self.check_lib_haxe(libname, uselib_store):
+ changed = True
+ return changed
+
+ at conf
+def ensure_lix_pkg(self, *k, **kw):
+ if kw.get('compiler') == 'hx':
+ if isinstance(kw.get('libs'), list) and len(kw.get('libs')):
+ changed = self.check_libs_haxe(kw.get('libs'), kw.get('uselib_store'))
+ if changed:
+ try:
+ cmd = self.env.LIX + ['download']
+ res = self.cmd_and_log(cmd)
+ if (res):
+ raise Errors.WafError(res)
+ except Errors.WafError as e:
+ self.fatal('lix download has failed')
+ else:
+ self.check_lib_haxe(kw.get('lib'), kw.get('uselib_store'))
+
+ at conf
+def haxe(bld, *k, **kw):
+ task_gen = bld(*k, **kw)
+
+class haxe(Task.Task):
+ vars = ['HAXE', 'HAXE_VERSION', 'HAXEFLAGS']
+ ext_out = ['.hl', '.c', '.h']
+
+ def run(self):
+ cmd = self.env.HAXE + self.env.HAXEFLAGS
+ return self.exec_command(cmd, stdout = open(os.devnull, 'w'))
+
+ at taskgen_method
+def init_haxe_task(self, node):
+ def addflags(flags):
+ self.env.append_value('HAXEFLAGS', flags)
+
+ if node.suffix() == '.hxml':
+ addflags(self.path.abspath() + '/' + node.name)
+ else:
+ addflags(['-main', node.name])
+ addflags(['-hl', self.path.get_bld().make_node(self.target).abspath()])
+ addflags(['-cp', self.path.abspath()])
+ addflags(['-D', 'resourcesPath=%s' % getattr(self, 'res', '')])
+ if hasattr(self, 'use'):
+ for dep in self.use:
+ if self.env['LIB_' + dep]:
+ for lib in self.env['LIB_' + dep]: addflags(['-lib', lib])
+
+ at extension('.hx', '.hxml')
+def haxe_file(self, node):
+ if len(self.source) > 1:
+ self.bld.fatal('Use separate task generators for multiple files')
+
+ try:
+ haxetask = self.haxetask
+ except AttributeError:
+ haxetask = self.haxetask = self.create_task('haxe')
+ self.init_haxe_task(node)
+
+ haxetask.inputs.append(node)
+ haxetask.outputs.append(self.path.get_bld().make_node(self.target))
+
+ at conf
+def find_haxe(self, min_version):
+ npx = self.env.NPX = self.find_program('npx')
+ self.env.LIX = npx + ['lix']
+ npx_haxe = self.env.HAXE = npx + ['haxe']
+ try:
+ output = self.cmd_and_log(npx_haxe + ['-version'])
+ except Errors.WafError:
+ haxe_version = None
+ else:
+ ver = re.search(r'\d+.\d+.\d+', output).group().split('.')
+ haxe_version = tuple([int(x) for x in ver])
+
+ self.msg('Checking for haxe version',
+ haxe_version, haxe_version and haxe_version >= min_version)
+ if npx_haxe and haxe_version < min_version:
+ self.fatal('haxe version %r is too old, need >= %r' % (haxe_version, min_version))
+
+ self.env.HAXE_VERSION = haxe_version
+ return npx_haxe
+
+ at conf
+def check_haxe(self, min_version=(4,1,4)):
+ if self.env.HAXE_MINVER:
+ min_version = self.env.HAXE_MINVER
+ find_haxe(self, min_version)
+
+def configure(self):
+ self.env.HAXEFLAGS = []
+ self.check_haxe()
+ self.add_os_flags('HAXEFLAGS', dup = False)
diff --git a/third_party/waf/waflib/extras/wafcache.py b/third_party/waf/waflib/extras/wafcache.py
index 088fd0d098d..cc23fcd6673 100644
--- a/third_party/waf/waflib/extras/wafcache.py
+++ b/third_party/waf/waflib/extras/wafcache.py
@@ -31,6 +31,7 @@ The following environment variables may be set:
gsutil cp gs://mybucket/bb/bbbbb/2 build/somefile
* WAFCACHE_NO_PUSH: if set, disables pushing to the cache
* WAFCACHE_VERBOSITY: if set, displays more detailed cache operations
+* WAFCACHE_STATS: if set, displays cache usage statistics on exit
File cache specific options:
Files are copied using hard links by default; if the cache is located
@@ -69,6 +70,7 @@ EVICT_INTERVAL_MINUTES = int(os.environ.get('WAFCACHE_EVICT_INTERVAL_MINUTES', 3
EVICT_MAX_BYTES = int(os.environ.get('WAFCACHE_EVICT_MAX_BYTES', 10**10))
WAFCACHE_NO_PUSH = 1 if os.environ.get('WAFCACHE_NO_PUSH') else 0
WAFCACHE_VERBOSITY = 1 if os.environ.get('WAFCACHE_VERBOSITY') else 0
+WAFCACHE_STATS = 1 if os.environ.get('WAFCACHE_STATS') else 0
OK = "ok"
re_waf_cmd = re.compile('(?P<src>%{SRC})|(?P<tgt>%{TGT})')
@@ -93,6 +95,9 @@ def can_retrieve_cache(self):
sig = self.signature()
ssig = Utils.to_hex(self.uid() + sig)
+ if WAFCACHE_STATS:
+ self.generator.bld.cache_reqs += 1
+
files_to = [node.abspath() for node in self.outputs]
err = cache_command(ssig, [], files_to)
if err.startswith(OK):
@@ -100,6 +105,8 @@ def can_retrieve_cache(self):
Logs.pprint('CYAN', ' Fetched %r from cache' % files_to)
else:
--
Samba Shared Repository
More information about the samba-cvs
mailing list