Rename hgVersion to sourceVersion.

This commit is contained in:
A.J. Beamon 2019-11-15 12:26:51 -08:00
parent 9c0f570ecd
commit ed8d3f163c
14 changed files with 33 additions and 33 deletions

4
.gitignore vendored
View File

@ -30,9 +30,9 @@ bindings/python/MANIFEST
bindings/ruby/lib/fdboptions.rb
bindings/ruby/fdb.gemspec
fdbclient/vexillographer/obj/
fdbrpc/hgVersion*.h
fdbrpc/SourceVersion*.h
fdbrpc/libeio/config.h
flow/hgVersion*.h
flow/SourceVersion*.h
generated.mk
versions.h
packaging/msi/FDBInstaller.wix*

View File

@ -826,7 +826,7 @@ const KeyRef exeFastRestoreAgent = LiteralStringRef("fastrestore_agent"); // mus
const KeyRef exeDatabaseAgent = LiteralStringRef("dr_agent");
const KeyRef exeDatabaseBackup = LiteralStringRef("fdbdr");
extern const char* getHGVersion();
extern const char* getSourceVersion();
#ifdef _WIN32
void parentWatcher(void *parentHandle) {
@ -842,7 +842,7 @@ void parentWatcher(void *parentHandle) {
static void printVersion() {
printf("FoundationDB " FDB_VT_PACKAGE_NAME " (v" FDB_VT_VERSION ")\n");
printf("source version %s\n", getHGVersion());
printf("source version %s\n", getSourceVersion());
printf("protocol %llx\n", (long long) currentProtocolVersion.version());
}
@ -3459,7 +3459,7 @@ int main(int argc, char* argv[]) {
TraceEvent("ProgramStart")
.setMaxEventLength(12000)
.detail("SourceVersion", getHGVersion())
.detail("SourceVersion", getSourceVersion())
.detail("Version", FDB_VT_VERSION )
.detail("PackageName", FDB_VT_PACKAGE_NAME)
.detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(NULL))

View File

@ -54,7 +54,7 @@
#include "flow/actorcompiler.h" // This must be the last #include.
extern const char* getHGVersion();
extern const char* getSourceVersion();
std::vector<std::string> validOptions;
@ -563,7 +563,7 @@ void initHelp() {
void printVersion() {
printf("FoundationDB CLI " FDB_VT_PACKAGE_NAME " (v" FDB_VT_VERSION ")\n");
printf("source version %s\n", getHGVersion());
printf("source version %s\n", getSourceVersion());
printf("protocol %" PRIx64 "\n", currentProtocolVersion.version());
}
@ -2623,7 +2623,7 @@ ACTOR Future<int> cli(CLIOptions opt, LineNoise* plinenoise) {
if (opt.trace) {
TraceEvent("CLIProgramStart")
.setMaxEventLength(12000)
.detail("SourceVersion", getHGVersion())
.detail("SourceVersion", getSourceVersion())
.detail("Version", FDB_VT_VERSION)
.detail("PackageName", FDB_VT_PACKAGE_NAME)
.detailf("ActualTime", "%lld", DEBUG_DETERMINISM ? 0 : time(NULL))

View File

@ -60,7 +60,7 @@
#endif
#include "flow/actorcompiler.h" // This must be the last #include.
extern const char* getHGVersion();
extern const char* getSourceVersion();
using std::max;
using std::min;
@ -791,7 +791,7 @@ Database Database::createDatabase( Reference<ClusterConnectionFile> connFile, in
openTraceFile(NetworkAddress(publicIP, ::getpid()), networkOptions.traceRollSize, networkOptions.traceMaxLogsSize, networkOptions.traceDirectory.get(), "trace", networkOptions.traceLogGroup);
TraceEvent("ClientStart")
.detail("SourceVersion", getHGVersion())
.detail("SourceVersion", getSourceVersion())
.detail("Version", FDB_VT_VERSION)
.detail("PackageName", FDB_VT_PACKAGE_NAME)
.detail("ClusterFile", connFile->getFilename().c_str())

View File

@ -333,9 +333,9 @@ void ThreadSafeTransaction::reset() {
onMainThreadVoid( [tr](){ tr->reset(); }, NULL );
}
extern const char* getHGVersion();
extern const char* getSourceVersion();
ThreadSafeApi::ThreadSafeApi() : apiVersion(-1), clientVersion(format("%s,%s,%llx", FDB_VT_VERSION, getHGVersion(), currentProtocolVersion)), transportId(0) {}
ThreadSafeApi::ThreadSafeApi() : apiVersion(-1), clientVersion(format("%s,%s,%llx", FDB_VT_VERSION, getSourceVersion(), currentProtocolVersion)), transportId(0) {}
void ThreadSafeApi::selectApiVersion(int apiVersion) {
this->apiVersion = apiVersion;

View File

@ -163,8 +163,8 @@
</PropertyGroup>
<ItemDefinitionGroup>
<CustomBuildStep>
<Command>echo const char *hgVersion = "Current version id not currently supported within Windows."; &gt; hgVersion.temp.h &amp;&amp; fc /b hgVersion.temp.h hgVersion.h &gt; nul || copy hgVersion.temp.h hgVersion.h &gt; nul</Command>
<Message>Checking HG source version</Message>
<Command>echo const char *sourceVersion = "Current version id not currently supported within Windows."; &gt; SourceVersion.temp.h &amp;&amp; fc /b SourceVersion.temp.h SourceVersion.h &gt; nul || copy SourceVersion.temp.h SourceVersion.h &gt; nul</Command>
<Message>Checking source version</Message>
<Outputs>fake.out</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>

View File

@ -43,7 +43,7 @@
#undef min
extern "C" int g_expect_full_pointermap;
extern const char* getHGVersion();
extern const char* getSourceVersion();
const int MACHINE_REBOOT_TIME = 10;
@ -232,7 +232,7 @@ ACTOR Future<ISimulator::KillType> simulatedFDBDRebooter(Reference<ClusterConnec
.detail("Excluded", process->excluded)
.detail("UsingSSL", sslEnabled);
TraceEvent("ProgramStart").detail("Cycles", cycles).detail("RandomId", randomId)
.detail("SourceVersion", getHGVersion())
.detail("SourceVersion", getSourceVersion())
.detail("Version", FDB_VT_VERSION)
.detail("PackageName", FDB_VT_PACKAGE_NAME)
.detail("DataFolder", *dataFolder)

View File

@ -183,7 +183,7 @@ extern void createTemplateDatabase();
// FIXME: this really belongs in a header somewhere since it is actually used.
extern IPAddress determinePublicIPAutomatically(ClusterConnectionString const& ccs);
extern const char* getHGVersion();
extern const char* getSourceVersion();
extern void flushTraceFileVoid();
@ -518,7 +518,7 @@ void* parentWatcher(void *arg) {
static void printVersion() {
printf("FoundationDB " FDB_VT_PACKAGE_NAME " (v" FDB_VT_VERSION ")\n");
printf("source version %s\n", getHGVersion());
printf("source version %s\n", getSourceVersion());
printf("protocol %" PRIx64 "\n", currentProtocolVersion.version());
}
@ -1672,7 +1672,7 @@ int main(int argc, char* argv[]) {
TraceEvent("ProgramStart")
.setMaxEventLength(12000)
.detail("RandomSeed", opts.randomSeed)
.detail("SourceVersion", getHGVersion())
.detail("SourceVersion", getSourceVersion())
.detail("Version", FDB_VT_VERSION)
.detail("PackageName", FDB_VT_PACKAGE_NAME)
.detail("FileSystem", opts.fileSystemPath)

View File

@ -63,7 +63,7 @@ set(FLOW_SRCS
XmlTraceLogFormatter.cpp
actorcompiler.h
error_definitions.h
${CMAKE_CURRENT_BINARY_DIR}/hgVersion.h
${CMAKE_CURRENT_BINARY_DIR}/SourceVersion.h
flat_buffers.h
flat_buffers.cpp
flow.cpp
@ -78,7 +78,7 @@ set(FLOW_SRCS
stacktrace.h
version.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hgVersion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/hgVersion.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SourceVersion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SourceVersion.h)
add_flow_target(STATIC_LIBRARY NAME flow SRCS ${FLOW_SRCS})
target_include_directories(flow PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -0,0 +1,2 @@
#pragma once
#define sourceVersion "${CURRENT_GIT_VERSION}"

View File

@ -142,8 +142,8 @@
</PropertyGroup>
<ItemDefinitionGroup>
<PreBuildEvent>
<Command>echo const char *hgVersion = "Current version id not currently supported within Windows."; &gt; hgVersion.temp.h &amp;&amp; fc /b hgVersion.temp.h hgVersion.h &gt; nul || copy hgVersion.temp.h hgVersion.h &gt; nul</Command>
<Message>Checking HG source version</Message>
<Command>echo const char *SourceVersion = "Current version id not currently supported within Windows."; &gt; SourceVersion.temp.h &amp;&amp; fc /b SourceVersion.temp.h SourceVersion.h &gt; nul || copy SourceVersion.temp.h SourceVersion.h &gt; nul</Command>
<Message>Checking source version</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'">

View File

@ -1,2 +0,0 @@
#pragma once
#define hgVersion "${CURRENT_GIT_VERSION}"

View File

@ -28,12 +28,12 @@ ifeq ($(PLATFORM),osx)
flow_LDFLAGS += -framework CoreFoundation -framework IOKit
endif
GENERATED_SOURCES += flow/hgVersion.h versions.h
flow_GENERATED_SOURCES += flow/SourceVersion.h versions.h
flow/hgVersion.h: FORCE
@echo "Checking hgVersion.h"
@echo "const char *hgVersion = \"$(VERSION_ID)\";" > flow/hgVersion.h.new
@([ -e flow/hgVersion.h ] && diff -q flow/hgVersion.h flow/hgVersion.h.new >/dev/null && rm flow/hgVersion.h.new) || mv flow/hgVersion.h.new flow/hgVersion.h
flow/SourceVersion.h: FORCE
@echo "Checking SourceVersion.h"
@echo "const char *sourceVersion = \"$(VERSION_ID)\";" > flow/SourceVersion.h.new
@([ -e flow/SourceVersion.h ] && diff -q flow/SourceVersion.h flow/SourceVersion.h.new >/dev/null && rm flow/SourceVersion.h.new) || mv flow/SourceVersion.h.new flow/SourceVersion.h
lib/libflow.a: bin/coverage.flow.xml

View File

@ -18,8 +18,8 @@
* limitations under the License.
*/
#include "flow/hgVersion.h"
#include "flow/SourceVersion.h"
const char* getHGVersion() {
return hgVersion;
const char* getSourceVersion() {
return sourceVersion;
}