Commit f3026389 authored by hablich's avatar hablich Committed by Commit bot

Revert of [build] Introduce an embedder version string (patchset #2 id:20001...

Revert of [build] Introduce an embedder version string (patchset #2 id:20001 of https://codereview.chromium.org/2619213002/ )

Reason for revert:
Seems to break the Chromium build: https://codereview.chromium.org/2619193005/

Message:

[1832/9671] CXX obj/v8/v8_base/version.o
FAILED: obj/v8/v8_base/version.o
/b/c/cipd/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/v8/v8_base/version.o.d -DV8_DEPRECATION_WARNINGS -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DUSE_PROPRIETARY_CODECS -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=289944-2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_I18N_SUPPORT -DENABLE_HANDLE_ZAPPING -DV8_USE_EXTERNAL_STARTUP_DATA -DV8_TARGET_ARCH_X64 -DDEBUG -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -I../.. -Igen -I../../v8 -I../../v8/include -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -fcolor-diagnostics -fdebug-prefix-map=/b/c/b/linux/src=. -m64 -march=x86-64 -pthread -g1 --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wsign-compare -Winconsistent-missing-override -Wshorten-64-to-32 -O3 -fno-ident -fdata-sections -ffunction-sections -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -Wno-deprecated -c ../../v8/src/version.cc -o obj/v8/v8_base/version.o
../../v8/src/version.cc:42:34: error: use of undeclared identifier 'V8_EMBEDDER_STRING'
const char* Version::embedder_ = V8_EMBEDDER_STRING;
                                 ^
1 error generated.

Original issue's description:
> [build] Introduce an embedder version string
>
> Sometimes, the embedder might want to merge a fix to an abandoned branch
> or to a supported branch but the fix is not relevant to Chromium.
> This adds a new version string that the embedder can set on compile time
> and that will be appended to the official V8 version.
> The separator must be provided in the string. For instance, to have a
> full version string like "5.5.372.37.custom.1", the embedder must set
> V8_EMBEDDER_STRING to ".custom.1".
>
> Related Node.js issue: https://github.com/nodejs/node/pull/9754
>
> BUG=v8:5740
> R=machenbach@chromium.org,hablich@chromium.com,ofrobots@google.com
>
> Review-Url: https://codereview.chromium.org/2619213002
> Cr-Commit-Position: refs/heads/master@{#42175}
> Committed: https://chromium.googlesource.com/v8/v8/+/fc86d4329b253bf21c1dd85469f1ef4b6e5ba01a

TBR=hablich@chromium.com,machenbach@chromium.org,ofrobots@google.com,mic.besace@gmail.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5740

Review-Url: https://codereview.chromium.org/2621033002
Cr-Commit-Position: refs/heads/master@{#42182}
parent 8bdcc77f
...@@ -29,9 +29,6 @@ declare_args() { ...@@ -29,9 +29,6 @@ declare_args() {
# Enable compiler warnings when using V8_DEPRECATED apis. # Enable compiler warnings when using V8_DEPRECATED apis.
v8_deprecation_warnings = false v8_deprecation_warnings = false
# Allow the embedder to add a custom suffix to the version string.
v8_embedder_string = ""
# Enable compiler warnings when using V8_DEPRECATE_SOON apis. # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
v8_imminent_deprecation_warnings = "" v8_imminent_deprecation_warnings = ""
...@@ -177,10 +174,6 @@ config("features") { ...@@ -177,10 +174,6 @@ config("features") {
defines = [] defines = []
if (v8_embedder_string != "") {
defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
}
if (v8_enable_disassembler) { if (v8_enable_disassembler) {
defines += [ "ENABLE_DISASSEMBLER" ] defines += [ "ENABLE_DISASSEMBLER" ]
} }
......
...@@ -64,9 +64,6 @@ ...@@ -64,9 +64,6 @@
# Enable compiler warnings when using V8_DEPRECATE_SOON apis. # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
'v8_imminent_deprecation_warnings%': 0, 'v8_imminent_deprecation_warnings%': 0,
# Allow the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',
# Set to 1 to enable DCHECKs in release builds. # Set to 1 to enable DCHECKs in release builds.
'dcheck_always_on%': 0, 'dcheck_always_on%': 0,
...@@ -108,9 +105,6 @@ ...@@ -108,9 +105,6 @@
['v8_use_snapshot=="true" and v8_use_external_startup_data==1', { ['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',], 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
}], }],
['v8_embedder_string!=""', {
'defines': ['V8_EMBEDDER_STRING="<(v8_embedder_string)"',],
}],
['dcheck_always_on!=0', { ['dcheck_always_on!=0', {
'defines': ['DEBUG',], 'defines': ['DEBUG',],
}], }],
......
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#define V8_BUILD_NUMBER 0 #define V8_BUILD_NUMBER 0
#define V8_PATCH_LEVEL 0 #define V8_PATCH_LEVEL 0
#ifndef V8_EMBEDDER_STRING
#define V8_EMBEDDER_STRING ""
#endif // V8_EMBEDDER_STRING
// Use 1 for candidates and 0 otherwise. // Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.) // (Boolean macro values are not supported by all preprocessors.)
#define V8_IS_CANDIDATE_VERSION 1 #define V8_IS_CANDIDATE_VERSION 1
......
...@@ -55,16 +55,9 @@ void Log::Initialize(const char* log_file_name) { ...@@ -55,16 +55,9 @@ void Log::Initialize(const char* log_file_name) {
if (output_handle_ != nullptr) { if (output_handle_ != nullptr) {
Log::MessageBuilder msg(this); Log::MessageBuilder msg(this);
if (strlen(Version::GetEmbedder()) == 0) { msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(), Version::GetMinor(), Version::GetBuild(), Version::GetPatch(),
Version::GetMinor(), Version::GetBuild(), Version::IsCandidate());
Version::GetPatch(), Version::IsCandidate());
} else {
msg.Append("v8-version,%d,%d,%d,%d,%s,%d", Version::GetMajor(),
Version::GetMinor(), Version::GetBuild(),
Version::GetPatch(), Version::GetEmbedder(),
Version::IsCandidate());
}
msg.WriteToLogFile(); msg.WriteToLogFile();
} }
} }
......
...@@ -22,10 +22,9 @@ ...@@ -22,10 +22,9 @@
#define S(x) SX(x) #define S(x) SX(x)
#if V8_PATCH_LEVEL > 0 #if V8_PATCH_LEVEL > 0
#define VERSION_STRING \ #define VERSION_STRING \
S(V8_MAJOR_VERSION) \ S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \
"." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S(V8_PATCH_LEVEL) \ V8_PATCH_LEVEL) CANDIDATE_STRING
V8_EMBEDDER_STRING CANDIDATE_STRING
#else #else
#define VERSION_STRING \ #define VERSION_STRING \
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \ S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \
...@@ -39,7 +38,6 @@ int Version::major_ = V8_MAJOR_VERSION; ...@@ -39,7 +38,6 @@ int Version::major_ = V8_MAJOR_VERSION;
int Version::minor_ = V8_MINOR_VERSION; int Version::minor_ = V8_MINOR_VERSION;
int Version::build_ = V8_BUILD_NUMBER; int Version::build_ = V8_BUILD_NUMBER;
int Version::patch_ = V8_PATCH_LEVEL; int Version::patch_ = V8_PATCH_LEVEL;
const char* Version::embedder_ = V8_EMBEDDER_STRING;
bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0); bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
const char* Version::soname_ = SONAME; const char* Version::soname_ = SONAME;
const char* Version::version_string_ = VERSION_STRING; const char* Version::version_string_ = VERSION_STRING;
...@@ -53,8 +51,9 @@ void Version::GetString(Vector<char> str) { ...@@ -53,8 +51,9 @@ void Version::GetString(Vector<char> str) {
const char* is_simulator = ""; const char* is_simulator = "";
#endif // USE_SIMULATOR #endif // USE_SIMULATOR
if (GetPatch() > 0) { if (GetPatch() > 0) {
SNPrintF(str, "%d.%d.%d.%d%s%s%s", GetMajor(), GetMinor(), GetBuild(), SNPrintF(str, "%d.%d.%d.%d%s%s",
GetPatch(), GetEmbedder(), candidate, is_simulator); GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate,
is_simulator);
} else { } else {
SNPrintF(str, "%d.%d.%d%s%s", SNPrintF(str, "%d.%d.%d%s%s",
GetMajor(), GetMinor(), GetBuild(), candidate, GetMajor(), GetMinor(), GetBuild(), candidate,
...@@ -69,8 +68,8 @@ void Version::GetSONAME(Vector<char> str) { ...@@ -69,8 +68,8 @@ void Version::GetSONAME(Vector<char> str) {
// Generate generic SONAME if no specific SONAME is defined. // Generate generic SONAME if no specific SONAME is defined.
const char* candidate = IsCandidate() ? "-candidate" : ""; const char* candidate = IsCandidate() ? "-candidate" : "";
if (GetPatch() > 0) { if (GetPatch() > 0) {
SNPrintF(str, "libv8-%d.%d.%d.%d%s%s.so", GetMajor(), GetMinor(), SNPrintF(str, "libv8-%d.%d.%d.%d%s.so",
GetBuild(), GetPatch(), GetEmbedder(), candidate); GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
} else { } else {
SNPrintF(str, "libv8-%d.%d.%d%s.so", SNPrintF(str, "libv8-%d.%d.%d%s.so",
GetMajor(), GetMinor(), GetBuild(), candidate); GetMajor(), GetMinor(), GetBuild(), candidate);
......
...@@ -18,7 +18,6 @@ class Version { ...@@ -18,7 +18,6 @@ class Version {
static int GetMinor() { return minor_; } static int GetMinor() { return minor_; }
static int GetBuild() { return build_; } static int GetBuild() { return build_; }
static int GetPatch() { return patch_; } static int GetPatch() { return patch_; }
static const char* GetEmbedder() { return embedder_; }
static bool IsCandidate() { return candidate_; } static bool IsCandidate() { return candidate_; }
static uint32_t Hash() { static uint32_t Hash() {
return static_cast<uint32_t>( return static_cast<uint32_t>(
...@@ -39,15 +38,13 @@ class Version { ...@@ -39,15 +38,13 @@ class Version {
static int minor_; static int minor_;
static int build_; static int build_;
static int patch_; static int patch_;
static const char* embedder_;
static bool candidate_; static bool candidate_;
static const char* soname_; static const char* soname_;
static const char* version_string_; static const char* version_string_;
// In test-version.cc. // In test-version.cc.
friend void SetVersion(int major, int minor, int build, int patch, friend void SetVersion(int major, int minor, int build, int patch,
const char* embedder, bool candidate, bool candidate, const char* soname);
const char* soname);
}; };
} // namespace internal } // namespace internal
......
...@@ -37,12 +37,11 @@ namespace v8 { ...@@ -37,12 +37,11 @@ namespace v8 {
namespace internal { namespace internal {
void SetVersion(int major, int minor, int build, int patch, void SetVersion(int major, int minor, int build, int patch,
const char* embedder, bool candidate, const char* soname) { bool candidate, const char* soname) {
Version::major_ = major; Version::major_ = major;
Version::minor_ = minor; Version::minor_ = minor;
Version::build_ = build; Version::build_ = build;
Version::patch_ = patch; Version::patch_ = patch;
Version::embedder_ = embedder;
Version::candidate_ = candidate; Version::candidate_ = candidate;
Version::soname_ = soname; Version::soname_ = soname;
} }
...@@ -50,14 +49,16 @@ void SetVersion(int major, int minor, int build, int patch, ...@@ -50,14 +49,16 @@ void SetVersion(int major, int minor, int build, int patch,
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
static void CheckVersion(int major, int minor, int build, int patch,
const char* embedder, bool candidate, static void CheckVersion(int major, int minor, int build,
int patch, bool candidate,
const char* expected_version_string, const char* expected_version_string,
const char* expected_generic_soname) { const char* expected_generic_soname) {
static v8::internal::EmbeddedVector<char, 128> version_str; static v8::internal::EmbeddedVector<char, 128> version_str;
static v8::internal::EmbeddedVector<char, 128> soname_str; static v8::internal::EmbeddedVector<char, 128> soname_str;
// Test version without specific SONAME. // Test version without specific SONAME.
SetVersion(major, minor, build, patch, embedder, candidate, ""); SetVersion(major, minor, build, patch, candidate, "");
Version::GetString(version_str); Version::GetString(version_str);
CHECK_EQ(0, strcmp(expected_version_string, version_str.start())); CHECK_EQ(0, strcmp(expected_version_string, version_str.start()));
Version::GetSONAME(soname_str); Version::GetSONAME(soname_str);
...@@ -65,7 +66,7 @@ static void CheckVersion(int major, int minor, int build, int patch, ...@@ -65,7 +66,7 @@ static void CheckVersion(int major, int minor, int build, int patch,
// Test version with specific SONAME. // Test version with specific SONAME.
const char* soname = "libv8.so.1"; const char* soname = "libv8.so.1";
SetVersion(major, minor, build, patch, embedder, candidate, soname); SetVersion(major, minor, build, patch, candidate, soname);
Version::GetString(version_str); Version::GetString(version_str);
CHECK_EQ(0, strcmp(expected_version_string, version_str.start())); CHECK_EQ(0, strcmp(expected_version_string, version_str.start()));
Version::GetSONAME(soname_str); Version::GetSONAME(soname_str);
...@@ -75,40 +76,30 @@ static void CheckVersion(int major, int minor, int build, int patch, ...@@ -75,40 +76,30 @@ static void CheckVersion(int major, int minor, int build, int patch,
TEST(VersionString) { TEST(VersionString) {
#ifdef USE_SIMULATOR #ifdef USE_SIMULATOR
CheckVersion(0, 0, 0, 0, "", false, "0.0.0 SIMULATOR", "libv8-0.0.0.so"); CheckVersion(0, 0, 0, 0, false, "0.0.0 SIMULATOR", "libv8-0.0.0.so");
CheckVersion(0, 0, 0, 0, "", true, "0.0.0 (candidate) SIMULATOR", CheckVersion(0, 0, 0, 0, true,
"libv8-0.0.0-candidate.so"); "0.0.0 (candidate) SIMULATOR", "libv8-0.0.0-candidate.so");
CheckVersion(1, 0, 0, 0, "", false, "1.0.0 SIMULATOR", "libv8-1.0.0.so"); CheckVersion(1, 0, 0, 0, false, "1.0.0 SIMULATOR", "libv8-1.0.0.so");
CheckVersion(1, 0, 0, 0, "", true, "1.0.0 (candidate) SIMULATOR", CheckVersion(1, 0, 0, 0, true,
"libv8-1.0.0-candidate.so"); "1.0.0 (candidate) SIMULATOR", "libv8-1.0.0-candidate.so");
CheckVersion(1, 0, 0, 1, "", false, "1.0.0.1 SIMULATOR", "libv8-1.0.0.1.so"); CheckVersion(1, 0, 0, 1, false, "1.0.0.1 SIMULATOR", "libv8-1.0.0.1.so");
CheckVersion(1, 0, 0, 1, "", true, "1.0.0.1 (candidate) SIMULATOR", CheckVersion(1, 0, 0, 1, true,
"libv8-1.0.0.1-candidate.so"); "1.0.0.1 (candidate) SIMULATOR", "libv8-1.0.0.1-candidate.so");
CheckVersion(2, 5, 10, 7, "", false, "2.5.10.7 SIMULATOR", CheckVersion(2, 5, 10, 7, false, "2.5.10.7 SIMULATOR", "libv8-2.5.10.7.so");
"libv8-2.5.10.7.so"); CheckVersion(2, 5, 10, 7, true,
CheckVersion(2, 5, 10, 7, "", true, "2.5.10.7 (candidate) SIMULATOR", "2.5.10.7 (candidate) SIMULATOR", "libv8-2.5.10.7-candidate.so");
"libv8-2.5.10.7-candidate.so");
CheckVersion(2, 5, 10, 7, ".emb.1", false, "2.5.10.7.emb.1 SIMULATOR",
"libv8-2.5.10.7.emb.1.so");
CheckVersion(2, 5, 10, 7, ".emb.1", true,
"2.5.10.7.emb.1 (candidate) SIMULATOR",
"libv8-2.5.10.7.emb.1-candidate.so");
#else #else
CheckVersion(0, 0, 0, 0, "", false, "0.0.0", "libv8-0.0.0.so"); CheckVersion(0, 0, 0, 0, false, "0.0.0", "libv8-0.0.0.so");
CheckVersion(0, 0, 0, 0, "", true, "0.0.0 (candidate)", CheckVersion(0, 0, 0, 0, true,
"libv8-0.0.0-candidate.so"); "0.0.0 (candidate)", "libv8-0.0.0-candidate.so");
CheckVersion(1, 0, 0, 0, "", false, "1.0.0", "libv8-1.0.0.so"); CheckVersion(1, 0, 0, 0, false, "1.0.0", "libv8-1.0.0.so");
CheckVersion(1, 0, 0, 0, "", true, "1.0.0 (candidate)", CheckVersion(1, 0, 0, 0, true,
"libv8-1.0.0-candidate.so"); "1.0.0 (candidate)", "libv8-1.0.0-candidate.so");
CheckVersion(1, 0, 0, 1, "", false, "1.0.0.1", "libv8-1.0.0.1.so"); CheckVersion(1, 0, 0, 1, false, "1.0.0.1", "libv8-1.0.0.1.so");
CheckVersion(1, 0, 0, 1, "", true, "1.0.0.1 (candidate)", CheckVersion(1, 0, 0, 1, true,
"libv8-1.0.0.1-candidate.so"); "1.0.0.1 (candidate)", "libv8-1.0.0.1-candidate.so");
CheckVersion(2, 5, 10, 7, "", false, "2.5.10.7", "libv8-2.5.10.7.so"); CheckVersion(2, 5, 10, 7, false, "2.5.10.7", "libv8-2.5.10.7.so");
CheckVersion(2, 5, 10, 7, "", true, "2.5.10.7 (candidate)", CheckVersion(2, 5, 10, 7, true,
"libv8-2.5.10.7-candidate.so"); "2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
CheckVersion(2, 5, 10, 7, ".emb.1", false, "2.5.10.7.emb.1",
"libv8-2.5.10.7.emb.1.so");
CheckVersion(2, 5, 10, 7, ".emb.1", true, "2.5.10.7.emb.1 (candidate)",
"libv8-2.5.10.7.emb.1-candidate.so");
#endif #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment