[sr #109406] autoheader creates config.h.in file with wrong timestamp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[sr #109406] autoheader creates config.h.in file with wrong timestamp

Markus Elfring-2
URL:
  <http://savannah.gnu.org/support/?109406>

                 Summary: autoheader creates config.h.in file with wrong
timestamp
                 Project: Autoconf
            Submitted by: haible
            Submitted on: Sun 29 Oct 2017 04:45:21 PM CET
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

autoheader creates the config.h.in file with a timestamp that is not the
current time, but the latest full second before the current time. This causes
trouble later with the Automake-generated rule that tests whether config.h.in
needs to be rebuilt.

How to reproduce:

- Use gnulib as of 2017-09-28.

- $ ./gnulib-tool --create-testdir --dir=testdir1 --single-configure
get-rusage-as get-rusage-data
  (or any other small set of modules)
This command prints what it does:
executing aclocal -I glm4
executing autoconf
executing autoheader
executing automake --add-missing --copy
As you can see, it generates aclocal.m4, configure, config.h.in, Makefile.in
in this order.

- $ cd testdir1

- $ ls -lrt --full-time
total 408
-rw-rw-r-- 1 bruno bruno    150 2017-10-29 16:03:57.054242537 +0100
Makefile.am
-rw-rw-r-- 1 bruno bruno   6695 2017-10-29 16:03:57.574244759 +0100
configure.ac
-rw-rw-r-- 1 bruno bruno  23189 2017-10-29 16:03:58.000000000 +0100
config.h.in
-rw-rw-r-- 1 bruno bruno  42980 2017-10-29 16:03:58.182247356 +0100
aclocal.m4
-rwxrwxr-x 1 bruno bruno 279904 2017-10-29 16:03:58.734249714 +0100 configure
-rw-rw-r-- 1 bruno bruno  36669 2017-10-29 16:03:59.674253730 +0100
Makefile.in
drwxrwxr-x 2 bruno bruno   4096 2017-10-29 16:03:59.754254071 +0100 gllib
drwxrwxr-x 2 bruno bruno   4096 2017-10-29 16:03:59.798254260 +0100 glm4
drwxrwxr-x 2 bruno bruno   4096 2017-10-29 16:03:59.862254533 +0100 build-aux
drwxrwxr-x 2 bruno bruno   4096 2017-10-29 16:03:59.898254687 +0100 gltests

As you can see, config.h.in is now OLDER than aclocal.m4 and configure.

- $ ./configure

- $ make

Here the Automake generate rule kicks in:

$(srcdir)/config.h.in:  $(am__configure_deps)
        ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
        rm -f stamp-h1
        touch $@

This rule compares the timestamps of config.h.in and aclocal.m4 (in
particular), finds that config.h.in is too old, thus regenerates it:

$ make
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash
/media/develdata/devel/GNULIB/gnulib-git/testdir1/build-aux/missing
autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
...

The effect is:
* Useless commands get executed.
* Noise gets added to the "make" output.
* The junk directory autom4te.cache, that I took care to remove before, has
now been recreated. Arghh!


Versions of software implied:
- autoheader 2.69
- perl 5.22.1
- all on Ubuntu 16.04




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?109406>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


Reply | Threaded
Open this post in threaded view
|

[sr #109406] autoheader creates config.h.in file with wrong timestamp

Markus Elfring-2
Follow-up Comment #1, sr #109406 (project autoconf):

The workaround is to never run 'autoheader' alone.
Always run 'autoheader && toouch config.h.in' (and hope that you are not on an
NFS mounted volume with significant time differences between NFS server and
client).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?109406>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


Reply | Threaded
Open this post in threaded view
|

[sr #109406] autoheader creates config.h.in file with wrong timestamp

Markus Elfring-2
Update of sr #109406 (project autoconf):

                  Status:                    None => Done                  
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #2:

Thanks for reporting the problem. It is due to a bug in the way that Perl's
'move' function deals with timestamps when it crosses a filesystem boundary. I
installed this workaround into Autoconf:

http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e5f5e535adec83b146bfc921d9005ecf6a846464

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?109406>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/