Skip to content

Commit 7d818c9

Browse files
committed
Print git revision with all --version outputs
This uses the output of `git-describe --tags --always --dirty` to create a UID for binaries. This includes last tag, number of commits after last tag, shortened SHA1 checksum and optional dirty flag for uncommited changes. In case of tagged commit, only the tag name is used.
1 parent 72638a2 commit 7d818c9

36 files changed

+25
-49
lines changed

jbmc/src/janalyzer/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ CLEANFILES = janalyzer$(EXEEXT)
3333

3434
all: janalyzer$(EXEEXT)
3535

36+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
37+
3638
ifneq ($(wildcard ../jsil/Makefile),)
3739
OBJ += ../jsil/jsil$(LIBEXT)
3840
CP_CXXFLAGS += -DHAVE_JSIL

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ Author: Daniel Kroening, [email protected]
5050
#include <util/options.h>
5151
#include <util/unicode.h>
5252

53-
#include <cbmc/version.h>
54-
5553
#include <goto-analyzer/static_show_domain.h>
5654
#include <goto-analyzer/static_simplifier.h>
5755
#include <goto-analyzer/static_verifier.h>

jbmc/src/janalyzer/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
analyses
22
ansi-c # should go away
3-
cbmc # version.h
43
java_bytecode
54
jdiff
65
goto-analyzer

jbmc/src/jbmc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ CLEANFILES = jbmc$(EXEEXT)
6363

6464
all: jbmc$(EXEEXT)
6565

66+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
67+
6668
###############################################################################
6769

6870
jbmc$(EXEEXT): $(OBJ)

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ Author: Daniel Kroening, [email protected]
6060
#include <java_bytecode/replace_java_nondet.h>
6161
#include <java_bytecode/simple_method_stubbing.h>
6262

63-
#include <cbmc/version.h>
64-
6563
jbmc_parse_optionst::jbmc_parse_optionst(int argc, const char **argv):
6664
parse_options_baset(JBMC_OPTIONS, argc, argv),
6765
messaget(ui_message_handler),

jbmc/src/jbmc/module_dependencies.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
analyses
22
ansi-c # should go away
3-
cbmc # version.h and bmc.h
3+
cbmc # bmc.h
44
goto-instrument
55
goto-programs
66
goto-symex

jbmc/src/jdiff/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ CLEANFILES = jdiff$(EXEEXT)
4545

4646
all: jdiff$(EXEEXT)
4747

48+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
49+
4850
###############################################################################
4951

5052
jdiff$(EXEEXT): $(OBJ)

jbmc/src/jdiff/jdiff_parse_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ Author: Peter Schrammel
5555

5656
#include <langapi/mode.h>
5757

58-
#include <cbmc/version.h>
59-
6058
#include "java_syntactic_diff.h"
6159
#include <goto-diff/change_impact.h>
6260
#include <goto-diff/goto_diff.h>

jbmc/src/jdiff/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
analyses
2-
cbmc # version.h
32
java_bytecode
43
jdiff
54
goto-diff

src/cbmc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ CLEANFILES = cbmc$(EXEEXT)
6363

6464
all: cbmc$(EXEEXT)
6565

66+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
67+
6668
ifneq ($(wildcard ../bv_refinement/Makefile),)
6769
OBJ += ../bv_refinement/bv_refinement$(LIBEXT)
6870
CP_CXXFLAGS += -DHAVE_BV_REFINEMENT

src/cbmc/cbmc_parse_options.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Author: Daniel Kroening, [email protected]
6262

6363
#include <langapi/mode.h>
6464

65-
#include "version.h"
6665
#include "xml_interface.h"
6766

6867
cbmc_parse_optionst::cbmc_parse_optionst(int argc, const char **argv):

src/cbmc/cbmc_solvers.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Author: Daniel Kroening, [email protected]
2828
#include "bv_cbmc.h"
2929
#include "cbmc_dimacs.h"
3030
#include "counterexample_beautification.h"
31-
#include "version.h"
3231

3332
/// Uses the options to pick an SMT 2.0 solver
3433
/// \return An smt2_dect::solvert giving the solver to use.

src/cbmc/version.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/clobber/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ CLEANFILES = clobber$(EXEEXT)
3030

3131
all: clobber$(EXEEXT)
3232

33+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
34+
3335
###############################################################################
3436

3537
clobber$(EXEEXT): $(OBJ)

src/clobber/clobber_parse_options.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Author: Daniel Kroening, [email protected]
3434

3535
#include <langapi/mode.h>
3636

37-
#include <cbmc/version.h>
3837

3938
clobber_parse_optionst::clobber_parse_optionst(int argc, const char **argv):
4039
parse_options_baset(CLOBBER_OPTIONS, argc, argv),

src/config.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@ endif
7070
# Signing identity for MacOS Gatekeeper
7171

7272
OSX_IDENTITY="Developer ID Application: Daniel Kroening"
73+
74+
# Detailed version information
75+
CBMC_VERSION = 5.8
76+
GIT_INFO = $(shell git describe --tags --always --dirty || echo "n/a")

src/goto-analyzer/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ CLEANFILES = goto-analyzer$(EXEEXT)
3232

3333
all: goto-analyzer$(EXEEXT)
3434

35+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
36+
3537
ifneq ($(wildcard ../jsil/Makefile),)
3638
OBJ += ../jsil/jsil$(LIBEXT)
3739
CP_CXXFLAGS += -DHAVE_JSIL

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Author: Daniel Kroening, [email protected]
5454
#include <util/unicode.h>
5555
#include <util/exit_codes.h>
5656

57-
#include <cbmc/version.h>
5857
#include <goto-programs/adjust_float_expressions.h>
5958

6059
#include "taint_analysis.h"

src/goto-analyzer/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
ansi-c
22
analyses
3-
cbmc # version.h
43
cpp
54
goto-analyzer
65
goto-programs

src/goto-cc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ all: goto-cl$(EXEEXT)
4646
endif
4747
all: goto-cc$(EXEEXT)
4848

49+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
50+
4951
ifneq ($(wildcard ../jsil/Makefile),)
5052
OBJ += ../jsil/jsil$(LIBEXT)
5153
CP_CXXFLAGS += -DHAVE_JSIL

src/goto-cc/as_mode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Author: Michael Tautschnig
2929
#include <util/get_base_name.h>
3030
#include <util/cout_message.h>
3131

32-
#include <cbmc/version.h>
33-
3432
#include "compile.h"
3533

3634
static std::string assembler_name(

src/goto-cc/compile.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ Date: June 2006
3737

3838
#include <linking/static_lifetime_init.h>
3939

40-
#include <cbmc/version.h>
41-
4240
#define DOTGRAPHSETTINGS "color=black;" \
4341
"orientation=portrait;" \
4442
"fontsize=20;"\

src/goto-cc/gcc_mode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Author: CM Wintersteiger, 2006
4646

4747
#include <goto-programs/read_goto_binary.h>
4848

49-
#include <cbmc/version.h>
50-
5149
#include "hybrid_binary.h"
5250
#include "linker_script_merge.h"
5351

src/goto-cc/goto_cc_mode.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Author: CM Wintersteiger, 2006
2222
#include <sysexits.h>
2323
#endif
2424

25-
#include <cbmc/version.h>
2625

2726
/// constructor
2827
goto_cc_modet::goto_cc_modet(

src/goto-cc/ld_mode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Author: CM Wintersteiger, 2006
4646

4747
#include <goto-programs/read_goto_binary.h>
4848

49-
#include <cbmc/version.h>
50-
5149
#include "hybrid_binary.h"
5250
#include "linker_script_merge.h"
5351

src/goto-cc/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ansi-c
2-
cbmc # version.h
32
cpp
43
goto-cc
54
goto-programs

src/goto-cc/ms_cl_mode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Author: CM Wintersteiger, 2006
2626
#include <util/config.h>
2727
#include <util/get_base_name.h>
2828

29-
#include <cbmc/version.h>
30-
3129
#include "compile.h"
3230

3331
/// does it.

src/goto-diff/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ CLEANFILES = goto-diff$(EXEEXT)
4444

4545
all: goto-diff$(EXEEXT)
4646

47+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
48+
4749
###############################################################################
4850

4951
goto-diff$(EXEEXT): $(OBJ)

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ Author: Peter Schrammel
5555
#include <ansi-c/cprover_library.h>
5656
#include <cpp/cprover_library.h>
5757

58-
#include <cbmc/version.h>
59-
6058
#include "goto_diff.h"
6159
#include "syntactic_diff.h"
6260
#include "unified_diff.h"

src/goto-diff/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
analyses
22
ansi-c
3-
cbmc # version.h
43
cpp
54
goto-diff
65
goto-instrument

src/goto-instrument/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ include ../common
101101

102102
all: goto-instrument$(EXEEXT) goto-instrument$(LIBEXT)
103103

104+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
105+
104106
ifneq ($(LIB_GLPK),)
105107
LIBS += $(LIB_GLPK)
106108
CP_CXXFLAGS += -DHAVE_GLPK

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ Author: Daniel Kroening, [email protected]
6565
#include <ansi-c/cprover_library.h>
6666
#include <cpp/cprover_library.h>
6767

68-
#include <cbmc/version.h>
69-
7068
#include "document_properties.h"
7169
#include "uninitialized.h"
7270
#include "full_slicer.h"

src/goto-instrument/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
accelerate
22
analyses
33
ansi-c
4-
cbmc # version.h
54
cpp
65
goto-instrument
76
goto-programs

src/memory-models/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ CLEANFILES = memory_models$(LIBEXT) \
2222

2323
all: mmcc$(EXEEXT)
2424

25+
CP_CXXFLAGS += -DCBMC_VERSION="\"$(CBMC_VERSION) ($(GIT_INFO))\""
26+
2527
###############################################################################
2628

2729
mm_y.tab.cpp: parser.y

src/memory-models/mmcc_parse_options.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Author: Daniel Kroening, [email protected]
1616

1717
#include <util/cout_message.h>
1818

19-
#include <cbmc/version.h>
20-
2119
#include "mm_parser.h"
2220
#include "mm2cpp.h"
2321

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
cbmc # version.h
21
memory-models
32
langapi # should go away
43
util

0 commit comments

Comments
 (0)