[ccache] CCACHE_HARDLINK and timestamps
rlaager at wiktel.com
Fri Apr 7 05:34:19 GMT 2006
On Fri, 2006-04-07 at 14:28 +1000, Martin Pool wrote:
> On 06/04/2006, at 1:09 PM, Richard Laager wrote:
> > The man page says:
> > "Using hard links is faster, but can confuse programs like ’make’ that
> > rely on modification times."
> > Perhaps I'm missing something obvious, but wouldn't it be easy to
> > link()
> > then do the equivalent of `touch` on the file? Would changing the
> > timestamp on the file in the cache cause any problems?
> The mtime is stored in the inode, which is shared between all links
> to the file. If you did that then any other directories that
> contained the object file would also see its mtime change, possibly
> causing a rebuild over there. Still, it does seem like it'd be
> better to touch the file.
Right, but rebuilding too often is safer than not rebuilding when
necessary. Also, since the output of ccache is the object code, the
unnecessary rebuilding that would happen is just linking, which isn't
*as* bad as, say, compiling. Finally, the relinking is only going to
happen when you re-run make in that other directory. I'd imagine people
generally run make when they have made changes and need a rebuild, so
the relinking impact in the vast majority of cases (possibly all?) is
Perhaps I'll look at making a patch. If necessary, I could make a
separate parameter control the touching.
More information about the ccache