Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2022-03-24 16:37:08 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2022-03-31 14:29:12 +0300
commit37aee80643822c8c9ff35c906d034ecc8fc448d5 (patch)
tree65a9107f2ed3b7e4cdaf38936a1df65ccd25a587 /src/node.cc
parent8a297ba3a0aa39afb7c84fceee4accff609b7cfe (diff)
build: add --node-snapshot-main configure option
This adds a --build-snapshot runtime option which is currently only supported by the node_mksnapshot binary, and a --node-snapshot-main configure option that makes use it to run a custom script when building the embedded snapshot. The idea is to have this experimental feature in core as a configure-time feature for now, and investigate the renaming V8 bugs before we make it available to more users via making it a runtime option. PR-URL: https://github.com/nodejs/node/pull/42466 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index e503fd9f5b4..5ba03b75407 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -495,6 +495,10 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
return StartExecution(env, "internal/main/inspect");
}
+ if (per_process::cli_options->build_snapshot) {
+ return StartExecution(env, "internal/main/mksnapshot");
+ }
+
if (per_process::cli_options->print_help) {
return StartExecution(env, "internal/main/print_help");
}
@@ -1153,6 +1157,12 @@ int Start(int argc, char** argv) {
return result.exit_code;
}
+ if (per_process::cli_options->build_snapshot) {
+ fprintf(stderr,
+ "--build-snapshot is not yet supported in the node binary\n");
+ return 1;
+ }
+
{
bool use_node_snapshot =
per_process::cli_options->per_isolate->node_snapshot;