Reland "Add version consistently in all build configs and UI"
This is a partial reland of r.android.com/1499116 and
r.android.com/1497878, % the changes that depend on .git
on Android. Turns out that was a bad idea because some bots
can build without it.
Change:
The script that generates the build version can already gracefully
deal with the absence of git. However I forgot the dependency on
.git/HEAD, which makes the build system fail.
For now, in order to avoid problems, this avoids any git
invocation on Android in-tree builds. A follow up CL will
try extending with libbuildversion as suggedted in the bug.
This reverts commit 9d15a2309a4f03d000bcf6d4d4dcba36a3df2916.
This reverts commit bb4bfb0665d16525868e94f941d87ae89c858eb3.
The first patchset is a plain re-revert (i.e. a plain reland).
The patchset on top show the delta from the original cl (for ease
of re-review)
Bug: 173245796
Change-Id: Icd2f7f2727313b9cdc11c6bfa93b67478ae77974
diff --git a/src/trace_processor/trace_processor_shell.cc b/src/trace_processor/trace_processor_shell.cc
index f5f4923..a1dc002 100644
--- a/src/trace_processor/trace_processor_shell.cc
+++ b/src/trace_processor/trace_processor_shell.cc
@@ -35,6 +35,7 @@
#include "perfetto/ext/base/scoped_file.h"
#include "perfetto/ext/base/string_splitter.h"
#include "perfetto/ext/base/string_utils.h"
+#include "perfetto/ext/base/version.h"
#include "perfetto/trace_processor/read_trace.h"
#include "perfetto/trace_processor/trace_processor.h"
#include "src/trace_processor/metrics/chrome/all_chrome_metrics.descriptor.h"
@@ -64,12 +65,6 @@
#include <sys/types.h>
#endif
-#if PERFETTO_BUILDFLAG(PERFETTO_VERSION_GEN)
-#include "perfetto_version.gen.h"
-#else
-#define PERFETTO_GET_GIT_REVISION() "unknown"
-#endif
-
#if PERFETTO_HAS_SIGNAL_H()
#include <signal.h>
#endif
@@ -802,7 +797,7 @@
break; // EOF.
if (option == 'v') {
- printf("%s\n", PERFETTO_GET_GIT_REVISION());
+ printf("%s\n", base::GetVersionString());
exit(0);
}