Waf rebuilding issue with python3

Alexander Bokovoy ab at samba.org
Wed Dec 12 16:55:44 UTC 2018

On ke, 12 joulu 2018, Volker Lendecke via samba-technical wrote:
> On Wed, Dec 12, 2018 at 12:15:26PM +0200, Alexander Bokovoy via samba-technical wrote:
> > > and that re-builds the world. So on my CPU it takes ages to get the
> > > testenv up and running. And if I Control-C the "make testenv" it
> > > always starts from scratch. So I have to really sit through the whole
> > > build every time I want a testenv.
> > I will be able to look at this on Thursday. 
> Is there anything you can recommend in the meantime short of working
> on 4.9? I have some tricky code to push through autobuild (replacing
> our DNS client), and having to wait 15 minutes for every "make
> testenv" really slows me down. I hesitate to port my code to 4.9, but
> if you say that this will persist I will do that and abandon master
> for the time being.
I tried building with your recipe (without spotlight support but that
shouldn't matter) and what I found is that there is no change with
subsequent make runs if I change a file like source3/smbd/smbd.h:

$ diff -urN -q ~/tmp/samba-c4che{,-new}
Files /home/abokovoy/tmp/samba-c4che/build.config.py and /home/abokovoy/tmp/samba-c4che-new/build.config.py differ
Files /home/abokovoy/tmp/samba-c4che/_cache.py and /home/abokovoy/tmp/samba-c4che-new/_cache.py differ
Files /home/abokovoy/tmp/samba-c4che/default_cache.py and /home/abokovoy/tmp/samba-c4che-new/default_cache.py differ
Files /home/abokovoy/tmp/samba-c4che/sambadeps and /home/abokovoy/tmp/samba-c4che-new/sambadeps differ
$ diff -urN -q ~/tmp/samba-c4che{-new,-2nd}

$ sha224sum ~/tmp/samba-c4che{,-new,-2nd}/sambadeps
sha224sum: /home/abokovoy/tmp/samba-c4che/sambadeps: No such file or directory
2a6ad1603762d95b7d8696a8865166dab55efe5c6d978546d4bf5760  /home/abokovoy/tmp/samba-c4che-new/sambadeps
2a6ad1603762d95b7d8696a8865166dab55efe5c6d978546d4bf5760  /home/abokovoy/tmp/samba-c4che-2nd/sambadeps

~/tmp/samba-c4che is bin/c4che content for ./configure.developer
~/tmp/samba-c4che-new is after first make run
~/tmp/samba-c4che-2nd is after I added a space to source3/smbd/smbd.h
and re-run make

The second make run did re-run only parts including smbd.h and depending
on those.

However, I tried few more cases like 'waf --show-deps smbd/smbd.objlist'
and that one caused a full recompile. This time sambadeps differed:

$ sha224sum ~/tmp/samba-c4che{-2nd,-3rd}/sambadeps
2a6ad1603762d95b7d8696a8865166dab55efe5c6d978546d4bf5760  /home/abokovoy/tmp/samba-c4che-2nd/sambadeps
287b0cf850f015d828a8bf4b6e74f11e89973365d4b40ac7f40707b2  /home/abokovoy/tmp/samba-c4che-3rd/sambadeps

save_samba_deps() is called from check_project_rules() if the target is
not 'install', so we refresh them all the time. This was before as well,
so perhaps a structure within the sambadeps is being inconsistent.

The only change we had recently for save_samba_deps() is by Metze but it
shouldn't really affect generation of the deps structure.

I'm not sure why this happens, will be looking in more details tomorrow

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>

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")

 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()
         debug('deps: checking saved dependencies')

/ Alexander Bokovoy

More information about the samba-technical mailing list