[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Tue Nov 20 03:48:03 UTC 2018


The branch, master has been updated
       via  0025e8e96a7 waf: Load the C compiler correctly
       via  aafc15c3c34 librpc/tables.pl: remove unused $opt_output option
       via  65f7f7ffe57 wafsamba: simplify SAMBA_PIDL_TABLES() rule
       via  076afab4cfe wafsamba: remove unused Build.BuildContext.pre_build overload
       via  8e1135f99b3 wafsamba: remove the need of BuildContext.bdir
       via  c0104a4a04a wafsamba: remove hardcoded '..' and '/default/' from SAMBA_PIDL()
       via  1cb782119a3 wafsamba: add a fix for broken python threading if just one job is forced
       via  5bb48cb650c wafsamba: fix CHECK_MAKEFLAGS() with waf 2.0.8
       via  1dc06aaa2d6 s4:heimdal_build: make use of libreplace getprogname() replacement
       via  eea1d4b7782 dsdb group_audit tests: fix use of strncmp
       via  008449d99f7 netcmd: Flush replUpToDateVector when restoring offline backup
       via  5ca2726a402 netcmd: Small backup refactor to avoid compatiblity problems
       via  6e5ebbfb653 netcmd: Add backupType marker to backed-up DB
       via  65e7476a87b tests: Add assertion that replUpToDateVector is present after backup
       via  cc9f1d46e44 WHATSNEW: Added samba-tool 'backup offline' and 'groups stats'
      from  be46a427745 smbtorture: Close unused pipe fds in kernel_oplocks8

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0025e8e96a788bef49dca08a8ebc4929a165069b
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Sep 25 18:13:09 2018 +0200

    waf: Load the C compiler correctly
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Tue Nov 20 04:47:24 CET 2018 on sn-devel-144

commit aafc15c3c34e178aa29e04ddbe2a393319767b38
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 15 20:15:37 2018 +0100

    librpc/tables.pl: remove unused $opt_output option
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 65f7f7ffe577390ed27a232eb4a14fa354c9289e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 15 13:37:58 2018 +0100

    wafsamba: simplify SAMBA_PIDL_TABLES() rule
    
    The builddir is not bin/default/ instead of just bin/,
    so we don't need to strip 'default/' anymore.
    
    And the '--output ${TGT}' part is not really implemented.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 076afab4cfe06e4215649c9368293d855b26c9af
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Nov 13 17:04:39 2018 +0100

    wafsamba: remove unused Build.BuildContext.pre_build overload
    
    This is not needed and also fixed the interaction between
    vim and ':make'
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8e1135f99b34712fe4cce8039d2bb82df131ce40
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 15 11:41:07 2018 +0100

    wafsamba: remove the need of BuildContext.bdir
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c0104a4a04ae5c4fc847209e51b2ccfcb9b11336
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 15 12:51:37 2018 +0100

    wafsamba: remove hardcoded '..' and '/default/' from SAMBA_PIDL()
    
    This makes it possible to remove some move waf 1.8 compat code.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1cb782119a314dd5a4e0344695b87e26c1d322c7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 15 19:35:27 2018 +0100

    wafsamba: add a fix for broken python threading if just one job is forced
    
    This fixes random failures during (at least) configure on AIX.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5bb48cb650cce8331976051123027a359f1feac8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Nov 13 15:58:17 2018 +0100

    wafsamba: fix CHECK_MAKEFLAGS() with waf 2.0.8
    
    Changing Options.options.jobs in the build() hook
    is too late in waf 2.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1dc06aaa2d6ceff494045034235aaf1c99252cf1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 15 19:53:41 2018 +0100

    s4:heimdal_build: make use of libreplace getprogname() replacement
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit eea1d4b7782fd2a7741e0c3144900b8b9272bfec
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Wed Nov 14 14:03:37 2018 +1300

    dsdb group_audit tests: fix use of strncmp
    
    Replace the uses of:
       strncmp(expected, value, strlen(expected))
    With:
        strcmp(expected, value)
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 008449d99f7f0bcc165cdf9dc479eb9dc5e1a856
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Nov 8 17:34:26 2018 +1300

    netcmd: Flush replUpToDateVector when restoring offline backup
    
    The replUpToDateVector could be incorrect after an offline backup was
    restored. This means replication propagation dampening doesn't work
    properly. In the worst case, a singleton DC would have no
    replUpToDateVector at all, and so *all* objects created on that DC get
    replicated every time a new DRS connection is established between 2 DCs.
    This becomes a real problem if you used that singleton DC to create 100K
    objects...
    
    This patch flushes the replUpToDateVector when an offline backup gets
    restored. We need to do this before we add in the new DC and remove the
    old DCs.
    
    Note that this is only a problem for offline backups. The online/rename
    backups are received over DRS, and as part of the replication they
    receive the latest replUpToDateVector from the DC being backed up.
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5ca2726a402f061a73ab7b52064d8b1e4028caca
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Nov 8 17:07:08 2018 +1300

    netcmd: Small backup refactor to avoid compatiblity problems
    
    It will be easy to forget that the backupType marker doesn't exist on
    v4.9. However, this seems like a dumb reason not to support v4.9
    backup-files. Add a wrapper function to avoid potential problems
    cropping up in future.
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 6e5ebbfb65344661ae4bcee02abc9143fb61bb84
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Nov 8 16:41:52 2018 +1300

    netcmd: Add backupType marker to backed-up DB
    
    We are starting to hit restore cases that are only applicable to a
    particular type of backup. We already had a marker to differentiate
    renames, but differentiating offline backups would also be useful.
    
    Note that this raises a slight compatibility issue for backups created
    on v4.9, as the marker won't exist. However, it's only offline backups
    we will use this marker for (at the moment), and this option doesn't
    exist on v4.9, so there's no problem.
    
    Removing the markers has been refactored out into a separate function to
    handle the optional presence of the new marker.
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 65e7476a87b4d5f5c4f98ac08e17621dc7a70a8d
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Nov 8 12:20:30 2018 +1300

    tests: Add assertion that replUpToDateVector is present after backup
    
    We noticed that offline backups were missing a replUpToDateVector for
    the original DC, if the backup was taken on a singleton DC. This patch
    adds an assertion to the existing test-cases to highlight the problem.
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit cc9f1d46e445c739bc08077721d4cde208a39ec4
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Nov 15 13:14:48 2018 +1300

    WHATSNEW: Added samba-tool 'backup offline' and 'groups stats'
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 WHATSNEW.txt                                       |  23 +++
 buildtools/wafsamba/nothreads.py                   | 219 ---------------------
 buildtools/wafsamba/samba_deps.py                  |   4 +-
 buildtools/wafsamba/samba_pidl.py                  |  13 +-
 buildtools/wafsamba/samba_utils.py                 |  47 ++++-
 buildtools/wafsamba/samba_waf18.py                 |   8 -
 buildtools/wafsamba/wafsamba.py                    |   4 -
 buildtools/wafsamba/wscript                        |   3 +-
 librpc/tables.pl                                   |   2 -
 python/samba/netcmd/domain_backup.py               |  94 +++++++--
 python/samba/tests/domain_backup.py                |  31 ++-
 .../samdb/ldb_modules/tests/test_group_audit.c     |  11 +-
 source4/heimdal_build/config.h                     |   5 +
 source4/heimdal_build/replace.c                    |   8 -
 14 files changed, 188 insertions(+), 284 deletions(-)
 delete mode 100644 buildtools/wafsamba/nothreads.py


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 2177988c25f..98ada34e5c6 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -45,9 +45,32 @@ netlogon prefork
 DCERPC now supports pre-forked NETLOGON processes. The netlogon processes are
 pre-forked when the prefork process model is selected for samba.
 
+Offline domain backups
+----------------------
+
+The 'samba-tool domain backup' command has been extended with a new 'offline'
+option. This safely creates a backup of the local DC's database directly from
+disk. The main benefits of an offline backup are it's quicker, it stores more
+database details (for forensic purposes), and the samba process does not have
+to be running when the backup is made. Refer to the samba-tool help for more
+details on using this command.
+
+Group membership statistics
+---------------------------
+
+A new 'samba-tool group stats' command has been added. This provides summary
+information about how the users are spread across groups in your domain.
+The 'samba-tool group list --verbose' command has also been updated to include
+the number of users in each group.
+
 REMOVED FEATURES
 ================
 
+samba_backup
+------------
+
+The samba_backup script has been removed. This has now been replaced by the
+'samba-tool domain backup offline' command.
 
 smb.conf changes
 ================
diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py
deleted file mode 100644
index f873d7d5de1..00000000000
--- a/buildtools/wafsamba/nothreads.py
+++ /dev/null
@@ -1,219 +0,0 @@
-# encoding: utf-8
-# Thomas Nagy, 2005-2008 (ita)
-
-# this replaces the core of Runner.py in waf with a varient that works
-# on systems with completely broken threading (such as Python 2.5.x on
-# AIX). For simplicity we enable this when JOBS=1, which is triggered
-# by the compatibility makefile used for the waf build. That also ensures
-# this code is tested, as it means it is used in the build farm, and by
-# anyone using 'make' to build Samba with waf
-
-"Execute the tasks"
-
-import sys, random, threading
-try: from Queue import Queue
-except ImportError: from queue import Queue
-from waflib import Utils, Options, Errors
-from waflib.TaskGen import EXCEPTION, CRASHED, MAXJOBS, ASK_LATER, SKIPPED, SKIP_ME, SUCCESS
-
-GAP = 15
-
-run_old = threading.Thread.run
-def run(*args, **kwargs):
-    try:
-        run_old(*args, **kwargs)
-    except (KeyboardInterrupt, SystemExit):
-        raise
-    except:
-        sys.excepthook(*sys.exc_info())
-threading.Thread.run = run
-
-
-class TaskConsumer(object):
-    consumers = 1
-
-def process(tsk):
-    m = tsk.master
-    if m.stop:
-        m.out.put(tsk)
-        return
-
-    try:
-        tsk.generator.bld.printout(tsk.display())
-        if tsk.__class__.stat: ret = tsk.__class__.stat(tsk)
-        # actual call to task's run() function
-        else: ret = tsk.call_run()
-    except Exception as e:
-        tsk.err_msg = Utils.ex_stack()
-        tsk.hasrun = EXCEPTION
-
-        # TODO cleanup
-        m.error_handler(tsk)
-        m.out.put(tsk)
-        return
-
-    if ret:
-        tsk.err_code = ret
-        tsk.hasrun = CRASHED
-    else:
-        try:
-            tsk.post_run()
-        except Errors.WafError:
-            pass
-        except Exception:
-            tsk.err_msg = Utils.ex_stack()
-            tsk.hasrun = EXCEPTION
-        else:
-            tsk.hasrun = SUCCESS
-    if tsk.hasrun != SUCCESS:
-        m.error_handler(tsk)
-
-    m.out.put(tsk)
-
-class Parallel(object):
-    """
-    keep the consumer threads busy, and avoid consuming cpu cycles
-    when no more tasks can be added (end of the build, etc)
-    """
-    def __init__(self, bld, j=2):
-
-        # number of consumers
-        self.numjobs = j
-
-        self.manager = bld.task_manager
-        self.manager.current_group = 0
-
-        self.total = self.manager.total()
-
-        # tasks waiting to be processed - IMPORTANT
-        self.outstanding = []
-        self.maxjobs = MAXJOBS
-
-        # tasks that are awaiting for another task to complete
-        self.frozen = []
-
-        # tasks returned by the consumers
-        self.out = Queue(0)
-
-        self.count = 0 # tasks not in the producer area
-
-        self.processed = 1 # progress indicator
-
-        self.stop = False # error condition to stop the build
-        self.error = False # error flag
-
-    def get_next(self):
-        "override this method to schedule the tasks in a particular order"
-        if not self.outstanding:
-            return None
-        return self.outstanding.pop(0)
-
-    def postpone(self, tsk):
-        "override this method to schedule the tasks in a particular order"
-        # TODO consider using a deque instead
-        if random.randint(0, 1):
-            self.frozen.insert(0, tsk)
-        else:
-            self.frozen.append(tsk)
-
-    def refill_task_list(self):
-        "called to set the next group of tasks"
-
-        while self.count > self.numjobs + GAP or self.count >= self.maxjobs:
-            self.get_out()
-
-        while not self.outstanding:
-            if self.count:
-                self.get_out()
-
-            if self.frozen:
-                self.outstanding += self.frozen
-                self.frozen = []
-            elif not self.count:
-                (jobs, tmp) = self.manager.get_next_set()
-                if jobs is not None:
-                    self.maxjobs = jobs
-                if tmp:
-                    self.outstanding += tmp
-                break
-
-    def get_out(self):
-        "the tasks that are put to execute are all collected using get_out"
-        ret = self.out.get()
-        self.manager.add_finished(ret)
-        if not self.stop and getattr(ret, 'more_tasks', None):
-            self.outstanding += ret.more_tasks
-            self.total += len(ret.more_tasks)
-        self.count -= 1
-
-    def error_handler(self, tsk):
-        "by default, errors make the build stop (not thread safe so be careful)"
-        if not Options.options.keep:
-            self.stop = True
-        self.error = True
-
-    def start(self):
-        "execute the tasks"
-
-        while not self.stop:
-
-            self.refill_task_list()
-
-            # consider the next task
-            tsk = self.get_next()
-            if not tsk:
-                if self.count:
-                    # tasks may add new ones after they are run
-                    continue
-                else:
-                    # no tasks to run, no tasks running, time to exit
-                    break
-
-            if tsk.hasrun:
-                # if the task is marked as "run", just skip it
-                self.processed += 1
-                self.manager.add_finished(tsk)
-                continue
-
-            try:
-                st = tsk.runnable_status()
-            except Exception as e:
-                self.processed += 1
-                if self.stop and not Options.options.keep:
-                    tsk.hasrun = SKIPPED
-                    self.manager.add_finished(tsk)
-                    continue
-                self.error_handler(tsk)
-                self.manager.add_finished(tsk)
-                tsk.hasrun = EXCEPTION
-                tsk.err_msg = Utils.ex_stack()
-                continue
-
-            if st == ASK_LATER:
-                self.postpone(tsk)
-            elif st == SKIP_ME:
-                self.processed += 1
-                tsk.hasrun = SKIPPED
-                self.manager.add_finished(tsk)
-            else:
-                # run me: put the task in ready queue
-                tsk.position = (self.processed, self.total)
-                self.count += 1
-                self.processed += 1
-                tsk.master = self
-
-                process(tsk)
-
-        # self.count represents the tasks that have been made available to the consumer threads
-        # collect all the tasks after an error else the message may be incomplete
-        while self.error and self.count:
-            self.get_out()
-
-        #print loop
-        assert (self.count == 0 or self.stop)
-
-
-# enable nothreads
-import Runner
-Runner.process = process
-Runner.Parallel = Parallel
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 542e682619c..d6b7c0f88d6 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -1011,14 +1011,14 @@ def save_samba_deps(bld, tgt_list):
         if tdeps != {}:
             denv.outenv[t.sname] = tdeps
 
-    depsfile = os.path.join(bld.bdir, "sambadeps")
+    depsfile = os.path.join(bld.cache_dir, "sambadeps")
     denv.store_fast(depsfile)
 
 
 
 def load_samba_deps(bld, tgt_list):
     '''load a previous set of build dependencies if possible'''
-    depsfile = os.path.join(bld.bldnode.abspath(), "sambadeps")
+    depsfile = os.path.join(bld.cache_dir, "sambadeps")
     denv = ConfigSet.ConfigSet()
     try:
         debug('deps: checking saved dependencies')
diff --git a/buildtools/wafsamba/samba_pidl.py b/buildtools/wafsamba/samba_pidl.py
index 2ff2c0dc64d..1e55892127e 100644
--- a/buildtools/wafsamba/samba_pidl.py
+++ b/buildtools/wafsamba/samba_pidl.py
@@ -76,7 +76,7 @@ def SAMBA_PIDL(bld, pname, source,
         else:
             cc = 'CC="%s"' % bld.CONFIG_GET("CC")
 
-    t = bld(rule='cd .. && %s %s ${PERL} "${PIDL}" --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- "${SRC[0].abspath(env)}"' % (cpp, cc),
+    t = bld(rule='cd ${PIDL_LAUNCH_DIR} && %s %s ${PERL} ${PIDL} --quiet ${OPTIONS} --outputdir ${OUTPUTDIR} -- "${IDLSRC}"' % (cpp, cc),
             ext_out    = '.c',
             before     = 'c',
             update_outputs = True,
@@ -89,9 +89,13 @@ def SAMBA_PIDL(bld, pname, source,
     # prime the list of nodes we are dependent on with the cached pidl sources
     t.allnodes = pidl_src_nodes
 
-    t.env.PIDL = os.path.join(bld.srcnode.abspath(), 'pidl/pidl')
+    t.env.PIDL_LAUNCH_DIR = bld.srcnode.path_from(bld.bldnode)
+    pnode = bld.srcnode.find_resource('pidl/pidl')
+    t.env.PIDL = pnode.path_from(bld.srcnode)
     t.env.OPTIONS = TO_LIST(options)
-    t.env.OUTPUTDIR = bld.bldnode.parent.name + '/default/' + bld.path.find_dir(output_dir).path_from(bld.srcnode)
+    snode = t.path.find_resource(source[0])
+    t.env.IDLSRC = snode.path_from(bld.srcnode)
+    t.env.OUTPUTDIR = bld.bldnode.path_from(bld.srcnode) + '/' + bld.path.find_dir(output_dir).path_from(bld.srcnode)
 
     if generate_tables and table_header_idx is not None:
         pidl_headers = LOCAL_CACHE(bld, 'PIDL_HEADERS')
@@ -117,6 +121,7 @@ Build.BuildContext.SAMBA_PIDL_LIST = SAMBA_PIDL_LIST
 @before('exec_rule')
 def collect(self):
     pidl_headers = LOCAL_CACHE(self.bld, 'PIDL_HEADERS')
+    # The first source is tables.pl itself
     self.source = Utils.to_list(self.source)
     for (name, hd) in pidl_headers.items():
         y = self.bld.get_tgen_by_name(name)
@@ -132,7 +137,7 @@ def SAMBA_PIDL_TABLES(bld, name, target):
     bld.SET_BUILD_GROUP('main')
     t = bld(
             features = 'collect',
-            rule     = '${PERL} ${SRC} --output ${TGT} | sed "s|default/||" > ${TGT}',
+            rule     = '${PERL} ${SRC} > ${TGT}',
             ext_out  = '.c',
             before   = 'c',
             update_outputs = True,
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 58a0b71796c..8e312773462 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -440,14 +440,14 @@ Options.OptionsContext.RECURSE = RECURSE
 Build.BuildContext.RECURSE = RECURSE
 
 
-def CHECK_MAKEFLAGS(bld):
+def CHECK_MAKEFLAGS(options):
     '''check for MAKEFLAGS environment variable in case we are being
     called from a Makefile try to honor a few make command line flags'''
     if not 'WAF_MAKE' in os.environ:
         return
     makeflags = os.environ.get('MAKEFLAGS')
     if makeflags is None:
-        return
+        makeflags = ""
     jobs_set = False
     jobs = None
     # we need to use shlex.split to cope with the escaping of spaces
@@ -455,7 +455,7 @@ def CHECK_MAKEFLAGS(bld):
     for opt in shlex.split(makeflags):
         # options can come either as -x or as x
         if opt[0:2] == 'V=':
-            Options.options.verbose = Logs.verbose = int(opt[2:])
+            options.verbose = Logs.verbose = int(opt[2:])
             if Logs.verbose > 0:
                 Logs.zones = ['runner']
             if Logs.verbose > 2:
@@ -469,26 +469,53 @@ def CHECK_MAKEFLAGS(bld):
             # this is also how "make test TESTS=testpattern" works, and
             # "make VERBOSE=1" as well as things like "make SYMBOLCHECK=1"
             loc = opt.find('=')
-            setattr(Options.options, opt[0:loc], opt[loc+1:])
+            setattr(options, opt[0:loc], opt[loc+1:])
         elif opt[0] != '-':
             for v in opt:
                 if re.search(r'j[0-9]*$', v):
                     jobs_set = True
                     jobs = opt.strip('j')
                 elif v == 'k':
-                    Options.options.keep = True
+                    options.keep = True
         elif re.search(r'-j[0-9]*$', opt):
             jobs_set = True
             jobs = opt.strip('-j')
         elif opt == '-k':
-            Options.options.keep = True
+            options.keep = True
     if not jobs_set:
         # default to one job
-        Options.options.jobs = 1
+        options.jobs = 1
     elif jobs_set and jobs:
-        Options.options.jobs = int(jobs)
-
-Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
+        options.jobs = int(jobs)
+
+waflib_options_parse_cmd_args = Options.OptionsContext.parse_cmd_args
+def wafsamba_options_parse_cmd_args(self, _args=None, cwd=None, allow_unknown=False):
+    (options, commands, envvars) = \
+        waflib_options_parse_cmd_args(self,
+                                      _args=_args,
+                                      cwd=cwd,
+                                      allow_unknown=allow_unknown)
+    CHECK_MAKEFLAGS(options)
+    if options.jobs == 1:
+        #
+        # waflib.Runner.Parallel processes jobs inline if the possible number
+        # of jobs is just 1. But (at least in waf <= 2.0.12) it still calls
+        # create a waflib.Runner.Spawner() which creates a single
+        # waflib.Runner.Consumer() thread that tries to process jobs from the
+        # queue.
+        #
+        # This has strange effects, which are not noticed typically,
+        # but at least on AIX python has broken threading and fails
+        # in random ways.
+        #
+        # So we just add a dummy Spawner class.
+        class NoOpSpawner(object):
+            def __init__(self, master):
+                return
+        from waflib import Runner
+        Runner.Spawner = NoOpSpawner
+    return options, commands, envvars
+Options.OptionsContext.parse_cmd_args = wafsamba_options_parse_cmd_args
 
 option_groups = {}
 
diff --git a/buildtools/wafsamba/samba_waf18.py b/buildtools/wafsamba/samba_waf18.py
index 26441309d4f..cc310fbf512 100644
--- a/buildtools/wafsamba/samba_waf18.py
+++ b/buildtools/wafsamba/samba_waf18.py
@@ -41,14 +41,6 @@ for y in (Build.BuildContext, Build.CleanContext, Build.InstallContext, Build.Un
     class tmp(y):
         variant = 'default'
 
-def pre_build(self):
-    self.cwdx = self.bldnode.parent
-    self.cwd = self.cwdx.abspath()
-    self.bdir = self.bldnode.abspath()
-    return Build.BuildContext.old_pre_build(self)
-Build.BuildContext.old_pre_build = Build.BuildContext.pre_build
-Build.BuildContext.pre_build = pre_build
-
 def abspath(self, env=None):
     if env and hasattr(self, 'children'):
         return self.get_bld().abspath()
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 59a4eacb305..906ae9e75b6 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -33,10 +33,6 @@ import pkgconfig
 import configure_file
 import samba_waf18
 
-# some systems have broken threading in python
-if os.environ.get('WAF_NOTHREADS') == '1':
-    import nothreads
-
 LIB_PATH="shared"
 
 os.environ['PYTHONUNBUFFERED'] = '1'
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 5c4b037286b..164a9ff6dda 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -231,7 +231,7 @@ def configure(conf):
 
     conf.CHECK_CC_ENV()
 
-    conf.load('compiler_cc')
+    conf.load('compiler_c')
 
     conf.CHECK_STANDARD_LIBPATH()
 
@@ -598,7 +598,6 @@ def build(bld):
         Logs.error('bld.path %s is not a child of %s' % (curdir, srcdir))
         raise Errors.WafError('''The top source directory has moved. Please run distclean and reconfigure''')
 
-    bld.CHECK_MAKEFLAGS()
     bld.SETUP_BUILD_GROUPS()
     bld.ENFORCE_GROUP_ORDERING()
     bld.CHECK_PROJECT_RULES()
diff --git a/librpc/tables.pl b/librpc/tables.pl
index 04764f5fa0b..b7ac6e00450 100755
--- a/librpc/tables.pl
+++ b/librpc/tables.pl
@@ -11,7 +11,6 @@ use strict;
 use Getopt::Long;
 use File::Basename;
 
-my $opt_output = 'librpc/gen_ndr/tables.c';
 my $opt_help  = 0;
 
 
@@ -32,7 +31,6 @@ sub ShowHelp()
 # main program
 GetOptions (
 	    'help|h|?' => \$opt_help, 
-	    'output=s' => \$opt_output,
 	    );
 
 if ($opt_help) {
diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py
index 5e7435645c3..c7602a8be26 100644
--- a/python/samba/netcmd/domain_backup.py
+++ b/python/samba/netcmd/domain_backup.py
@@ -33,7 +33,7 @@ from samba.auth import system_session


-- 
Samba Shared Repository



More information about the samba-cvs mailing list