Skip to content

Commit

Permalink
update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
electron-bot authored and codebytere committed May 18, 2021
1 parent 9e06007 commit d9d12f7
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 165 deletions.
3 changes: 0 additions & 3 deletions patches/node/.patches
Expand Up @@ -27,12 +27,9 @@ fix_add_v8_enable_reverse_jsargs_defines_in_common_gypi.patch
fix_allow_preventing_initializeinspector_in_env.patch
src_allow_embedders_to_provide_a_custom_pageallocator_to.patch
allow_preventing_preparestacktracecallback.patch
fix_add_safeforterminationscopes_for_sigint_interruptions.patch
remove_makeexternal_case_for_uncached_internal_strings.patch
fix_remove_outdated_--experimental-wasm-bigint_flag.patch
fix_crypto_tests_to_run_with_bssl.patch
build_add_mjs_support_to_js2c.patch
src_inline_asynccleanuphookhandle_in_headers.patch
fix_handle_new_tostring_behavior_in_v8_serdes_test.patch
fix_the_--harmony-weak-refs_has_been_removed_remove_from_specs.patch
node-api_faster_threadsafe_function.patch
8 changes: 4 additions & 4 deletions patches/node/build_add_gn_build_files.patch
Expand Up @@ -1395,10 +1395,10 @@ index 0000000000000000000000000000000000000000..7ecda5c553fe547f79f7d9fb5dc2d71c
+ ]
+}
diff --git a/node.gyp b/node.gyp
index f18a0d58a84c798abc946d2b389987009f80fa2d..4f13c5b2d4e9e22f37dab47cd44b475f515ebe97 100644
index 61b789ec74ab554648164875d540f34c09ffc116..753f135322a007b3b9d330ccd4101cc18b454e58 100644
--- a/node.gyp
+++ b/node.gyp
@@ -235,17 +235,17 @@
@@ -238,17 +238,17 @@
'lib/internal/streams/state.js',
'lib/internal/streams/pipeline.js',
'lib/internal/streams/end-of-stream.js',
Expand Down Expand Up @@ -1633,7 +1633,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index 15dae3ef318d8afd33ea2e8ced41bbdf80724b83..e3856f950cc68bd34966acf8f181eec38fe40691 100644
index 5419747db7b6504ad9d61b1cd3d53d93913e360f..e51bf333b77e67af188a3d352ca22b12d939e412 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down Expand Up @@ -1772,7 +1772,7 @@ index 0000000000000000000000000000000000000000..3088ae4bdf814ae255c9805ebd393b2e
+
+ out_file.writelines(new_contents)
diff --git a/tools/install.py b/tools/install.py
index 729b416fc47d3ff3317ae3671dee977c719a8841..530ca7d441d3b65d4e4fac7dd5880afe56aa3807 100755
index 693faff4c37ac4d83a47e818f4412900497a2b62..7ab58f7cba6f210e4b7829257fb87e26a091cc89 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -159,8 +159,8 @@ def files(action):
Expand Down
Expand Up @@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
of this.

diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index af69dfc9e71b54a9d7eda0daa498396008aba610..f52e8a09f689bafcfdca39e71822ff3cbf898349 100644
index a66ac87237ad1de85318be58d15b508be568cf1f..62553011f9fd16dbaccd8d7e8eecee627be7137c 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -95,10 +95,12 @@ function patchProcessObject(expandArgv1) {
@@ -89,10 +89,12 @@ function patchProcessObject(expandArgv1) {
if (expandArgv1 && process.argv[1] &&
!StringPrototypeStartsWith(process.argv[1], '-')) {
// Expand process.argv[1] into a full path.
Expand All @@ -29,10 +29,10 @@ index af69dfc9e71b54a9d7eda0daa498396008aba610..f52e8a09f689bafcfdca39e71822ff3c

// TODO(joyeecheung): most of these should be deprecated and removed,
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 541c18d8032c5247433367f9e04c946cf203d475..b04e3f1fc56a86abe18f924e4d9b7fb517aea74d 100644
index e2a205739ce89820fe5f1f24e609ff16b86afb04..db6980d387ed399671957170266e2a01c04fae9a 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1037,6 +1037,13 @@ Module.prototype._compile = function(content, filename) {
@@ -1042,6 +1042,13 @@ Module.prototype._compile = function(content, filename) {
if (getOptionValue('--inspect-brk') && process._eval == null) {
if (!resolvedArgv) {
// We enter the repl if we're not given a filename argument.
Expand Down
Expand Up @@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
out in memory on 64-bit machines, and will summarily fail to work.

diff --git a/common.gypi b/common.gypi
index d37d29736ead82aca6c89cc7625ca4d9a053da32..b6aa3c0504fd108ada368d30f3021d1c171a4879 100644
index 3f305b39cb35a1a36a54cff80476fecba1556d5d..cd56b9b314823ff48c1a599ec51c6a3077b62f98 100644
--- a/common.gypi
+++ b/common.gypi
@@ -64,7 +64,7 @@
Expand Down
12 changes: 6 additions & 6 deletions patches/node/feat_add_uv_loop_watcher_queue_code.patch
Expand Up @@ -6,10 +6,10 @@ Subject: feat: add uv_loop watcher_queue code
Electron's Node Integration works by listening to Node's backend file descriptor in a separate thread; when an event is ready the backend file descriptor will trigger a new event for it, and the main thread will then iterate the libuv loop. For certain operations (ex. adding a timeout task) the backend file descriptor isn't informed, & as a result the main thread doesn't know it needs to iterate the libuv loop so the timeout task will never execute until something else trigger a new event. This commit should be removed when https://github.com/libuv/libuv/pull/1921 is merged

diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
index 2557961eedba7f8ab5d5a058859613910e3bb382..72fe36fdc8978c6cb9913f353ea97fb4027ad492 100644
index 1e1fc94bfcc3dca90620d09fab1fe60060e17056..253f23e14d09a8c8d5c51545f71b7f03f064dbd6 100644
--- a/deps/uv/include/uv.h
+++ b/deps/uv/include/uv.h
@@ -1780,6 +1780,8 @@ union uv_any_req {
@@ -1789,6 +1789,8 @@ union uv_any_req {
struct uv_loop_s {
/* User data - use this for whatever. */
void* data;
Expand All @@ -19,7 +19,7 @@ index 2557961eedba7f8ab5d5a058859613910e3bb382..72fe36fdc8978c6cb9913f353ea97fb4
unsigned int active_handles;
void* handle_queue[2];
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
index 1597828c868b383439f7442a3f22eee5d6ac539d..a0fbc07a21c66cc91b7b342640e5bc4ba579fd78 100644
index 63f268f795f10072fe1c430d1242e3774bf9eea9..2811f063eef7329f87fbe43b28729c6b25f0a75b 100644
--- a/deps/uv/src/unix/core.c
+++ b/deps/uv/src/unix/core.c
@@ -897,8 +897,11 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
Expand All @@ -35,8 +35,8 @@ index 1597828c868b383439f7442a3f22eee5d6ac539d..a0fbc07a21c66cc91b7b342640e5bc4b

if (loop->watchers[w->fd] == NULL) {
loop->watchers[w->fd] = w;
@@ -934,8 +937,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
w->events = 0;
@@ -933,8 +936,11 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
loop->nfds--;
}
}
- else if (QUEUE_EMPTY(&w->watcher_queue))
Expand All @@ -48,7 +48,7 @@ index 1597828c868b383439f7442a3f22eee5d6ac539d..a0fbc07a21c66cc91b7b342640e5bc4b
}


@@ -952,6 +958,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
@@ -951,6 +957,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
void uv__io_feed(uv_loop_t* loop, uv__io_t* w) {
if (QUEUE_EMPTY(&w->pending_queue))
QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue);
Expand Down
6 changes: 3 additions & 3 deletions patches/node/feat_initialize_asar_support.patch
Expand Up @@ -6,18 +6,18 @@ Subject: feat: initialize asar support
This patch initializes asar support in Node.js.

diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index c76add4621b614dd7dd4f4d369fb6ce7598ee22d..af69dfc9e71b54a9d7eda0daa498396008aba610 100644
index dfd7249e907ebcc0aa0e511b96435507af3f90aa..a66ac87237ad1de85318be58d15b508be568cf1f 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -75,6 +75,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
@@ -69,6 +69,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
loadPreloadModules();
initializeFrozenIntrinsics();
+ setupAsarSupport();
}

function patchProcessObject(expandArgv1) {
@@ -450,6 +451,10 @@ function loadPreloadModules() {
@@ -468,6 +469,10 @@ function loadPreloadModules() {
}
}

Expand Down
Expand Up @@ -8,10 +8,10 @@ Fixes an 'assigment to 'char *' from 'const char *'' error in libuv.
This will be upstreamed.

diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c
index 8a801749d472b041fa4472a84e8499cf02b29fc4..99b30f579763e068d907dd17c21ce22265b6bf6f 100644
index a083b5e82c8c4294d45a65ab4d01fa3ceb650cdd..5eaaee3b0c6a5f52e10b5749eae4b21c5c059322 100644
--- a/deps/uv/src/win/fs.c
+++ b/deps/uv/src/win/fs.c
@@ -1242,8 +1242,8 @@ void fs__mktemp(uv_fs_t* req, uv__fs_mktemp_func func) {
@@ -1237,8 +1237,8 @@ void fs__mktemp(uv_fs_t* req, uv__fs_mktemp_func func) {
size_t len;
uint64_t v;
char* path;
Expand Down
Expand Up @@ -8,7 +8,7 @@ common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp.

diff --git a/common.gypi b/common.gypi
index e610650a01d4ab39f9595d11aac7f49d62bd27b7..d37d29736ead82aca6c89cc7625ca4d9a053da32 100644
index aa4279d93ca35c83ad8c417a11292ef5ca91c495..3f305b39cb35a1a36a54cff80476fecba1556d5d 100644
--- a/common.gypi
+++ b/common.gypi
@@ -81,6 +81,22 @@
Expand Down

This file was deleted.

Expand Up @@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi
This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this.

diff --git a/common.gypi b/common.gypi
index b6aa3c0504fd108ada368d30f3021d1c171a4879..9a2552ab3c1ba44b57b2d3b1ddf2becaa32ebbda 100644
index cd56b9b314823ff48c1a599ec51c6a3077b62f98..709943635ad31da1c7a7ef91d2f3bfbeb78ea937 100644
--- a/common.gypi
+++ b/common.gypi
@@ -65,6 +65,7 @@
Expand Down
Expand Up @@ -36,7 +36,7 @@ index 53b07052e43a09f29f863ee1b2287bdebe7b7a7f..c08fe4b32d4155badb572f15529f903c
#endif

diff --git a/src/env-inl.h b/src/env-inl.h
index c1853f81b68bd22d20fb99877f4c500a384e9545..578552c0d66f9fd09405d80376d5f97d812018ee 100644
index 9b2f82cc00e661f139611dd2de53598d6d8ff210..006bcaf4a9a864438cd447dc4235b3a5257cd2a5 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -829,6 +829,10 @@ inline bool Environment::tracks_unmanaged_fds() const {
Expand All @@ -51,10 +51,10 @@ index c1853f81b68bd22d20fb99877f4c500a384e9545..578552c0d66f9fd09405d80376d5f97d
return emit_filehandle_warning_;
}
diff --git a/src/env.h b/src/env.h
index f89365a1aa7ffacbb423e01a68f484992751f76f..5e5818eaed3cd4435f1e6b908e95c5953c8743f2 100644
index 9c435f12db0e2d0a13ebd2b01810f0857c55fe2e..1ea1caf0e327719c39f91ce3c0897dde5034c904 100644
--- a/src/env.h
+++ b/src/env.h
@@ -1020,6 +1020,7 @@ class Environment : public MemoryRetainer {
@@ -1026,6 +1026,7 @@ class Environment : public MemoryRetainer {
inline bool owns_process_state() const;
inline bool owns_inspector() const;
inline bool tracks_unmanaged_fds() const;
Expand Down
16 changes: 8 additions & 8 deletions patches/node/fix_comment_out_incompatible_crypto_modules.patch
Expand Up @@ -9,10 +9,10 @@ with what's exposed through BoringSSL. I plan to upstream parts of this or
otherwise introduce shims to reduce friction.

diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index d7b6dbd85d6ef97370affde54bde4657f2413a06..489123d5fbd340fdceb3b6316e3fca6fb1050fef 100644
index c0baf86802a67f00830c81d325f448bcea7d4e40..c2fd0f94eeb1aeaecdb18e80268ef1fb84c5c8c2 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -5204,11 +5204,11 @@ bool DiffieHellman::Init(int primeLength, int g) {
@@ -5207,11 +5207,11 @@ bool DiffieHellman::Init(int primeLength, int g) {
bool DiffieHellman::Init(const char* p, int p_len, int g) {
dh_.reset(DH_new());
if (p_len <= 0) {
Expand All @@ -26,7 +26,7 @@ index d7b6dbd85d6ef97370affde54bde4657f2413a06..489123d5fbd340fdceb3b6316e3fca6f
return false;
}
BIGNUM* bn_p =
@@ -5227,18 +5227,18 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
@@ -5230,18 +5230,18 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
dh_.reset(DH_new());
if (p_len <= 0) {
Expand All @@ -48,7 +48,7 @@ index d7b6dbd85d6ef97370affde54bde4657f2413a06..489123d5fbd340fdceb3b6316e3fca6f
return false;
}
BIGNUM* bn_p =
@@ -5731,7 +5731,7 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
@@ -5734,7 +5734,7 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo<Value>& args) {
if (!EC_KEY_set_public_key(new_key.get(), pub.get()))
return env->ThrowError("Failed to set generated public key");

Expand All @@ -57,23 +57,23 @@ index d7b6dbd85d6ef97370affde54bde4657f2413a06..489123d5fbd340fdceb3b6316e3fca6f
ecdh->group_ = EC_KEY_get0_group(ecdh->key_.get());
}

@@ -6219,6 +6219,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
@@ -6222,6 +6222,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
EVPKeyCtxPointer Setup() override {
EVPKeyPointer params;
if (prime_info_.fixed_value_) {
+#if 0
DHPointer dh(DH_new());
if (!dh)
return nullptr;
@@ -6235,6 +6236,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
@@ -6238,6 +6239,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
params = EVPKeyPointer(EVP_PKEY_new());
CHECK(params);
EVP_PKEY_assign_DH(params.get(), dh.release());
+#endif
} else {
EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DH, nullptr));
if (!param_ctx)
@@ -6242,7 +6244,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
@@ -6245,7 +6247,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {

if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
return nullptr;
Expand All @@ -82,7 +82,7 @@ index d7b6dbd85d6ef97370affde54bde4657f2413a06..489123d5fbd340fdceb3b6316e3fca6f
if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(param_ctx.get(),
prime_info_.prime_size_) <= 0)
return nullptr;
@@ -6250,7 +6252,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
@@ -6253,7 +6255,7 @@ class DHKeyPairGenerationConfig : public KeyPairGenerationConfig {
if (EVP_PKEY_CTX_set_dh_paramgen_generator(param_ctx.get(),
generator_) <= 0)
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion patches/node/fix_crypto_tests_to_run_with_bssl.patch
Expand Up @@ -361,7 +361,7 @@ index ce4e2922de806276586796e2b3abdb885fc99840..4a92a134291964003fe50a3a9fec9d3e
}

diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
index f51ffba042421a62aba455ec8aa786a444aed3fc..4a1338f1dab9832dcd9f98e1b82ec527d5813d44 100644
index 8a5fd21eea511ecd60aa99ca1ba5c592cd5028fa..d165256887abd6f10a8ff89076e8ae528725d074 100644
--- a/test/parallel/test-crypto-dh.js
+++ b/test/parallel/test-crypto-dh.js
@@ -41,7 +41,7 @@ for (const bits of [-1, 0, 1]) {
Expand Down
Expand Up @@ -6,10 +6,10 @@ Subject: fix: handle new ToString() behavior in v8 serdes test
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2739980

diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js
index 593fb34ad7359419a886df4492d36715357a0905..3eeb1b45a9d14f97fc61f4c308b0538c65230275 100644
index f080f551396c8bb27e16448babecca2f2ad18a2b..d7304e6255648bd19c66012b55b93598d5ffa66d 100644
--- a/test/parallel/test-v8-serdes.js
+++ b/test/parallel/test-v8-serdes.js
@@ -54,7 +54,7 @@ const deserializerTypeError =
@@ -50,7 +50,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
{
const ser = new v8.DefaultSerializer();
ser._getDataCloneError = common.mustCall((message) => {
Expand Down
Expand Up @@ -6,10 +6,10 @@ Subject: fix: key gen APIs are not available in BoringSSL
This will make Node's key pair generation APIs fail.

diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index ed886abd749661a90e488b24152b2998fb38a4f8..3c9345fb46f65294b005102eafbaf60604a475f9 100644
index bd40705e6b1ae0927239a06c40a2181e4458b1c4..79e781fb3e6ec63334c2c5d4b24d2a6049be79fc 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -288,24 +288,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
@@ -291,24 +291,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
V(BIO) \
V(PKCS7) \
V(X509V3) \
Expand All @@ -34,15 +34,15 @@ index ed886abd749661a90e488b24152b2998fb38a4f8..3c9345fb46f65294b005102eafbaf606
V(USER) \

#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
@@ -6135,6 +6125,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
@@ -6138,6 +6128,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0)
return nullptr;

+#ifndef OPENSSL_IS_BORINGSSL
if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0)
return nullptr;

@@ -6145,6 +6136,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
@@ -6148,6 +6139,7 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig {
return nullptr;
}
}
Expand Down
Expand Up @@ -10,7 +10,7 @@ This patch can be removed as soon as we upgrade Node.js to a version of
V8 which contains the above CL.

diff --git a/test/wasi/test-return-on-exit.js b/test/wasi/test-return-on-exit.js
index 3f5d40c9ba7fb864767e9ac6c4b9a9f466d687e7..362d13b490a96f16029ba7edc0cda14db0feaab6 100644
index eef97996fbf7442a6bdd808fe1b5b6eab148f322..e61f4174c3d4ee3778f5d0d5aeb2270f263ee63f 100644
--- a/test/wasi/test-return-on-exit.js
+++ b/test/wasi/test-return-on-exit.js
@@ -1,4 +1,4 @@
Expand Down

This file was deleted.

0 comments on commit d9d12f7

Please sign in to comment.