GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: remove cached data tag from snapshot metadata · nodejs/node@eef3030

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • env.cc
    • env.h
    • node_snapshotable.cc
  • test/parallel
    • parallel.status
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ std::ostream& operator<<(std::ostream& output, const SnapshotMetadata& i) {
320320
<< " \"" << i.node_version << "\", // node_version\n"
321321
<< " \"" << i.node_arch << "\", // node_arch\n"
322322
<< " \"" << i.node_platform << "\", // node_platform\n"
323-
<< " " << i.v8_cache_version_tag << ", // v8_cache_version_tag\n"
324323
<< " " << i.flags << ", // flags\n"
325324
<< "}";
326325
return output;
Collapse file

‎src/env.h‎

Copy file name to clipboardExpand all lines: src/env.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,6 @@ struct SnapshotMetadata {
549549
std::string node_version;
550550
std::string node_arch;
551551
std::string node_platform;
552-
// Result of v8::ScriptCompiler::CachedDataVersionTag().
553-
uint32_t v8_cache_version_tag;
554552
SnapshotFlags flags;
555553
};
556554

Collapse file

‎src/node_snapshotable.cc‎

Copy file name to clipboardExpand all lines: src/node_snapshotable.cc
-23Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ using v8::Isolate;
4343
using v8::Local;
4444
using v8::Object;
4545
using v8::ObjectTemplate;
46-
using v8::ScriptCompiler;
4746
using v8::SnapshotCreator;
4847
using v8::StartupData;
4948
using v8::String;
@@ -542,7 +541,6 @@ SnapshotMetadata SnapshotDeserializer::Read() {
542541
result.node_version = ReadString();
543542
result.node_arch = ReadString();
544543
result.node_platform = ReadString();
545-
result.v8_cache_version_tag = ReadArithmetic<uint32_t>();
546544
result.flags = static_cast<SnapshotFlags>(ReadArithmetic<uint32_t>());
547545

548546
if (is_debug) {
@@ -570,9 +568,6 @@ size_t SnapshotSerializer::Write(const SnapshotMetadata& data) {
570568
written_total += WriteString(data.node_arch);
571569
Debug("Write Node.js platform %s\n", data.node_platform);
572570
written_total += WriteString(data.node_platform);
573-
Debug("Write V8 cached data version tag %" PRIx32 "\n",
574-
data.v8_cache_version_tag);
575-
written_total += WriteArithmetic<uint32_t>(data.v8_cache_version_tag);
576571
Debug("Write snapshot flags %" PRIx32 "\n",
577572
static_cast<uint32_t>(data.flags));
578573
written_total += WriteArithmetic<uint32_t>(static_cast<uint32_t>(data.flags));
@@ -697,23 +692,6 @@ bool SnapshotData::Check() const {
697692
return false;
698693
}
699694

700-
if (metadata.type == SnapshotMetadata::Type::kFullyCustomized &&
701-
!WithoutCodeCache(metadata.flags)) {
702-
uint32_t current_cache_version = v8::ScriptCompiler::CachedDataVersionTag();
703-
if (metadata.v8_cache_version_tag != current_cache_version) {
704-
// For now we only do this check for the customized snapshots - we know
705-
// that the flags we use in the default snapshot are limited and safe
706-
// enough so we can relax the constraints for it.
707-
fprintf(stderr,
708-
"Failed to load the startup snapshot because it was built with "
709-
"a different version of V8 or with different V8 configurations.\n"
710-
"Expected tag %" PRIx32 ", read %" PRIx32 "\n",
711-
current_cache_version,
712-
metadata.v8_cache_version_tag);
713-
return false;
714-
}
715-
}
716-
717695
// TODO(joyeecheung): check incompatible Node.js flags.
718696
return true;
719697
}
@@ -1180,7 +1158,6 @@ ExitCode SnapshotBuilder::CreateSnapshot(SnapshotData* out,
11801158
per_process::metadata.versions.node,
11811159
per_process::metadata.arch,
11821160
per_process::metadata.platform,
1183-
v8::ScriptCompiler::CachedDataVersionTag(),
11841161
config->flags};
11851162

11861163
// We cannot resurrect the handles from the snapshot, so make sure that
Collapse file

‎test/parallel/parallel.status‎

Copy file name to clipboardExpand all lines: test/parallel/parallel.status
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ test-fs-read-stream-concurrent-reads: PASS, FLAKY
1919
# https://github.com/nodejs/node/issues/52630
2020
test-error-serdes: PASS, FLAKY
2121

22+
# Until V8 provides a better way to check for flag mismatch without
23+
# making the code cache/snapshot unreproducible, disable the test
24+
# for a preemptive check now. It should idealy fail more gracefully
25+
# with a better checking mechanism.
26+
# https://github.com/nodejs/build/issues/3043
27+
test-snapshot-incompatible: SKIP
28+
2229
[$system==win32]
2330

2431
# Windows on x86

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.