diff --git a/src/node.cc b/src/node.cc index 2b41e904180bed..10e04ed8a28bd0 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1441,13 +1441,16 @@ static ExitCode StartInternal(int argc, char** argv) { }); uv_loop_configure(uv_default_loop(), UV_METRICS_IDLE_TIME); - std::string sea_config = per_process::cli_options->experimental_sea_config; if (!sea_config.empty()) { +#if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) return sea::BuildSingleExecutableBlob( sea_config, result->args(), result->exec_args()); +#else + fprintf(stderr, "Single executable application is disabled.\n"); + return ExitCode::kGenericUserError; +#endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) } - // --build-snapshot indicates that we are in snapshot building mode. if (per_process::cli_options->per_isolate->build_snapshot) { if (per_process::cli_options->per_isolate->build_snapshot_config.empty() && diff --git a/src/node_sea.cc b/src/node_sea.cc index a254c910edf238..c2b409de731c6e 100644 --- a/src/node_sea.cc +++ b/src/node_sea.cc @@ -27,8 +27,6 @@ #include #include -#if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) - using node::ExitCode; using v8::ArrayBuffer; using v8::BackingStore; @@ -189,6 +187,7 @@ SeaResource SeaDeserializer::Read() { } std::string_view FindSingleExecutableBlob() { +#if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) CHECK(IsSingleExecutable()); static const std::string_view result = []() -> std::string_view { size_t size; @@ -209,6 +208,9 @@ std::string_view FindSingleExecutableBlob() { result.data(), result.size()); return result; +#else + UNREACHABLE(); +#endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) } } // anonymous namespace @@ -668,5 +670,3 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) { NODE_BINDING_CONTEXT_AWARE_INTERNAL(sea, node::sea::Initialize) NODE_BINDING_EXTERNAL_REFERENCE(sea, node::sea::RegisterExternalReferences) - -#endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) diff --git a/src/node_sea.h b/src/node_sea.h index bea9d579a2aa64..f90ef63cc7fd33 100644 --- a/src/node_sea.h +++ b/src/node_sea.h @@ -3,8 +3,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) - #include #include #include @@ -52,8 +50,6 @@ node::ExitCode BuildSingleExecutableBlob( } // namespace sea } // namespace node -#endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) - #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_NODE_SEA_H_