Package: autogen
Version: 1:5.18.12-3
Severity: normal
Tags: upstream

Dear Maintainer,

AutoGen appears to truncate the mtimes of its output files, so the
generated .c and .h files appear to be older than they actually are.

This can be a serious problem in timestamp-based build systems, in
particular if the input file to AutoGen is itself generated by the build
system.

I'll give a trivial example that demonstrates the effect I have run
into:

    $ cat args.def
    autogen definitions options;
    prog-name     = test;
    prog-title    = "Test Program";
    
    flag = {
      name = debug;
      value = d;
    };
    $ rm -f args.c args.h
    $ touch args.def && sleep 0.2 && autogen args.def
    $ stat -c "%y %n" args.* | sort -n
    2016-12-09 19:21:52.000000000 -0800 args.c
    2016-12-09 19:21:52.000000000 -0800 args.h
    2016-12-09 19:21:52.530084232 -0800 args.def

As you can see, the AutoGen input file args.def has an actual timestamp,
while args.[ch] have timestamps that are truncated and artificially
older than that of args.def. The --source-time option doesn't matter
here, unless of course the "sleep 0.2" is turned into "sleep 2". The
sleep here is just to emulate other build steps or wait states, and to
emphasize that the args.def file is in fact up to date when it is read
by AutoGen.

If this sequence of commands were part of a make-based build system, and
args.def were in turn generated from args.def.in, make would be left
with files that it thinks are out of date.

I don't know why AutoGen is intentionally truncating the mtime of its
outputs. The only reference to manipulating mtime that I've seen is the
--source-time option, which does (close to) what it describes, but also
truncates the mtime so that it is again always older than the mtime of
the source file.

So it basically seems like AutoGen always munges the output file time
stamps, and knows nothing about subsecond resolution.

I do believe this can lead to, and has led to actual build system bugs,
especially as we embrace more parallelism, see for example #816148 and
#844882.

Thanks!

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages autogen depends on:
ii  guile-2.0-libs  2.0.13+1-2
ii  libc6           2.24-7
ii  libopts25       1:5.18.12-3
ii  libopts25-dev   1:5.18.12-3
ii  libxml2         2.9.4+dfsg1-2.1
pn  perl:any        <none>

Versions of packages autogen recommends:
pn  autogen-doc  <none>

autogen suggests no packages.

-- no debconf information

Reply via email to