aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2017-04-03 19:02:58 +0200
committerSimon Warta <[email protected]>2017-04-03 19:02:58 +0200
commit4dd4ab5d24e4c099f967ad5a1f678e8096e1772a (patch)
tree072e45a0e1cc0f9c1600506742bd93b5c5582b5d /configure.py
parentbf23880d2896c4ce01b8b79c2d99c95a540bb8f2 (diff)
Ensure get_vc_revision() does not run before logger is set up
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/configure.py b/configure.py
index 5b48877cb..fd06549d4 100755
--- a/configure.py
+++ b/configure.py
@@ -96,13 +96,20 @@ class Version(object):
so_rev = botan_version.release_so_abi_rev
release_type = botan_version.release_type
datestamp = botan_version.release_datestamp
- vc_rev = botan_version.release_vc_rev if botan_version.release_vc_rev else get_vc_revision()
packed = major * 1000 + minor # Used on Darwin for dylib versioning
+ _vc_rev = None
@staticmethod
def as_string():
return '%d.%d.%d' % (Version.major, Version.minor, Version.patch)
+ @staticmethod
+ def vc_rev():
+ # Lazy load to ensure get_vc_revision() does not run before logger is set up
+ if Version._vc_rev is None:
+ Version._vc_rev = botan_version.release_vc_rev if botan_version.release_vc_rev else get_vc_revision()
+ return Version._vc_rev
+
class BuildPaths(object): # pylint: disable=too-many-instance-attributes
"""
@@ -1617,7 +1624,7 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
'version_major': Version.major,
'version_minor': Version.minor,
'version_patch': Version.patch,
- 'version_vc_rev': Version.vc_rev,
+ 'version_vc_rev': Version.vc_rev(),
'so_abi_rev': Version.so_rev,
'version': Version.as_string(),
'version_packed': Version.packed,
@@ -2513,7 +2520,7 @@ def main(argv=None):
logging.info('Botan %s (VC %s) (%s %s) build setup is complete' % (
Version.as_string(),
- Version.vc_rev,
+ Version.vc_rev(),
Version.release_type,
release_date(Version.datestamp)))