Python ntpq lands - what to do next?

Eric S. Raymond esr at thyrsus.com
Sun Nov 6 03:23:39 UTC 2016


Hal Murray <hmurray at megapathdsl.net>:
> > So the first question is, does your unpacked tarball have a pylib/
> > version.py? And is it newer or older than VERSION? 
> 
> -rw-rw-r-- 1 murray murray   6 Oct 13 01:45 VERSION
> -rw-rw-r-- 1 murray murray 408 Nov  5 17:37 pylib/version.py
> 
> [100/132] Compiling VERSION
> 18:11:27 runner ' VERSION=`cat ../VERSION` ../wafhelpers/autorevision.sh -t 
> python >version.py '
> error: No repo or cache detected.
> 
> That's from my attempt at mimicking a tarball process.

Bletch. OK, I thought autorevision was smarter than it is.  (I contributed
to it, but I'm not the maintainer.)  I'll go look at our copy...

OK, I've just modified the autorevision command in pylib to make and use
a cache file.  The cache file location is declared as a target, which
should mean it gets picked up by waf dist.

> This is turning into an interesting can of worms.
> 
> waf clean doesn't get pylib/ntp_control.py or pylib/ntp_magic.py or 
> pylib/version.py
> is that a bug or feature?

A minor bug.  What's special about those files is that they're generated into
the pylib *source* directory by the normal build; waf doesn't try to clean that
directory.

The underlying problem here is the same thing that's messing up your in-tree
testing - the kludge I was using isn't good enough.  At the moment the magic ntp
symlinks that are supposed to let you run the Python stuff without installing
to rootspace point to pylib/; a symlink there forwards references to ntpc.so
(the Python extension) to the build directory.

What I need to do is make those ntp/ links forward to the ${build}/pylib/
directory in such a way that it works even with --out. I guess that's
my top task now.

> The parallel non-python version stuff just uses the time if it can't get info 
> from git.
> You may want to "fix" that to do something similar.
> It's only used by ntpd.  (There used to be one for ntpq too.)
> 
> There are actually two times of interest.  One is the latest time a source 
> file was modified.  The other is the time the package was built.  Python may 
> not have the concept of build, but it might come back if you are translating 
> from python to c.
> 
> If you edit a file, waf doesn't automagically update version.c
> So my rebuild script deletes 
>   */main/ntpd/version.c
> so waf rebuilds it to get the updated build-time.
> 
> That version stuff is currently half broken.
>   ntpd --version --version
>   ntpd 0.9.5-5feab12-glypnod Nov  5 2016 17:37:08
>   ntpd CFLAGS=Need-CFLAGS LDFLAGS=Need-LDFLAGS

OK, this is exactly what autorevision is for.  If I tell it to output in C
format it will make a version.h that ntpd can use.  I'll make that my
next task once I've got your bugs fixed.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list