mailing list of musl libc
 help / color / mirror / code / Atom feed
* Version reporting
@ 2013-11-21  2:25 Rich Felker
  0 siblings, 0 replies; only message in thread
From: Rich Felker @ 2013-11-21  2:25 UTC (permalink / raw)
  To: musl

One of the requested features I want to get in before 1.0 is having
ld.so report the musl version; an open issue is whether the version
should also get linked into static binaries. I've gone back and forth
about how much detail I want in the version string, but here's a
proposal we could discuss:

Base version stored in VERSION file.

Generate version.c with deps (to force rebuild) on VERSION and an
appropriate file in .git if it exists (using $wildcard()).

Derivation of version.c:
- If .git does not exist, simply use VERSION
- Else if .git exists but git command does not work, use VERSION+git
- Else if git describe with --match matches VERSION, use VERSION
- Else if git does not have tag matching VERSION, use VERSION
- Else, use VERSION+git

Optionally, the else case could be replaced with a more detailed
version string produced by git describe. It's not clear to me whether
this is desirable; more likely, it's misleading if you have local
changes in your tree, since it gives a false feeling that the binary
actually matches a particular revision in the git history.

An alternate, possibly simpler approach would be simply always using
VERSION and appending +git unconditionally if .git exists.

Comments?

Rich


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-21  2:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21  2:25 Version reporting Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).