help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to disable "make[1]: Warning: File `somefile' has modification t


From: Paul Smith
Subject: Re: How to disable "make[1]: Warning: File `somefile' has modification time 53 s in the future"?
Date: Fri, 13 Aug 2010 13:49:40 -0400

On Fri, 2010-08-13 at 11:25 -0500, Peng Yu wrote:
> On Fri, Aug 13, 2010 at 11:15 AM, Paul Smith <address@hidden> wrote:
> > On Fri, 2010-08-13 at 11:04 -0500, Peng Yu wrote:
> >> I want to disable the warning shown in the title.
> >
> > You can't, except by fixing your environment so the timestamps on your
> > system are coherent.  Most likely this is caused by trying to write
> > files to a networked file server where your system and the server have a
> > different system time: you will never be able to correctly build files
> > with make in that environment, so you'll have to fix the problem.
> 
> I'm not sure why this matters.
> 
> If all the targets and dependencies are off by the same amount of
> time, then the build will not be wrong. I think that only if targets
> and dependencies are off by different amount of time (which means that
> they are on different network file systems) then the build may be
> wrong.

Not true.  It can still make a huge difference depending on which system
(the client or the server) sets the timestamp.  Any files that have
timestamps set by the server (by simply modifying them so the server
updates the modified time) will have the server's time, but any files
that have timestamps set by the client (by running "touch" on them, as
one example) will have the client's time.

That's bad.

> A side question. How to set two systems to have coherent time? Right
> now, I have two systems that synchronize with a public time server
> every day. But as you see their time is off for some reason. I guess
> the only option to synchronize one machine to another, rather than
> both synchronize to a public time server.

Since you've given us no indication of what kind of systems you're using
there's not much we can say to this.

However, I suggest you re-examine your assertion that both systems are
getting times synchronized to the same public time server every day.
It's almost inconceivable that a system's clock would diverge by almost
a minute in less than a day.

I suspect that at least one and maybe both of these systems are NOT
having their time set properly.

Of course, it's much better to use NTP so that your system times are
continuously being maintained, but even once a day should be sufficient
with any reasonable system hardware.

> I don't have time to read the source code of make. But based on my
> above reason. Is it making sense to add an option to disable such
> warnings?

I don't see any justification for adding a new flag or special target
just to suppress that warning.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]