[U-Boot] [PATCH][RFC] Update U-Boot's build timestamp on every compile

Wolfgang Denk wd at denx.de
Tue Oct 21 09:04:39 CEST 2008


Dear Peter Tyser,

In message <1224554522.11401.28.camel at ptyser-laptop> you wrote:
>
> > this text probably belongs in the commit message above your SOB.  But I
> > still don't understand why __TIME__ didn't work for you..can you
> > elaborate?
> 
> __TIME__ and __DATE__ aren't ideal as they are only updated when the
> file that contains them is recompiled.  For example, during the normal
> modify/build/test cycle the version string remains the same for an 85xx
> board as start.S would not be recompiled.  So any number of U-Boot
> compilations can contain different code, but have the same build
> time/version string.  eg when a board boots up and spits out:

Actually the time stamp is completely useless in determining  if  the
code is the same or different. I can compile the same code many times
resulting  in  different time stamps and yet it's the very same code.
And I can (at least theoretically) manage  to  build  two  completely
different versions at the same time...

> U-Boot 1.3.4 (Aug  7 2008 - 12:32:20)
...
> the code really may not have been compiled on Aug 7th, it could have
> been compiled today, yesterday, etc.

Who cares when it was really built? If you are working in the
recommended environment (i. e. using git) then you can be sure that
this was the code of the v1.3.4 release; otherwise you would have seen
something as

U-Boot 2008.10-rc2-00018-g8fd4166-dirty (Sep 30 2008 - 13:42:17)

This clearly tells you which version the code was based on (and  that
it contains local modifications that were not yet checked in).

> It would be nice in my mind if every compile of U-Boot resulted in a new
> build time string.  Thus you could easily determine which version is
> programmed on a board during bootup, by looking at a binary on your host

Timestamps are not suitable to provide this type of  information.  If
you care about which code you are running, than make sure to use git.

> Also, if a board used __TIME__/__DATE__ in more than one location, it
> could be confusing as the times wouldn't be identical.  For example, if

Why would that be confusing? It seems natural to me that time changes
when  you  do  several  things  sequentially.   If   a   board   used
__TIME__/__DATE__   in   more  than  one  location,  then  the  board
maintainer either did this intentionally (and thus wants to  acchieve
this  result),  or  he  did  it without thinking, in which case it is
obviously not an important issue to him).

> the build time were printed in common/lcd.c, it would not be identical
> to the time printed on the serial port since lcd.c was not compiled at
> the same time as cpu/mpc8xx/start.S.

If you care about reliable version information, use the git based ID
strings.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Vulcans believe peace should not depend on force.
	-- Amanda, "Journey to Babel", stardate 3842.3


More information about the U-Boot mailing list