waf build doesn't make some of the python stuff

Eric S. Raymond esr at thyrsus.com
Fri Dec 30 15:40:16 UTC 2016


Hal Murray <hmurray at megapathdsl.net>:
> 
> > I can't reproduce this.  I saw it a few times when you first reported it,
> > pushed a fix, and haven't seen it since. 
> 
> Here is my recipe.
> 
> git clone <your-local-copy> foo
> cd foo
> ./waf configure build
> cd ntpclients
> ./ntpq
> 
> I get:
> [murray at hgm ntpclients]$ ./ntpq
> ntpq: can't find Python NTP library -- check PYTHONPATH.
> No module named control
> [murray at hgm ntpclients]$ 
> 
> ./waf check says:
> [104/109] Processing /home/murray/ntpsec/foo/pylib/control.py: 
> wafhelpers/pythonize-header include/ntp_control.h -> pylib/control.py
> [105/109] Processing /home/murray/ntpsec/foo/pylib/magic.py: 
> wafhelpers/pythonize-header include/ntp.h -> pylib/magic.py
> [106/109] Processing /home/murray/ntpsec/foo/pylib/version.py,/home/murray/ntp
> sec/foo/wafhelpers/.autorevision-cache: VERSION wafhelpers/autorevision.sh -> 
> pylib/version.py wafhelpers/.autorevision-cache

That was useful. I have just learned the following crucial thing:

It's not necessary to do ./waf check to get the missing stuff made.  A second
./waf build will do it.

Knowing this reduces my confusion a lot.  It explains why I couldn't
reproduce - I have a reflex that I do ./waf build on import failuree,
trained into me by having to do it every time I mod the Python sources
(I have to do this to get the new .pyc into the build directory where
the magic link will see it).

Also I was going nuts trying to figure out what could be special about
waf check. There just isn't any there there!  So, the answer: waf check
isn't special, it's the side effect of forcing a second build that was
filling the hole.

I now have two conjectures to investigate:

1. This problem is due to some kind of undeclared order constraint in the recipe.
Or possibly a waf bug, though I think an undeclared order constraint is much more
likely.

2. I think it has something to do with waf distclean not cleaning completely.
If the things it doesn't remove are left in place, the bug does not manifest.

I also know an acceptable workaround for the point release.  I'm going to
add a note to INSTALL that if you hit Python import problems ./waf build
will fix them, and promise that will be fixed in a future release.  Then,
if I can't fix this in a couple of hours, I'll give Mark the all-clear
to ship anyway.

Still working on your other build problem, too.

The problem underlying both is that our waf recipe has grown over-complex
and needs to be simplified.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list