The branch, master has been updated via bf4189e... build: we need this isinstance() check for distcheck via baec7a6... build: the exceptions here are not useful via 4ca46c6... build: make the handling of relative paths a bit saner from eb9b7d0... s3:winbindd: make "smbcontrol winbindd validate-cache" reliable again
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit bf4189eb80246b3fc1fe0cf90cd790ac0b1e0e56 Author: Andrew Tridgell <tri...@samba.org> Date: Thu Apr 8 22:10:22 2010 +1000 build: we need this isinstance() check for distcheck Jelmer, this works around a bug in waf distcheck that will be fixed soon. We really need the isinstance() check for now. commit baec7a6b9eb6cdb2d3a21e3a6c7b99e79703d39f Author: Andrew Tridgell <tri...@samba.org> Date: Thu Apr 8 22:01:27 2010 +1000 build: the exceptions here are not useful they just make the failure hard to spot commit 4ca46c6b8dfd9d7450096fc16c6edd7a08f369e5 Author: Andrew Tridgell <tri...@samba.org> Date: Thu Apr 8 21:46:20 2010 +1000 build: make the handling of relative paths a bit saner This should fix a problem that Anatoliy has struck with the PIDL rules. It also brings us much closer to a working build for a true out of tree build (ie. with waf configure -b /tmp/build) ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/samba_autoproto.py | 8 +++++--- buildtools/wafsamba/samba_deps.py | 8 ++++---- buildtools/wafsamba/samba_dist.py | 2 +- buildtools/wafsamba/samba_install.py | 10 +++------- buildtools/wafsamba/samba_pidl.py | 10 +++++----- buildtools/wafsamba/samba_utils.py | 2 +- buildtools/wafsamba/wafsamba.py | 2 +- 7 files changed, 20 insertions(+), 22 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba_autoproto.py b/buildtools/wafsamba/samba_autoproto.py index 5a6460c..2a903d9 100644 --- a/buildtools/wafsamba/samba_autoproto.py +++ b/buildtools/wafsamba/samba_autoproto.py @@ -9,12 +9,13 @@ def HEIMDAL_AUTOPROTO(bld, header, source, options=None, group='prototypes'): if options is None: options='-q -P comment -o' SET_TARGET_TYPE(bld, header, 'PROTOTYPE') - t = bld(rule='${PERL} ../heimdal/cf/make-proto.pl ${OPTIONS} ${TGT[0].abspath(env)} ${SRC}', + t = bld(rule='${PERL} ${HEIMDAL}/cf/make-proto.pl ${OPTIONS} ${TGT[0].abspath(env)} ${SRC}', source=source, target=header, on_results=True, ext_out='.c', before='cc') + t.env.HEIMDAL = os.path.join(bld.srcnode.abspath(), 'source4/heimdal') t.env.OPTIONS = options Build.BuildContext.HEIMDAL_AUTOPROTO = HEIMDAL_AUTOPROTO @@ -29,13 +30,14 @@ def SAMBA_AUTOPROTO(bld, header, source): '''rule for samba prototype generation''' bld.SET_BUILD_GROUP('prototypes') SET_TARGET_TYPE(bld, header, 'PROTOTYPE') - bld( + t = bld( source = source, target = header, on_results=True, ext_out='.c', before ='cc', - rule = '../script/mkproto.pl --srcdir=.. --builddir=. --public=/dev/null --private=${TGT} ${SRC}' + rule = '${SCRIPT}/mkproto.pl --srcdir=.. --builddir=. --public=/dev/null --private=${TGT} ${SRC}' ) + t.env.SCRIPT = os.path.join(bld.srcnode.abspath(), 'source4/script') Build.BuildContext.SAMBA_AUTOPROTO = SAMBA_AUTOPROTO diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index be77d2c..452120d 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -18,7 +18,7 @@ def TARGET_ALIAS(bld, target, alias): cache = LOCAL_CACHE(bld, 'TARGET_ALIAS') if alias in cache: print("Target alias %s already set to %s : newalias %s" % (alias, cache[alias], target)) - raise + sys.exit(1) cache[alias] = target Build.BuildContext.TARGET_ALIAS = TARGET_ALIAS @@ -240,7 +240,7 @@ def check_duplicate_sources(bld, tgt_list): for t in tgt_list: obj_sources = getattr(t, 'source', '') - tpath = os_path_relpath(t.path.abspath(bld.env), t.env['BUILD_DIRECTORY'] + '/default') + tpath = os_path_relpath(t.path.abspath(bld.env), t.env.BUILD_DIRECTORY + '/default') obj_sources = bld.SUBDIR(tpath, obj_sources) t.samba_source_set = set(TO_LIST(obj_sources)) @@ -329,7 +329,7 @@ def build_direct_deps(bld, tgt_list): if d == t.sname: continue if not d in targets: print("Unknown dependency %s in %s" % (d, t.sname)) - raise + sys.exit(1) if targets[d] in [ 'EMPTY', 'DISABLED' ]: continue if targets[d] == 'SYSLIB': @@ -823,7 +823,7 @@ def check_project_rules(bld): t = bld.name_to_obj(tgt, bld.env) if t is None: print("Target %s of type %s has no task generator" % (tgt, type)) - raise + sys.exit(1) tgt_list.append(t) add_samba_attributes(bld, tgt_list) diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py index 68fdf08..b4a6cbb 100644 --- a/buildtools/wafsamba/samba_dist.py +++ b/buildtools/wafsamba/samba_dist.py @@ -19,7 +19,7 @@ def add_tarfile(tar, fname, abspath): def dist(appname='',version=''): - if not appname: + if not isinstance(appname, str) or not appname: # this copes with a mismatch in the calling arguments for dist() appname = Utils.g_module.APPNAME version = Utils.g_module.VERSION diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py index 30b607b..fee456a 100644 --- a/buildtools/wafsamba/samba_install.py +++ b/buildtools/wafsamba/samba_install.py @@ -117,7 +117,7 @@ def symlink_lib(self): if self.target.endswith('.inst'): return - blddir = Utils.g_module.blddir + blddir = os.path.dirname(self.bld.srcnode.abspath(self.bld.env)) libpath = self.link_task.outputs[0].abspath(self.env) # calculat the link target and put it in the environment @@ -132,8 +132,6 @@ def symlink_lib(self): link_target = os.path.join(blddir, link_target) - libpath = os_path_relpath(libpath, os.path.dirname(link_target)) - if os.path.lexists(link_target): os.unlink(link_target) os.symlink(libpath, link_target) @@ -147,11 +145,9 @@ def symlink_bin(self): if self.target.endswith('.inst'): return - blddir = Utils.g_module.blddir + blddir = os.path.dirname(self.bld.srcnode.abspath(self.bld.env)) binpath = self.link_task.outputs[0].abspath(self.env) - bldpath = os.path.join(blddir, os.path.basename(self.target)) - - binpath = os_path_relpath(binpath, os.path.dirname(bldpath)) + bldpath = os.path.join(self.bld.env.BUILD_DIRECTORY, self.target) if os.path.lexists(bldpath): os.unlink(bldpath) diff --git a/buildtools/wafsamba/samba_pidl.py b/buildtools/wafsamba/samba_pidl.py index ff2b527..0b149cc 100644 --- a/buildtools/wafsamba/samba_pidl.py +++ b/buildtools/wafsamba/samba_pidl.py @@ -69,7 +69,7 @@ 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 = "../pidl/pidl" + t.env.PIDL = os.path.join(bld.srcnode.abspath(), 'pidl/pidl') t.env.OPTIONS = TO_LIST(options) # this rather convoluted set of path calculations is to cope with the possibility @@ -77,15 +77,14 @@ def SAMBA_PIDL(bld, pname, source, # gen_ndr directory we end up generating identical output in gen_ndr for the old # build system and the new one. That makes keeping things in sync much easier. # eventually we should drop the gen_ndr files in git, but in the meanwhile this works - outdir = bld.bldnode.name + '/' + bld.path.find_dir(output_dir).bldpath(t.env) + outdir = bld.path.find_dir(output_dir).abspath(t.env) - if not os.path.lexists(outdir): + if symlink and not os.path.lexists(outdir): link_source = os.path.normpath(os.path.join(bld.curdir,output_dir)) - link_source = os_path_relpath(link_source, os.path.dirname(outdir)) os.symlink(link_source, outdir) real_outputdir = os.path.realpath(outdir) - t.env.OUTPUTDIR = os_path_relpath(real_outputdir, bld.bldnode.name + '/..') + t.env.OUTPUTDIR = os_path_relpath(real_outputdir, os.path.dirname(bld.env.BUILD_DIRECTORY)) if table_header_idx is not None: pidl_headers = LOCAL_CACHE(bld, 'PIDL_HEADERS') @@ -134,5 +133,6 @@ def SAMBA_PIDL_TABLES(bld, name, target): source = '../../librpc/tables.pl', target = target, name = name) + t.env.LIBRPC = os.path.join(bld.srcnode.abspath(), 'librpc') Build.BuildContext.SAMBA_PIDL_TABLES = SAMBA_PIDL_TABLES diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index a527e81..1df70fd 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -72,7 +72,7 @@ def install_rpath(bld): def build_rpath(bld): '''the rpath value for build''' - rpath = os.path.normpath('%s/%s' % (bld.env['BUILD_DIRECTORY'], LIB_PATH)) + rpath = os.path.normpath('%s/%s' % (bld.env.BUILD_DIRECTORY, LIB_PATH)) bld.env['RPATH'] = [] bld.env['RPATH_ST'] = [] if bld.env.RPATH_ON_BUILD: diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 75639d4..08d3d20 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -38,7 +38,7 @@ os.putenv('PYTHONUNBUFFERED', '1') @conf def SAMBA_BUILD_ENV(conf): '''create the samba build environment''' - conf.env['BUILD_DIRECTORY'] = conf.blddir + conf.env.BUILD_DIRECTORY = conf.blddir mkdir_p(os.path.join(conf.blddir, LIB_PATH)) mkdir_p(os.path.join(conf.blddir, 'python/samba/dcerpc')) # this allows all of the bin/shared and bin/python targets -- Samba Shared Repository