[bug #66500] Caching of timestamps prevents proper builds

Dmitry Goncharov <[email protected]>
Newsgroups gmane.comp.gnu.make.bugs
Message-ID <[email protected]>
Follow-up Comment #1, bug #66500 (group make):

There is this makefile in the attachment.


baz: foo/tar
    touch baz
foo/tar: foo
foo: bar
    -mkdir foo
    touch foo/tar


Make is correct. Make is doing what this makefile tells make to do.
The user touches bar and runs make.  Make goes through the graph of targets
and rebuilds the targets that need to be rebuild. The graph is baz -> foo/tar
-> foo -> bar.  Make detects that bar changes and runs the recipe to rebuild
foo.  The recipe runs mkdir foo, mkdir foo fails, the recipe touches foo/tar.
After the recipe is done, foo is intact.  The mtime of a directory does not
change when the mtime of a file inside that directory changes.  Since foo is
intact, there is no need to rebuild foo/tar and no need to rebuild baz. Make
has no idea that the recipe touched foo/tar. The user runs make again.  Make
goes through the graph of targets and rebuilds the targets that need to be
rebuild. The graph is the same baz -> foo/tar -> foo -> bar.  Make detects
that foo/tar changed and touches baz.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66500>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZ7gEPAAKCRCqLAuaBUf3
Tk3TAQCWL1z5P00ccezcQdOX3r5CGZU4dPyfjFiZ6kWFiMruzgD9ELp/PLun+OVG
FUy0t2Phx4IxaQ5EFeT76zs5NviYlQM=
=XWMq
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.