ntpd/varsion.h

Fred Wright fw at fwright.net
Sun Dec 24 20:02:52 UTC 2017


On Sat, 23 Dec 2017, Hal Murray via devel wrote:

> Should it be included in a tarball?
> How about wafhelpers/.autorevision-cache?
>
> Should it be moved to $build/main/ntpd/, similar to the way that derived
> python files were moved to $build/main/pylib/?

I think it should, and I made a brief attempt at doing so when I was
moving the Python stuff, but when the "quickie" didn't work I put it aside
for later.

I don't think version.h itself belongs in a source tarball, but *some*
kind of git-independent version information needs to be, so that one can
build outside a git repo.  The current kludgery that one has to go through
with autorevision is tedious.

What GPSD currently does is:

1) If it's a release version, then the version string is used as is, on
the theory that it should uniquely identify the code state in the release
case.

2) If it's a development version (denoted by "~dev" in the version
string), then it attempts to decorate the version string with info from
"git describe".

3) If "git describe" fails, it falls back to using a timestamp as
decoration.  Originally this was just the build time, but that caused a
lot of gratuitous rebuilding, so I changed it to use the latest mtime of
all the relevant sources.  That can still have *some* gratuitous updates,
due to the way git abuses mtimes, but it's a lot better.

The GPSD approach isn't necessarily ideal, but it's a lot less
inconvenient than what ntpsec currently does.

Fred Wright


More information about the devel mailing list