- changed milestone to 2019.03.31 release
nobs git describe watermarking support
With pull request #25 merged, users can now use ident
to query UPC++ version info from any UPC++ executable. This will soon also include a git hash for automated nightly builds.
An additional enhancement would be for nobs to embed the git hash for manual build/installs from a UPC++ git clone.
All that's needed to make this work is for nobs to notice the presence of a .git directory and add the equivalent of:
-DUPCXX_GIT_VERSION=<output of git describe>
to the library compile line. The code needs to be "defensive" and make no change in any of the following situations:
- .git directory missing (eg as in a source tarball)
- git command is not in the PATH (eg the source dir is a git clone on a network drive and this node does not have git)
- git command exits with an error for some reason
John provided the preliminary patch below, which lacks the necessary defensiveness:
diff --git a/nobsrule.py b/nobsrule.py
index 0a3fbe9..935fa8a 100644
--- a/nobsrule.py
+++ b/nobsrule.py
@@ -334,6 +334,16 @@ def comp_version(cxt, src):
def upcxx_assert_enabled(cxt):
return bool(env('ASSERT', False))
+def git_describe():
+ import subprocess as subp
+ p = subp.Popen(['git','describe'], stdout=subp.PIPE)
+ id, _ = p.communicate()
+ id = id.strip()
+ global git_describe
+
+ git_describe = lambda:id
+ return id
+
@rule(path_arg='src')
@coroutine
def comp_lang_pp(cxt, src, libset):
@@ -342,8 +352,10 @@ def comp_lang_pp(cxt, src, libset):
"""
comp = yield cxt.comp_lang(src)
ivt = yield cxt.include_vdirs_tree(src)
+
yield (
comp +
+ ['-DUPCXX_GIT_VERSION='+git_describe()] +
['-D_GNU_SOURCE=1'] + # Required for full latest POSIX on some systems
['-I'+ivt] +
libset_ppflags(libset)
Comments (3)
-
reporter -
reporter - changed milestone to 2020.3.0 release
This issue was triaged at the 2019-07-24 Pagoda issue meeting and assigned a new milestone.
-
reporter - changed status to resolved
pull request #134 retires nobs from end-user support
The replacement infrastructure implements the requested capability
- Log in to comment
Mass roll-over of unresolved issues to the next milestone.