Skip to content

Commit f302638

Browse files
natorionCommit bot
authored andcommitted
Revert of [build] Introduce an embedder version string (patchset v8#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: nodejs/node#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}
1 parent 8bdcc77 commit f302638

7 files changed

Lines changed: 43 additions & 80 deletions

File tree

BUILD.gn

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ declare_args() {
2929
# Enable compiler warnings when using V8_DEPRECATED apis.
3030
v8_deprecation_warnings = false
3131

32-
# Allow the embedder to add a custom suffix to the version string.
33-
v8_embedder_string = ""
34-
3532
# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
3633
v8_imminent_deprecation_warnings = ""
3734

@@ -177,10 +174,6 @@ config("features") {
177174

178175
defines = []
179176

180-
if (v8_embedder_string != "") {
181-
defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
182-
}
183-
184177
if (v8_enable_disassembler) {
185178
defines += [ "ENABLE_DISASSEMBLER" ]
186179
}

gypfiles/features.gypi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
6565
'v8_imminent_deprecation_warnings%': 0,
6666

67-
# Allow the embedder to add a custom suffix to the version string.
68-
'v8_embedder_string%': '',
69-
7067
# Set to 1 to enable DCHECKs in release builds.
7168
'dcheck_always_on%': 0,
7269

@@ -108,9 +105,6 @@
108105
['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
109106
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
110107
}],
111-
['v8_embedder_string!=""', {
112-
'defines': ['V8_EMBEDDER_STRING="<(v8_embedder_string)"',],
113-
}],
114108
['dcheck_always_on!=0', {
115109
'defines': ['DEBUG',],
116110
}],

include/v8-version.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
#define V8_BUILD_NUMBER 0
1414
#define V8_PATCH_LEVEL 0
1515

16-
#ifndef V8_EMBEDDER_STRING
17-
#define V8_EMBEDDER_STRING ""
18-
#endif // V8_EMBEDDER_STRING
19-
2016
// Use 1 for candidates and 0 otherwise.
2117
// (Boolean macro values are not supported by all preprocessors.)
2218
#define V8_IS_CANDIDATE_VERSION 1

src/log-utils.cc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,9 @@ void Log::Initialize(const char* log_file_name) {
5555

5656
if (output_handle_ != nullptr) {
5757
Log::MessageBuilder msg(this);
58-
if (strlen(Version::GetEmbedder()) == 0) {
59-
msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
60-
Version::GetMinor(), Version::GetBuild(),
61-
Version::GetPatch(), Version::IsCandidate());
62-
} else {
63-
msg.Append("v8-version,%d,%d,%d,%d,%s,%d", Version::GetMajor(),
64-
Version::GetMinor(), Version::GetBuild(),
65-
Version::GetPatch(), Version::GetEmbedder(),
66-
Version::IsCandidate());
67-
}
58+
msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
59+
Version::GetMinor(), Version::GetBuild(), Version::GetPatch(),
60+
Version::IsCandidate());
6861
msg.WriteToLogFile();
6962
}
7063
}

src/version.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
#define S(x) SX(x)
2323

2424
#if V8_PATCH_LEVEL > 0
25-
#define VERSION_STRING \
26-
S(V8_MAJOR_VERSION) \
27-
"." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S(V8_PATCH_LEVEL) \
28-
V8_EMBEDDER_STRING CANDIDATE_STRING
25+
#define VERSION_STRING \
26+
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \
27+
V8_PATCH_LEVEL) CANDIDATE_STRING
2928
#else
3029
#define VERSION_STRING \
3130
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \
@@ -39,7 +38,6 @@ int Version::major_ = V8_MAJOR_VERSION;
3938
int Version::minor_ = V8_MINOR_VERSION;
4039
int Version::build_ = V8_BUILD_NUMBER;
4140
int Version::patch_ = V8_PATCH_LEVEL;
42-
const char* Version::embedder_ = V8_EMBEDDER_STRING;
4341
bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
4442
const char* Version::soname_ = SONAME;
4543
const char* Version::version_string_ = VERSION_STRING;
@@ -53,8 +51,9 @@ void Version::GetString(Vector<char> str) {
5351
const char* is_simulator = "";
5452
#endif // USE_SIMULATOR
5553
if (GetPatch() > 0) {
56-
SNPrintF(str, "%d.%d.%d.%d%s%s%s", GetMajor(), GetMinor(), GetBuild(),
57-
GetPatch(), GetEmbedder(), candidate, is_simulator);
54+
SNPrintF(str, "%d.%d.%d.%d%s%s",
55+
GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate,
56+
is_simulator);
5857
} else {
5958
SNPrintF(str, "%d.%d.%d%s%s",
6059
GetMajor(), GetMinor(), GetBuild(), candidate,
@@ -69,8 +68,8 @@ void Version::GetSONAME(Vector<char> str) {
6968
// Generate generic SONAME if no specific SONAME is defined.
7069
const char* candidate = IsCandidate() ? "-candidate" : "";
7170
if (GetPatch() > 0) {
72-
SNPrintF(str, "libv8-%d.%d.%d.%d%s%s.so", GetMajor(), GetMinor(),
73-
GetBuild(), GetPatch(), GetEmbedder(), candidate);
71+
SNPrintF(str, "libv8-%d.%d.%d.%d%s.so",
72+
GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
7473
} else {
7574
SNPrintF(str, "libv8-%d.%d.%d%s.so",
7675
GetMajor(), GetMinor(), GetBuild(), candidate);

src/version.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Version {
1818
static int GetMinor() { return minor_; }
1919
static int GetBuild() { return build_; }
2020
static int GetPatch() { return patch_; }
21-
static const char* GetEmbedder() { return embedder_; }
2221
static bool IsCandidate() { return candidate_; }
2322
static uint32_t Hash() {
2423
return static_cast<uint32_t>(
@@ -39,15 +38,13 @@ class Version {
3938
static int minor_;
4039
static int build_;
4140
static int patch_;
42-
static const char* embedder_;
4341
static bool candidate_;
4442
static const char* soname_;
4543
static const char* version_string_;
4644

4745
// In test-version.cc.
4846
friend void SetVersion(int major, int minor, int build, int patch,
49-
const char* embedder, bool candidate,
50-
const char* soname);
47+
bool candidate, const char* soname);
5148
};
5249

5350
} // namespace internal

test/cctest/test-version.cc

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,36 @@ namespace v8 {
3737
namespace internal {
3838

3939
void SetVersion(int major, int minor, int build, int patch,
40-
const char* embedder, bool candidate, const char* soname) {
40+
bool candidate, const char* soname) {
4141
Version::major_ = major;
4242
Version::minor_ = minor;
4343
Version::build_ = build;
4444
Version::patch_ = patch;
45-
Version::embedder_ = embedder;
4645
Version::candidate_ = candidate;
4746
Version::soname_ = soname;
4847
}
4948

5049
} // namespace internal
5150
} // namespace v8
5251

53-
static void CheckVersion(int major, int minor, int build, int patch,
54-
const char* embedder, bool candidate,
52+
53+
static void CheckVersion(int major, int minor, int build,
54+
int patch, bool candidate,
5555
const char* expected_version_string,
5656
const char* expected_generic_soname) {
5757
static v8::internal::EmbeddedVector<char, 128> version_str;
5858
static v8::internal::EmbeddedVector<char, 128> soname_str;
59+
5960
// Test version without specific SONAME.
60-
SetVersion(major, minor, build, patch, embedder, candidate, "");
61+
SetVersion(major, minor, build, patch, candidate, "");
6162
Version::GetString(version_str);
6263
CHECK_EQ(0, strcmp(expected_version_string, version_str.start()));
6364
Version::GetSONAME(soname_str);
6465
CHECK_EQ(0, strcmp(expected_generic_soname, soname_str.start()));
6566

6667
// Test version with specific SONAME.
6768
const char* soname = "libv8.so.1";
68-
SetVersion(major, minor, build, patch, embedder, candidate, soname);
69+
SetVersion(major, minor, build, patch, candidate, soname);
6970
Version::GetString(version_str);
7071
CHECK_EQ(0, strcmp(expected_version_string, version_str.start()));
7172
Version::GetSONAME(soname_str);
@@ -75,40 +76,30 @@ static void CheckVersion(int major, int minor, int build, int patch,
7576

7677
TEST(VersionString) {
7778
#ifdef USE_SIMULATOR
78-
CheckVersion(0, 0, 0, 0, "", false, "0.0.0 SIMULATOR", "libv8-0.0.0.so");
79-
CheckVersion(0, 0, 0, 0, "", true, "0.0.0 (candidate) SIMULATOR",
80-
"libv8-0.0.0-candidate.so");
81-
CheckVersion(1, 0, 0, 0, "", false, "1.0.0 SIMULATOR", "libv8-1.0.0.so");
82-
CheckVersion(1, 0, 0, 0, "", true, "1.0.0 (candidate) SIMULATOR",
83-
"libv8-1.0.0-candidate.so");
84-
CheckVersion(1, 0, 0, 1, "", false, "1.0.0.1 SIMULATOR", "libv8-1.0.0.1.so");
85-
CheckVersion(1, 0, 0, 1, "", true, "1.0.0.1 (candidate) SIMULATOR",
86-
"libv8-1.0.0.1-candidate.so");
87-
CheckVersion(2, 5, 10, 7, "", false, "2.5.10.7 SIMULATOR",
88-
"libv8-2.5.10.7.so");
89-
CheckVersion(2, 5, 10, 7, "", true, "2.5.10.7 (candidate) SIMULATOR",
90-
"libv8-2.5.10.7-candidate.so");
91-
CheckVersion(2, 5, 10, 7, ".emb.1", false, "2.5.10.7.emb.1 SIMULATOR",
92-
"libv8-2.5.10.7.emb.1.so");
93-
CheckVersion(2, 5, 10, 7, ".emb.1", true,
94-
"2.5.10.7.emb.1 (candidate) SIMULATOR",
95-
"libv8-2.5.10.7.emb.1-candidate.so");
79+
CheckVersion(0, 0, 0, 0, false, "0.0.0 SIMULATOR", "libv8-0.0.0.so");
80+
CheckVersion(0, 0, 0, 0, true,
81+
"0.0.0 (candidate) SIMULATOR", "libv8-0.0.0-candidate.so");
82+
CheckVersion(1, 0, 0, 0, false, "1.0.0 SIMULATOR", "libv8-1.0.0.so");
83+
CheckVersion(1, 0, 0, 0, true,
84+
"1.0.0 (candidate) SIMULATOR", "libv8-1.0.0-candidate.so");
85+
CheckVersion(1, 0, 0, 1, false, "1.0.0.1 SIMULATOR", "libv8-1.0.0.1.so");
86+
CheckVersion(1, 0, 0, 1, true,
87+
"1.0.0.1 (candidate) SIMULATOR", "libv8-1.0.0.1-candidate.so");
88+
CheckVersion(2, 5, 10, 7, false, "2.5.10.7 SIMULATOR", "libv8-2.5.10.7.so");
89+
CheckVersion(2, 5, 10, 7, true,
90+
"2.5.10.7 (candidate) SIMULATOR", "libv8-2.5.10.7-candidate.so");
9691
#else
97-
CheckVersion(0, 0, 0, 0, "", false, "0.0.0", "libv8-0.0.0.so");
98-
CheckVersion(0, 0, 0, 0, "", true, "0.0.0 (candidate)",
99-
"libv8-0.0.0-candidate.so");
100-
CheckVersion(1, 0, 0, 0, "", false, "1.0.0", "libv8-1.0.0.so");
101-
CheckVersion(1, 0, 0, 0, "", true, "1.0.0 (candidate)",
102-
"libv8-1.0.0-candidate.so");
103-
CheckVersion(1, 0, 0, 1, "", false, "1.0.0.1", "libv8-1.0.0.1.so");
104-
CheckVersion(1, 0, 0, 1, "", true, "1.0.0.1 (candidate)",
105-
"libv8-1.0.0.1-candidate.so");
106-
CheckVersion(2, 5, 10, 7, "", false, "2.5.10.7", "libv8-2.5.10.7.so");
107-
CheckVersion(2, 5, 10, 7, "", true, "2.5.10.7 (candidate)",
108-
"libv8-2.5.10.7-candidate.so");
109-
CheckVersion(2, 5, 10, 7, ".emb.1", false, "2.5.10.7.emb.1",
110-
"libv8-2.5.10.7.emb.1.so");
111-
CheckVersion(2, 5, 10, 7, ".emb.1", true, "2.5.10.7.emb.1 (candidate)",
112-
"libv8-2.5.10.7.emb.1-candidate.so");
92+
CheckVersion(0, 0, 0, 0, false, "0.0.0", "libv8-0.0.0.so");
93+
CheckVersion(0, 0, 0, 0, true,
94+
"0.0.0 (candidate)", "libv8-0.0.0-candidate.so");
95+
CheckVersion(1, 0, 0, 0, false, "1.0.0", "libv8-1.0.0.so");
96+
CheckVersion(1, 0, 0, 0, true,
97+
"1.0.0 (candidate)", "libv8-1.0.0-candidate.so");
98+
CheckVersion(1, 0, 0, 1, false, "1.0.0.1", "libv8-1.0.0.1.so");
99+
CheckVersion(1, 0, 0, 1, true,
100+
"1.0.0.1 (candidate)", "libv8-1.0.0.1-candidate.so");
101+
CheckVersion(2, 5, 10, 7, false, "2.5.10.7", "libv8-2.5.10.7.so");
102+
CheckVersion(2, 5, 10, 7, true,
103+
"2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
113104
#endif
114105
}

0 commit comments

Comments
 (0)