Maxim Kalaev
unread,Jul 16, 2012, 4:10:57 AM7/16/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ninja...@googlegroups.com
I want my final executable to contain info about GIT commits and unmodified files included in it to be able to know exactly which GIT version was used to build it (could be a nice addition for ninja executable itself, BTW).
This can be accomplished running a couple of git commands and generating scm_info.c file with a versioning info string to be included into the final executable (e.g., git rev-parse HEAD, git status -uno --short + some scripts to make this into C array).
Then comes the question when to run this scripts to generate the information. My options are:
- on each build attempt, including noop: define a phony rule running these commands always - silly - no noop builds.
- when any input to the final executable changes: better, but still annoying: makes scm_info.c deplist annoyingly long (and incorrect, actually), and as a result - can't create scm_info.c it in parallel to other commands while I could. - at least I have a noop build here.
- adding to ninja a 'build_info' variable which will make edge dirty IFF any non 'build_info' target is dirty, or may be, introducing a new type of 'trigger dependency', being an opposite of 'order-only' dependencies, meaning - independent in terms of order, but becomes dirty if any of the dependants are dirty.
What would you suggest?