зеркало из https://github.com/electron/electron.git
chore: bump node to v12.13.1 (master) (#21198)
* chore: bump node in DEPS to v12.13.1 * chore: remove redundant patches * disable node tests disable prepareStackTrack test since Node.js won't handle our case, and disable new es-module tests since it's still flagged and requires flags to run properly * fix missing files Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: don't error if can't find advapi32.dll * fixup! chore: bump node in DEPS to v12.13.1 * Disable native tests for now
This commit is contained in:
Родитель
96a88f02fb
Коммит
8ffc58bdba
2
DEPS
2
DEPS
|
@ -13,7 +13,7 @@ vars = {
|
|||
'chromium_version':
|
||||
'd0c764fc71894cc24d3bb17a7406ba6c6cc6dc29',
|
||||
'node_version':
|
||||
'v12.13.0',
|
||||
'v12.13.1',
|
||||
'nan_version':
|
||||
'2ee313aaca52e2b478965ac50eb5082520380d1b',
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ fixme_remove_async_id_assertion_check.patch
|
|||
fixme_comment_trace_event_macro.patch
|
||||
fix_key_gen_apis_are_not_available_in_boringssl.patch
|
||||
fix_do_not_define_debugoptions_s_constructors_in_header.patch
|
||||
src_disable_node_use_v8_platform_in_node_options.patch
|
||||
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
|
||||
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
|
||||
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
|
||||
|
@ -27,14 +26,7 @@ inherit_electron_crashpad_pipe_name_in_child_process.patch
|
|||
chore_read_nobrowserglobals_from_global_not_process.patch
|
||||
chore_split_createenvironment_into_createenvironment_and.patch
|
||||
chore_handle_default_configuration_not_being_set_in_the_electron_env.patch
|
||||
fsevents-stop-using-fsevents-to-watch-files.patch
|
||||
fsevents-regression-in-watching.patch
|
||||
build_bring_back_node_with_ltcg_configuration.patch
|
||||
revert_tls_add_option_to_override_signature_algorithms.patch
|
||||
revert_crypto_add_oaeplabel_option.patch
|
||||
fix_windows_compilation_on_libuv_setsockopt.patch
|
||||
fix_don_t_use_node-controlled_preparestacktrace.patch
|
||||
fix_remove_uses_of_node_use_v8_platform.patch
|
||||
fix_call_initializecontextruntime_in_initializecontext.patch
|
||||
refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
|
||||
enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
|
||||
|
|
|
@ -886,7 +886,7 @@ new file mode 100644
|
|||
index 0000000000000000000000000000000000000000..5eb839f45aca3ed73d69b43a34c438ce254a2c6b
|
||||
--- /dev/null
|
||||
+++ b/filenames.json
|
||||
@@ -0,0 +1,446 @@
|
||||
@@ -0,0 +1,448 @@
|
||||
+// This file is automatically generated by generate_gn_filenames_json.py
|
||||
+// DO NOT EDIT
|
||||
+{
|
||||
|
@ -1106,6 +1106,7 @@ index 0000000000000000000000000000000000000000..5eb839f45aca3ed73d69b43a34c438ce
|
|||
+ "lib/internal/repl/history.js",
|
||||
+ "lib/internal/repl/utils.js",
|
||||
+ "lib/internal/socket_list.js",
|
||||
+ "lib/internal/source_map/prepare_stack_trace.js",
|
||||
+ "lib/internal/source_map/source_map.js",
|
||||
+ "lib/internal/source_map/source_map_cache.js",
|
||||
+ "lib/internal/test/binding.js",
|
||||
|
@ -1139,6 +1140,7 @@ index 0000000000000000000000000000000000000000..5eb839f45aca3ed73d69b43a34c438ce
|
|||
+ "lib/internal/streams/state.js",
|
||||
+ "lib/internal/streams/pipeline.js",
|
||||
+ "lib/internal/streams/end-of-stream.js",
|
||||
+ "lib/internal/streams/from.js",
|
||||
+ "deps/v8/tools/splaytree.js",
|
||||
+ "deps/v8/tools/codemap.js",
|
||||
+ "deps/v8/tools/consarray.js",
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 22 Oct 2019 11:00:01 -0700
|
||||
Subject: fix: call InitializeContextRuntime in InitializeContext
|
||||
|
||||
Since https://github.com/nodejs/node/commit/1ec4154e507ba71d7aefca0a6e5c155be34e989a,
|
||||
we observed a crash in renderer process initialization becuase we don't
|
||||
directly call NewContext, and so InitializeContext would not create primordials
|
||||
correctly and the following error would occur:
|
||||
|
||||
node::Environment::CreateProperties(): Assertion `primordials->IsObject()' failed.
|
||||
|
||||
This fixes that. See https://github.com/electron/electron/pull/20684.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 50886f4a998f1e7f346a6b7fad91ce49c3a7cdff..6ec07527ad7a806f889d884507e9def1cf68b4c8 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -371,8 +371,6 @@ Local<Context> NewContext(Isolate* isolate,
|
||||
return Local<Context>();
|
||||
}
|
||||
|
||||
- InitializeContextRuntime(context);
|
||||
-
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -457,6 +455,11 @@ bool InitializeContext(Local<Context> context) {
|
||||
}
|
||||
}
|
||||
|
||||
+ // This must be called here because embedders don't necessarily run
|
||||
+ // NewContext, so when InitializeContext is called this might never
|
||||
+ // otherwise be called
|
||||
+ InitializeContextRuntime(context);
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ index c0c15a88c028d9c70081aa75fabf63d1d78014e6..03919d450b3373983d647165ee93c006
|
|||
+DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
|
||||
+
|
||||
void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
|
||||
#if !NODE_USE_V8_PLATFORM
|
||||
#if !NODE_USE_V8_PLATFORM && !HAVE_INSPECTOR
|
||||
if (inspector_enabled) {
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 40c19ea6ff4d98a1a1da59bca76087209445af81..4ce5551284bb5b1b4194905a9fe619f852933405 100644
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 17 Oct 2019 15:15:12 -0700
|
||||
Subject: fix: don't use node-controlled prepareStackTrace
|
||||
|
||||
At the moment, Electron uses the v8 version of Error.prepareStackTrace as
|
||||
defined in v7.9.74 (where https://crbug.com/v8/7848 has been fixed) and
|
||||
not the one polyfilled by Node.js. As a result, we were experiencing failures
|
||||
in parallel/test-buffer-constructor-outside-node-modules.js because
|
||||
the polyfilled prepareStackTrace was not being run and thus code
|
||||
inside that function would never be executed.
|
||||
|
||||
Upstreamed at https://github.com/nodejs/node/pull/30014.
|
||||
|
||||
diff --git a/lib/internal/util.js b/lib/internal/util.js
|
||||
index 58502f3b7a7a937c896ff6d32a90a45c6912e3b3..e91362cc3a8a6c5d2462a017f177bebfd607a850 100644
|
||||
--- a/lib/internal/util.js
|
||||
+++ b/lib/internal/util.js
|
||||
@@ -340,10 +340,10 @@ function isInsideNodeModules() {
|
||||
// the perf implications should be okay.
|
||||
getStructuredStack = runInNewContext(`(function() {
|
||||
Error.stackTraceLimit = Infinity;
|
||||
+ Error.prepareStackTrace = (err, trace) => trace;
|
||||
+
|
||||
return function structuredStack() {
|
||||
- const e = new Error();
|
||||
- overrideStackTrace.set(e, (err, trace) => trace);
|
||||
- return e.stack;
|
||||
+ return new Error().stack;
|
||||
};
|
||||
})()`, { overrideStackTrace }, { filename: 'structured-stack' });
|
||||
}
|
|
@ -1,131 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 11:20:16 -0700
|
||||
Subject: fix: remove uses of NODE_USE_V8_PLATFORM
|
||||
|
||||
Electron makes use of HAVE_INSPECTOR but does not run with
|
||||
NODE_USE_V8_PLATFORM so this prevented some Inspector code from
|
||||
running properly on our end; specifically, this caused a crash in
|
||||
test/parallel/test-inspector-connect-main-thread.js.
|
||||
|
||||
Upstreamed at https://github.com/nodejs/node/pull/30029.
|
||||
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 1df2907fe0bc8a4a2bee3c569bfa535465d9f289..084833e467fb815adbd7ee39c2cfd2e79ba96f62 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -869,7 +869,7 @@ class Environment : public MemoryRetainer {
|
||||
void CreateProperties();
|
||||
// Should be called before InitializeInspector()
|
||||
void InitializeDiagnostics();
|
||||
-#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
|
||||
+#if HAVE_INSPECTOR
|
||||
// If the environment is created for a worker, pass parent_handle and
|
||||
// the ownership if transferred into the Environment.
|
||||
int InitializeInspector(inspector::ParentInspectorHandle* parent_handle);
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 9b43d7676e5e106318b58bfe443651cc49780068..461f736beacec67b35c89a42319f99178a1e38e9 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -224,7 +224,7 @@ MaybeLocal<Value> ExecuteBootstrapper(Environment* env,
|
||||
return scope.EscapeMaybe(result);
|
||||
}
|
||||
|
||||
-#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
|
||||
+#if HAVE_INSPECTOR
|
||||
int Environment::InitializeInspector(
|
||||
inspector::ParentInspectorHandle* parent_handle) {
|
||||
std::string inspector_path;
|
||||
@@ -258,7 +258,7 @@ int Environment::InitializeInspector(
|
||||
|
||||
return 0;
|
||||
}
|
||||
-#endif // HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
|
||||
+#endif // HAVE_INSPECTOR
|
||||
|
||||
void Environment::InitializeDiagnostics() {
|
||||
isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
|
||||
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc
|
||||
index e41e0c1fb6fe1f2ca8a8ebef8834a53d1875ac15..be53b585f0a106c6fd5675e805284291d295f205 100644
|
||||
--- a/src/node_main_instance.cc
|
||||
+++ b/src/node_main_instance.cc
|
||||
@@ -204,7 +204,7 @@ std::unique_ptr<Environment> NodeMainInstance::CreateMainEnvironment(
|
||||
|
||||
// TODO(joyeecheung): when we snapshot the bootstrapped context,
|
||||
// the inspector and diagnostics setup should after after deserialization.
|
||||
-#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
|
||||
+#if HAVE_INSPECTOR
|
||||
*exit_code = env->InitializeInspector(nullptr);
|
||||
#endif
|
||||
if (*exit_code != 0) {
|
||||
diff --git a/src/node_worker.cc b/src/node_worker.cc
|
||||
index 3dce5e25980ce2c6f17cda02dab9c0f8b4fab813..c8b2e1699f26ac9bfeb373653d35271f9b6c841f 100644
|
||||
--- a/src/node_worker.cc
|
||||
+++ b/src/node_worker.cc
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "util-inl.h"
|
||||
#include "async_wrap-inl.h"
|
||||
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
#include "inspector/worker_inspector.h" // ParentInspectorHandle
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace worker {
|
||||
|
||||
namespace {
|
||||
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
void WaitForWorkerInspectorToStop(Environment* child) {
|
||||
child->inspector_agent()->WaitForDisconnect();
|
||||
child->inspector_agent()->Stop();
|
||||
@@ -84,7 +84,7 @@ Worker::Worker(Environment* env,
|
||||
Number::New(env->isolate(), static_cast<double>(thread_id_)))
|
||||
.Check();
|
||||
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
inspector_parent_handle_ =
|
||||
env->inspector_agent()->GetParentHandle(thread_id_, url);
|
||||
#endif
|
||||
@@ -195,7 +195,7 @@ void Worker::Run() {
|
||||
Locker locker(isolate_);
|
||||
Isolate::Scope isolate_scope(isolate_);
|
||||
SealHandleScope outer_seal(isolate_);
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
bool inspector_started = false;
|
||||
#endif
|
||||
|
||||
@@ -227,7 +227,7 @@ void Worker::Run() {
|
||||
env_->stop_sub_worker_contexts();
|
||||
env_->RunCleanup();
|
||||
RunAtExit(env_.get());
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
if (inspector_started)
|
||||
WaitForWorkerInspectorToStop(env_.get());
|
||||
#endif
|
||||
@@ -272,7 +272,7 @@ void Worker::Run() {
|
||||
if (is_stopped()) return;
|
||||
{
|
||||
env_->InitializeDiagnostics();
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
env_->InitializeInspector(inspector_parent_handle_.release());
|
||||
inspector_started = true;
|
||||
#endif
|
||||
diff --git a/src/node_worker.h b/src/node_worker.h
|
||||
index ffc4f19882cc2629252c504119649f17dd8dbaff..77f68801e7c24731c63c8cfaf00dcd422b837f29 100644
|
||||
--- a/src/node_worker.h
|
||||
+++ b/src/node_worker.h
|
||||
@@ -65,7 +65,7 @@ class Worker : public AsyncWrap {
|
||||
bool start_profiler_idle_notifier_;
|
||||
uv_thread_t tid_;
|
||||
|
||||
-#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
|
||||
+#if HAVE_INSPECTOR
|
||||
std::unique_ptr<inspector::ParentInspectorHandle> inspector_parent_handle_;
|
||||
#endif
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Wed, 16 Oct 2019 09:07:57 -0700
|
||||
Subject: fix: windows compilation on libuv setsockopt
|
||||
|
||||
Upstreamed in https://github.com/libuv/libuv/pull/2520.
|
||||
This patch should be removed when Node.js rolls onto libuv v1.33.0.
|
||||
|
||||
diff --git a/deps/uv/src/win/tcp.c b/deps/uv/src/win/tcp.c
|
||||
index 81e48136a3b9ef13b1b95d87a68ab3ba98f9aeb9..fd34c623d8c543a01b70a17184b09bb4e29081eb 100644
|
||||
--- a/deps/uv/src/win/tcp.c
|
||||
+++ b/deps/uv/src/win/tcp.c
|
||||
@@ -556,7 +556,7 @@ int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb) {
|
||||
if (handle->flags & UV_HANDLE_SHUTTING)
|
||||
return UV_EINVAL;
|
||||
|
||||
- if (0 != setsockopt(handle->socket, SOL_SOCKET, SO_LINGER, &l, sizeof(l)))
|
||||
+ if (0 != setsockopt(handle->socket, SOL_SOCKET, SO_LINGER, (const char*)&l, sizeof(l)))
|
||||
return uv_translate_sys_error(WSAGetLastError());
|
||||
|
||||
uv_close((uv_handle_t*) handle, close_cb);
|
|
@ -1,161 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jameson Nash <vtjnash@gmail.com>
|
||||
Date: Sat, 7 Sep 2019 20:45:39 -0400
|
||||
Subject: fsevents: regression in watching /
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This case got lost by accident in
|
||||
https://github.com/libuv/libuv/pull/2082,
|
||||
preventing the realpath `/` from ever matching.
|
||||
|
||||
Fixes: https://github.com/nodejs/node/issues/28917
|
||||
PR-URL: https://github.com/libuv/libuv/pull/2460
|
||||
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
|
||||
|
||||
diff --git a/deps/uv/src/unix/fsevents.c b/deps/uv/src/unix/fsevents.c
|
||||
index ddacda31fef87eee131fc2ee2ff46cc88be429d9..deeaa63d4730de9aa17ee87923acd96d6507a55d 100644
|
||||
--- a/deps/uv/src/unix/fsevents.c
|
||||
+++ b/deps/uv/src/unix/fsevents.c
|
||||
@@ -263,10 +263,12 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
|
||||
if (len < handle->realpath_len)
|
||||
continue;
|
||||
|
||||
+ /* Make sure that realpath actually named a directory,
|
||||
+ * (unless watching root, which alone keeps a trailing slash on the realpath)
|
||||
+ * or that we matched the whole string */
|
||||
if (handle->realpath_len != len &&
|
||||
+ handle->realpath_len > 1 &&
|
||||
path[handle->realpath_len] != '/')
|
||||
- /* Make sure that realpath actually named a directory,
|
||||
- * or that we matched the whole string */
|
||||
continue;
|
||||
|
||||
if (memcmp(path, handle->realpath, handle->realpath_len) != 0)
|
||||
diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c
|
||||
index 4b8bb1ef03e54407cba8eef85179039632cc3f28..7725c3af94edd5d62bb960912262d38aefa6676e 100644
|
||||
--- a/deps/uv/test/test-fs-event.c
|
||||
+++ b/deps/uv/test/test-fs-event.c
|
||||
@@ -47,6 +47,7 @@ static const char file_prefix[] = "fsevent-";
|
||||
static const int fs_event_file_count = 16;
|
||||
#if defined(__APPLE__) || defined(_WIN32)
|
||||
static const char file_prefix_in_subdir[] = "subdir";
|
||||
+static int fs_multievent_cb_called;
|
||||
#endif
|
||||
static uv_timer_t timer;
|
||||
static int timer_cb_called;
|
||||
@@ -280,7 +281,7 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle,
|
||||
if (filename && strcmp(filename, file_prefix_in_subdir) == 0)
|
||||
return;
|
||||
#endif
|
||||
- fs_event_cb_called++;
|
||||
+ fs_multievent_cb_called++;
|
||||
ASSERT(handle == &fs_event);
|
||||
ASSERT(status == 0);
|
||||
ASSERT(events == UV_CHANGE || events == UV_RENAME);
|
||||
@@ -298,7 +299,7 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle,
|
||||
if (fs_event_created + fs_event_removed == fs_event_file_count) {
|
||||
/* Once we've processed all create events, delete all files */
|
||||
ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files_in_subdir, 1, 0));
|
||||
- } else if (fs_event_cb_called == 2 * fs_event_file_count) {
|
||||
+ } else if (fs_multievent_cb_called == 2 * fs_event_file_count) {
|
||||
/* Once we've processed all create and delete events, stop watching */
|
||||
uv_close((uv_handle_t*) &timer, close_cb);
|
||||
uv_close((uv_handle_t*) handle, close_cb);
|
||||
@@ -393,6 +394,21 @@ static void timer_cb_watch_twice(uv_timer_t* handle) {
|
||||
uv_close((uv_handle_t*) handle, NULL);
|
||||
}
|
||||
|
||||
+static void fs_event_cb_close(uv_fs_event_t* handle,
|
||||
+ const char* filename,
|
||||
+ int events,
|
||||
+ int status) {
|
||||
+ ASSERT(status == 0);
|
||||
+
|
||||
+ ASSERT(fs_event_cb_called < 3);
|
||||
+ ++fs_event_cb_called;
|
||||
+
|
||||
+ if (fs_event_cb_called == 3) {
|
||||
+ uv_close((uv_handle_t*) handle, close_cb);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
TEST_IMPL(fs_event_watch_dir) {
|
||||
#if defined(NO_FS_EVENTS)
|
||||
RETURN_SKIP(NO_FS_EVENTS);
|
||||
@@ -434,10 +450,12 @@ TEST_IMPL(fs_event_watch_dir) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
TEST_IMPL(fs_event_watch_dir_recursive) {
|
||||
#if defined(__APPLE__) || defined(_WIN32)
|
||||
uv_loop_t* loop;
|
||||
int r;
|
||||
+ uv_fs_event_t fs_event_root;
|
||||
|
||||
/* Setup */
|
||||
loop = uv_default_loop();
|
||||
@@ -451,17 +469,37 @@ TEST_IMPL(fs_event_watch_dir_recursive) {
|
||||
|
||||
r = uv_fs_event_init(loop, &fs_event);
|
||||
ASSERT(r == 0);
|
||||
- r = uv_fs_event_start(&fs_event, fs_event_cb_dir_multi_file_in_subdir, "watch_dir", UV_FS_EVENT_RECURSIVE);
|
||||
+ r = uv_fs_event_start(&fs_event,
|
||||
+ fs_event_cb_dir_multi_file_in_subdir,
|
||||
+ "watch_dir",
|
||||
+ UV_FS_EVENT_RECURSIVE);
|
||||
ASSERT(r == 0);
|
||||
r = uv_timer_init(loop, &timer);
|
||||
ASSERT(r == 0);
|
||||
r = uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0);
|
||||
ASSERT(r == 0);
|
||||
|
||||
+#ifndef _WIN32
|
||||
+ /* Also try to watch the root directory.
|
||||
+ * This will be noisier, so we're just checking for any couple events to happen. */
|
||||
+ r = uv_fs_event_init(loop, &fs_event_root);
|
||||
+ ASSERT(r == 0);
|
||||
+ r = uv_fs_event_start(&fs_event_root,
|
||||
+ fs_event_cb_close,
|
||||
+ "/",
|
||||
+ UV_FS_EVENT_RECURSIVE);
|
||||
+ ASSERT(r == 0);
|
||||
+#else
|
||||
+ fs_event_cb_called += 3;
|
||||
+ close_cb_called += 1;
|
||||
+ (void)fs_event_root;
|
||||
+#endif
|
||||
+
|
||||
uv_run(loop, UV_RUN_DEFAULT);
|
||||
|
||||
- ASSERT(fs_event_cb_called == fs_event_created + fs_event_removed);
|
||||
- ASSERT(close_cb_called == 2);
|
||||
+ ASSERT(fs_multievent_cb_called == fs_event_created + fs_event_removed);
|
||||
+ ASSERT(fs_event_cb_called == 3);
|
||||
+ ASSERT(close_cb_called == 3);
|
||||
|
||||
/* Cleanup */
|
||||
fs_event_unlink_files_in_subdir(NULL);
|
||||
@@ -870,18 +908,6 @@ TEST_IMPL(fs_event_close_with_pending_event) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void fs_event_cb_close(uv_fs_event_t* handle, const char* filename,
|
||||
- int events, int status) {
|
||||
- ASSERT(status == 0);
|
||||
-
|
||||
- ASSERT(fs_event_cb_called < 3);
|
||||
- ++fs_event_cb_called;
|
||||
-
|
||||
- if (fs_event_cb_called == 3) {
|
||||
- uv_close((uv_handle_t*) handle, close_cb);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
TEST_IMPL(fs_event_close_in_callback) {
|
||||
#if defined(NO_FS_EVENTS)
|
||||
RETURN_SKIP(NO_FS_EVENTS);
|
|
@ -1,123 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jameson Nash <vtjnash@gmail.com>
|
||||
Date: Sat, 7 Sep 2019 14:55:40 -0400
|
||||
Subject: fsevents: stop using fsevents to watch files
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Goes back to just using it to watch folders,
|
||||
but keeps the other logic changes around.
|
||||
|
||||
Refs: https://github.com/libuv/libuv/pull/387
|
||||
Refs: https://github.com/libuv/libuv/pull/2082
|
||||
Refs: https://github.com/libuv/libuv/pull/1572
|
||||
Refs: https://github.com/nodejs/node/issues/29460
|
||||
Fixes: https://github.com/libuv/libuv/issues/2488
|
||||
Closes: https://github.com/libuv/libuv/pull/2452
|
||||
PR-URL: https://github.com/libuv/libuv/pull/2459
|
||||
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
|
||||
|
||||
diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c
|
||||
index c04e7a485cf992beec501144e04ff068c17b9494..ad09f4031318cafe08faed3f0a6373e2bb598672 100644
|
||||
--- a/deps/uv/src/unix/kqueue.c
|
||||
+++ b/deps/uv/src/unix/kqueue.c
|
||||
@@ -454,10 +454,26 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
||||
const char* path,
|
||||
unsigned int flags) {
|
||||
int fd;
|
||||
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
+ struct stat statbuf;
|
||||
+#endif
|
||||
|
||||
if (uv__is_active(handle))
|
||||
return UV_EINVAL;
|
||||
|
||||
+ handle->cb = cb;
|
||||
+ handle->path = uv__strdup(path);
|
||||
+ if (handle->path == NULL)
|
||||
+ return UV_ENOMEM;
|
||||
+
|
||||
+ /* TODO open asynchronously - but how do we report back errors? */
|
||||
+ fd = open(handle->path, O_RDONLY);
|
||||
+ if (fd == -1) {
|
||||
+ uv__free(handle->path);
|
||||
+ handle->path = NULL;
|
||||
+ return UV__ERR(errno);
|
||||
+ }
|
||||
+
|
||||
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
/* Nullify field to perform checks later */
|
||||
handle->cf_cb = NULL;
|
||||
@@ -465,14 +481,17 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
||||
handle->realpath_len = 0;
|
||||
handle->cf_flags = flags;
|
||||
|
||||
+ if (fstat(fd, &statbuf))
|
||||
+ goto fallback;
|
||||
+ /* FSEvents works only with directories */
|
||||
+ if (!(statbuf.st_mode & S_IFDIR))
|
||||
+ goto fallback;
|
||||
+
|
||||
if (!uv__has_forked_with_cfrunloop) {
|
||||
int r;
|
||||
- /* The fallback fd is not used */
|
||||
+ /* The fallback fd is no longer needed */
|
||||
+ uv__close_nocheckstdio(fd);
|
||||
handle->event_watcher.fd = -1;
|
||||
- handle->path = uv__strdup(path);
|
||||
- if (handle->path == NULL)
|
||||
- return UV_ENOMEM;
|
||||
- handle->cb = cb;
|
||||
r = uv__fsevents_init(handle);
|
||||
if (r == 0) {
|
||||
uv__handle_start(handle);
|
||||
@@ -482,20 +501,9 @@ int uv_fs_event_start(uv_fs_event_t* handle,
|
||||
}
|
||||
return r;
|
||||
}
|
||||
+fallback:
|
||||
#endif /* #if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */
|
||||
|
||||
- /* TODO open asynchronously - but how do we report back errors? */
|
||||
- fd = open(path, O_RDONLY);
|
||||
- if (fd == -1)
|
||||
- return UV__ERR(errno);
|
||||
-
|
||||
- handle->path = uv__strdup(path);
|
||||
- if (handle->path == NULL) {
|
||||
- uv__close_nocheckstdio(fd);
|
||||
- return UV_ENOMEM;
|
||||
- }
|
||||
-
|
||||
- handle->cb = cb;
|
||||
uv__handle_start(handle);
|
||||
uv__io_init(&handle->event_watcher, uv__fs_event, fd);
|
||||
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
|
||||
@@ -514,7 +522,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) {
|
||||
uv__handle_stop(handle);
|
||||
|
||||
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
- if (!uv__has_forked_with_cfrunloop)
|
||||
+ if (!uv__has_forked_with_cfrunloop && handle->cf_cb != NULL)
|
||||
r = uv__fsevents_close(handle);
|
||||
#endif
|
||||
|
||||
diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c
|
||||
index ea34bd63a70625c3e2c60d5a1bbb087c5f0bbb2e..4b8bb1ef03e54407cba8eef85179039632cc3f28 100644
|
||||
--- a/deps/uv/test/test-fs-event.c
|
||||
+++ b/deps/uv/test/test-fs-event.c
|
||||
@@ -656,6 +656,12 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
|
||||
/* Setup */
|
||||
remove("watch_file");
|
||||
create_file("watch_file");
|
||||
+#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_12)
|
||||
+ /* Empirically, kevent seems to (sometimes) report the preceeding
|
||||
+ * create_file events prior to macOS 10.11.6 in the subsequent fs_event_start
|
||||
+ * So let the system settle before running the test. */
|
||||
+ uv_sleep(1100);
|
||||
+#endif
|
||||
|
||||
r = uv_fs_event_init(loop, &fs_event);
|
||||
ASSERT(r == 0);
|
|
@ -1,162 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 15 Oct 2019 11:21:13 -0700
|
||||
Subject: Revert "tls: add option to override signature algorithms"
|
||||
|
||||
This partially reverts commit 6272f82c07e913a76a316a786c9aadbc09f953ff.
|
||||
Upstreamed at https://boringssl-review.googlesource.com/c/boringssl/+/38404
|
||||
and can be removed when that is merged and rolled into Chromium.
|
||||
|
||||
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
||||
index 2c702d2f051d6b8f59ac53a4e2729ee02ba98a47..d7eff663a5d7465d33f53930868edca6cb89bf49 100644
|
||||
--- a/src/node_crypto.cc
|
||||
+++ b/src/node_crypto.cc
|
||||
@@ -470,7 +470,6 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) {
|
||||
env->SetProtoMethod(t, "addRootCerts", AddRootCerts);
|
||||
env->SetProtoMethod(t, "setCipherSuites", SetCipherSuites);
|
||||
env->SetProtoMethod(t, "setCiphers", SetCiphers);
|
||||
- env->SetProtoMethod(t, "setSigalgs", SetSigalgs);
|
||||
env->SetProtoMethod(t, "setECDHCurve", SetECDHCurve);
|
||||
env->SetProtoMethod(t, "setDHParam", SetDHParam);
|
||||
env->SetProtoMethod(t, "setMaxProto", SetMaxProto);
|
||||
@@ -739,23 +738,6 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
}
|
||||
|
||||
-void SecureContext::SetSigalgs(const FunctionCallbackInfo<Value>& args) {
|
||||
- SecureContext* sc;
|
||||
- ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
|
||||
- Environment* env = sc->env();
|
||||
- ClearErrorOnReturn clear_error_on_return;
|
||||
-
|
||||
- CHECK_EQ(args.Length(), 1);
|
||||
- CHECK(args[0]->IsString());
|
||||
-
|
||||
- const node::Utf8Value sigalgs(env->isolate(), args[0]);
|
||||
-
|
||||
- int rv = SSL_CTX_set1_sigalgs_list(sc->ctx_.get(), *sigalgs);
|
||||
-
|
||||
- if (rv == 0) {
|
||||
- return ThrowCryptoError(env, ERR_get_error());
|
||||
- }
|
||||
-}
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
// Helpers for the smart pointer.
|
||||
@@ -1748,7 +1730,6 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
|
||||
env->SetProtoMethodNoSideEffect(t, "isSessionReused", IsSessionReused);
|
||||
env->SetProtoMethodNoSideEffect(t, "verifyError", VerifyError);
|
||||
env->SetProtoMethodNoSideEffect(t, "getCipher", GetCipher);
|
||||
- env->SetProtoMethodNoSideEffect(t, "getSharedSigalgs", GetSharedSigalgs);
|
||||
env->SetProtoMethod(t, "endParser", EndParser);
|
||||
env->SetProtoMethod(t, "certCbDone", CertCbDone);
|
||||
env->SetProtoMethod(t, "renegotiate", Renegotiate);
|
||||
@@ -2685,88 +2666,6 @@ void SSLWrap<Base>::GetCipher(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
|
||||
-template <class Base>
|
||||
-void SSLWrap<Base>::GetSharedSigalgs(const FunctionCallbackInfo<Value>& args) {
|
||||
- Base* w;
|
||||
- ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
|
||||
- Environment* env = w->ssl_env();
|
||||
- std::vector<Local<Value>> ret_arr;
|
||||
-
|
||||
- SSL* ssl = w->ssl_.get();
|
||||
- int nsig = SSL_get_shared_sigalgs(ssl, 0, nullptr, nullptr, nullptr, nullptr,
|
||||
- nullptr);
|
||||
-
|
||||
- for (int i = 0; i < nsig; i++) {
|
||||
- int hash_nid;
|
||||
- int sign_nid;
|
||||
- std::string sig_with_md;
|
||||
-
|
||||
- SSL_get_shared_sigalgs(ssl, i, &sign_nid, &hash_nid, nullptr, nullptr,
|
||||
- nullptr);
|
||||
-
|
||||
- switch (sign_nid) {
|
||||
- case EVP_PKEY_RSA:
|
||||
- sig_with_md = "RSA+";
|
||||
- break;
|
||||
-
|
||||
- case EVP_PKEY_RSA_PSS:
|
||||
- sig_with_md = "RSA-PSS+";
|
||||
- break;
|
||||
-
|
||||
- case EVP_PKEY_DSA:
|
||||
- sig_with_md = "DSA+";
|
||||
- break;
|
||||
-
|
||||
- case EVP_PKEY_EC:
|
||||
- sig_with_md = "ECDSA+";
|
||||
- break;
|
||||
-
|
||||
- case NID_ED25519:
|
||||
- sig_with_md = "Ed25519+";
|
||||
- break;
|
||||
-
|
||||
- case NID_ED448:
|
||||
- sig_with_md = "Ed448+";
|
||||
- break;
|
||||
-
|
||||
- case NID_id_GostR3410_2001:
|
||||
- sig_with_md = "gost2001+";
|
||||
- break;
|
||||
-
|
||||
- case NID_id_GostR3410_2012_256:
|
||||
- sig_with_md = "gost2012_256+";
|
||||
- break;
|
||||
-
|
||||
- case NID_id_GostR3410_2012_512:
|
||||
- sig_with_md = "gost2012_512+";
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- const char* sn = OBJ_nid2sn(sign_nid);
|
||||
-
|
||||
- if (sn != nullptr) {
|
||||
- sig_with_md = std::string(sn) + "+";
|
||||
- } else {
|
||||
- sig_with_md = "UNDEF+";
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- const char* sn_hash = OBJ_nid2sn(hash_nid);
|
||||
- if (sn_hash != nullptr) {
|
||||
- sig_with_md += std::string(sn_hash);
|
||||
- } else {
|
||||
- sig_with_md += "UNDEF";
|
||||
- }
|
||||
-
|
||||
- ret_arr.push_back(OneByteString(env->isolate(), sig_with_md.c_str()));
|
||||
- }
|
||||
-
|
||||
- args.GetReturnValue().Set(
|
||||
- Array::New(env->isolate(), ret_arr.data(), ret_arr.size()));
|
||||
-}
|
||||
-
|
||||
-
|
||||
template <class Base>
|
||||
void SSLWrap<Base>::GetProtocol(const FunctionCallbackInfo<Value>& args) {
|
||||
Base* w;
|
||||
diff --git a/src/node_crypto.h b/src/node_crypto.h
|
||||
index 206a19119a73216ffe16f935ee6a9423bff6865f..6aa4654d5deb07e6e97507c2b746b577ea8a0b17 100644
|
||||
--- a/src/node_crypto.h
|
||||
+++ b/src/node_crypto.h
|
||||
@@ -129,7 +129,6 @@ class SecureContext : public BaseObject {
|
||||
static void AddRootCerts(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void SetCipherSuites(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void SetCiphers(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
- static void SetSigalgs(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void SetECDHCurve(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void SetDHParam(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void SetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
@@ -255,7 +254,6 @@ class SSLWrap {
|
||||
static void IsSessionReused(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void VerifyError(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void GetCipher(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
- static void GetSharedSigalgs(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void EndParser(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void CertCbDone(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void Renegotiate(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
@ -1,20 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nitish Sakhawalkar <nitsakh@icloud.com>
|
||||
Date: Thu, 4 Apr 2019 16:45:35 -0700
|
||||
Subject: src: Disable NODE_USE_V8_PLATFORM in node_options
|
||||
|
||||
Electron does not set NODE_USE_V8_PLATFORM. If inspector is enabled when NODE_USE_V8_PLATFORM is false, then there's an error. We want to ignore that, use our own v8 platform but still use the node inspector
|
||||
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 03919d450b3373983d647165ee93c006eb5f2902..b9db121250c77e1bc8c35af336361ee444c271e4 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -33,7 +33,7 @@ DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
|
||||
DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
|
||||
|
||||
void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
|
||||
-#if !NODE_USE_V8_PLATFORM
|
||||
+#if 0
|
||||
if (inspector_enabled) {
|
||||
errors->push_back("Inspector is not available when Node is compiled "
|
||||
"--without-v8-platform");
|
|
@ -12,6 +12,7 @@
|
|||
"parallel/test-bootstrap-modules",
|
||||
"parallel/test-buffer-backing-arraybuffer",
|
||||
"parallel/test-buffer-constructor-node-modules-paths",
|
||||
"parallel/test-buffer-constructor-outside-node-modules",
|
||||
"parallel/test-child-process-fork-exec-path",
|
||||
"parallel/test-cli-bad-options",
|
||||
"parallel/test-cli-node-print-help",
|
||||
|
@ -191,6 +192,7 @@
|
|||
"async-hooks/test-timers.setInterval",
|
||||
"async-hooks/test-late-hook-enable",
|
||||
"es-module/test-esm-cjs-main",
|
||||
"es-module/test-cjs-esm-warn",
|
||||
"es-module/test-esm-json-cache",
|
||||
"es-module/test-esm-snapshot",
|
||||
"es-module/test-esm-no-extension",
|
||||
|
|
|
@ -35,8 +35,9 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'
|
|||
|
||||
const runners = new Map([
|
||||
['main', { description: 'Main process specs', run: runMainProcessElectronTests }],
|
||||
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }],
|
||||
['native', { description: 'Native specs', run: runNativeElectronTests }]
|
||||
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }]
|
||||
// TODO(codebytere): refactor native tests to only depend on what we need
|
||||
/* ['native', { description: 'Native specs', run: runNativeElectronTests }] */
|
||||
])
|
||||
|
||||
const specHashPath = path.resolve(__dirname, '../spec/.hash')
|
||||
|
|
Загрузка…
Ссылка в новой задаче