systemd/tools
Zbigniew Jędrzejewski-Szmek 681bd2c524 meson: generate version tag from git
$ build/systemctl --version
systemd 239-3555-g6178cbb5b5
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid
$ git tag v240 -m 'v240'
$ ninja -C build
ninja: Entering directory `build'
[76/76] Linking target fuzz-unit-file.
$ build/systemctl --version
systemd 240
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid

This is very useful during development, because a precise version string is
embedded in the build product and displayed during boot, so we don't have to
guess answers for questions like "did I just boot the latest version or the one
from before?".

This change creates an overhead for "noop" builds. On my laptop, 'ninja -C
build' that does nothing goes from 0.1 to 0.5 s. It would be nice to avoid
this, but I think that <1 s is still acceptable.

Fixes #7183.

PACKAGE_VERSION is renamed to GIT_VERSION, to make it obvious that this is the
more dynamically changing version string.

Why save to a file? It would be easy to generate the version tag using
run_command(), but we want to go through a file so that stuff gets rebuilt when
this file changes. If we just defined an variable in meson, ninja wouldn't know
it needs to rebuild things.
2018-12-21 13:43:20 +01:00
..
add-git-hook.sh separate flags from shebang 2017-12-25 19:48:49 +01:00
catalog-report.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
check-directives.sh travis: make sure that *.perf and directives.* files are in sync 2018-11-28 05:12:58 +01:00
check-includes.pl Drop "Copyright abandonded" header 2018-07-24 11:14:44 +02:00
coverity.sh coverity.sh: fail if uploading data to Coverity Scan is forbidden 2018-06-25 22:22:29 +00:00
find-build-dir.sh separate flags from shebang 2017-12-25 19:48:49 +01:00
find-double-newline.sh tools: make various scripts find the top-levle git dir automatically 2018-06-07 16:22:16 +02:00
find-tabs.sh tools: make various scripts find the top-levle git dir automatically 2018-06-07 16:22:16 +02:00
gdb-sd_dump_hashmaps.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
generate-gperfs.py tools: add one more SPDX license header 2018-12-10 03:08:52 +09:00
make-directive-index.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
make-index-md.sh docs: work around GitHub pages weirdness 2018-11-29 19:09:09 +01:00
make-man-index.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
make-man-rules.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
meson-apply-m4.sh meson: generate m4 preprocessor from config.h (#8914) 2018-05-07 11:17:35 +02:00
meson-build.sh meson: use same compilers to build fuzzers 2018-10-09 11:54:10 +02:00
meson-check-api-docs.sh meson: print stats in check-api-docs 2018-08-02 15:49:45 +02:00
meson-check-compilation.sh separate flags from shebang 2017-12-25 19:48:49 +01:00
meson-check-help.sh separate flags from shebang 2017-12-25 19:48:49 +01:00
meson-git-contrib.sh separate flags from shebang 2017-12-25 19:48:49 +01:00
meson-hwdb-update.sh hwdb-update: make sure it works when run from meson 2018-06-13 14:20:03 +02:00
meson-make-symlink.sh separate flags from shebang 2017-12-25 19:48:49 +01:00
meson-vcs-tag.sh meson: generate version tag from git 2018-12-21 13:43:20 +01:00
oss-fuzz.sh oss-fuzz.sh: copy dictionaries along with "options" files 2018-11-06 19:55:11 +01:00
xml_helper.py tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00