Recording source information in a build

Kelly O'Hair Kelly.Ohair at Sun.COM
Tue Apr 29 17:22:25 UTC 2008


Thanks for the comments.

Jesse Glick wrote:
> Kelly O'Hair wrote:
>> hg tip --template 'changeset={node}\n'
> 
> I would recommend using 'hg id', not 'hg tip':
> 
> 1. If the developer has updated to a specific revision and built it, 'hg 
> id' would be accurate, but 'hg tip' would be meaningless.
> 

Good point.

> 2. If there are local modifications, 'hg id' will record that fact (with 
> a '+'), which is good to know.
> 

Agreed.

> It will also include tag information, which may or may not be desirable.
> 
> I would expect 'java -version' to include the changeset ID, if it were 
> built from sources and was not a formal release.

Ah, if it was only one changeset ID that would be great, but we have many
repositories. I'm thinking a 'java -sourceversion' option maybe?

>> TREES:=$(shell hg ftrees)
> 
> Or could just search for direct subdirs with .hg subsubdirs. A lot 
> faster, does not use the forest extension, and should work for the 
> OpenJDK forest at least.
> 

I've discovered this too. Something like:

    find . -name build -type d -prune -o \
           -name dist  -type d -prune -o \
           -name .hg   -type d -prune -exec dirname {} \;

Is much faster. :^)

-kto



More information about the build-dev mailing list