Browse Source

chore: bump node to v14.13.0 (master) (#25788)

Electron Bot 4 years ago
parent
commit
3e627f7700

+ 1 - 1
DEPS

@@ -16,7 +16,7 @@ vars = {
   'chromium_version':
     'b943d006a33ec5bc1743792d64724693eb357083',
   'node_version':
-    'v14.12.0',
+    'v14.13.0',
   'nan_version':
     '2c4ee8a32a299eada3cd6e468bbd0a473bfea96d',
   'squirrel.mac_version':

+ 0 - 1
patches/node/.patches

@@ -22,7 +22,6 @@ build_bring_back_node_with_ltcg_configuration.patch
 revert_crypto_add_oaeplabel_option.patch
 enable_31_bit_smis_on_64bit_arch_and_ptr_compression.patch
 fix_use_crypto_impls_for_compat.patch
-fix_window_c-ares_incompatibilities.patch
 fix_comment_out_incompatible_crypto_modules.patch
 update_tests_after_increasing_typed_array_size.patch
 feat_add_implementation_of_v8_platform_postjob.patch

+ 5 - 4
patches/node/build_add_gn_build_files.patch

@@ -846,10 +846,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
 +}
 diff --git a/filenames.json b/filenames.json
 new file mode 100644
-index 0000000000000000000000000000000000000000..d3315d9150ac674e06948d72ae02179a9151d74c
+index 0000000000000000000000000000000000000000..fbf2c13688d52b5ba320eadac42d472f09441e79
 --- /dev/null
 +++ b/filenames.json
-@@ -0,0 +1,526 @@
+@@ -0,0 +1,527 @@
 +// This file is automatically generated by generate_gn_filenames_json.py
 +// DO NOT EDIT
 +{
@@ -1182,7 +1182,8 @@ index 0000000000000000000000000000000000000000..d3315d9150ac674e06948d72ae02179a
 +    "deps/acorn-plugins/acorn-numeric-separator/index.js",
 +    "deps/acorn-plugins/acorn-private-class-elements/index.js",
 +    "deps/acorn-plugins/acorn-private-methods/index.js",
-+    "deps/acorn-plugins/acorn-static-class-features/index.js"
++    "deps/acorn-plugins/acorn-static-class-features/index.js",
++    "deps/cjs-module-lexer/lexer.js"
 +  ],
 +  "node_sources": [
 +    "src/api/async_resource.cc",
@@ -1582,7 +1583,7 @@ index 0000000000000000000000000000000000000000..f3c5c798c0aefcb8cf9b1570a7b4817c
 +  args = rebase_path(inputs + outputs, root_build_dir)
 +}
 diff --git a/src/node_version.h b/src/node_version.h
-index 42b53f309ebf86acacad968fc68c991ab7fc66cc..ca3b32a34b90bc8831fe10c90e503a82e39a85b7 100644
+index de11092c486214285b74251eefb93cd1b705d2e7..7171aa2fa64994d57ed8ceb7d69b457761d3ff40 100644
 --- a/src/node_version.h
 +++ b/src/node_version.h
 @@ -89,7 +89,10 @@

+ 1 - 1
patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

@@ -14,7 +14,7 @@ renderer/browser/worker/sandboxed bootstrap scripts).  These are loaded
 through LoadEmbedderJavaScriptSource()
 
 diff --git a/src/node_native_module.cc b/src/node_native_module.cc
-index 74729c412674be2cbf01d68be1bc496b06b8ce1e..7311f249fbb24e0612d9f4f174e96fa13ed77acb 100644
+index 4c3633e06c60265c974bdd2a5a3d2e615e4aeb82..5e03a3a6e35e934faf71e765d7fc6e356f40e8d0 100644
 --- a/src/node_native_module.cc
 +++ b/src/node_native_module.cc
 @@ -20,6 +20,7 @@ NativeModuleLoader NativeModuleLoader::instance_;

+ 2 - 2
patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch

@@ -29,10 +29,10 @@ index f947c6bf27e80c534a8f72265d0139a8b5b3f13a..d7e56d9c3fe5a56897989915984cb823
  
    // 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 c614adc508c37b7f8250d53a6e113a973008933c..99e1258b8e2939bdc0fa8881fa15b642ef352384 100644
+index 7fd217560ec465b893116df87916d422f384b55f..a86fa29ee240da9c9e3a0fc315094486ceae3c19 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -1050,6 +1050,13 @@ Module.prototype._compile = function(content, filename) {
+@@ -1059,6 +1059,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.

+ 6 - 6
patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch

@@ -24,7 +24,7 @@ Environment on the V8 context of blink, so no new V8 context is created.
 As a result, a renderer process may have multiple Node Environments in it.
 
 diff --git a/src/node.cc b/src/node.cc
-index c5a406062c48dd00d411e3d1d26e4c6f40c30513..0be31f4e02513682fc742e7a71c11a115245e3d8 100644
+index 905afd8c235b7b1a7b45823db486384935a2a52b..102847cd32d03addeb40c9539eafc92ba49c8ec4 100644
 --- a/src/node.cc
 +++ b/src/node.cc
 @@ -134,6 +134,8 @@ using v8::Undefined;
@@ -36,7 +36,7 @@ index c5a406062c48dd00d411e3d1d26e4c6f40c30513..0be31f4e02513682fc742e7a71c11a11
  namespace per_process {
  
  // node_revert.h
-@@ -836,7 +838,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -837,7 +839,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
    binding::RegisterBuiltinModules();
  
    // Make inherited handles noninheritable.
@@ -47,7 +47,7 @@ index c5a406062c48dd00d411e3d1d26e4c6f40c30513..0be31f4e02513682fc742e7a71c11a11
  
    // Cache the original command line to be
    // used in diagnostic reports.
-@@ -870,6 +874,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -871,6 +875,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
      if (exit_code != 0) return exit_code;
    }
  #endif
@@ -56,7 +56,7 @@ index c5a406062c48dd00d411e3d1d26e4c6f40c30513..0be31f4e02513682fc742e7a71c11a11
  
    const int exit_code = ProcessGlobalArgs(argv,
                                            exec_argv,
-@@ -914,6 +920,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
+@@ -915,6 +921,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
    }
    per_process::metadata.versions.InitializeIntlVersions();
  #endif
@@ -65,10 +65,10 @@ index c5a406062c48dd00d411e3d1d26e4c6f40c30513..0be31f4e02513682fc742e7a71c11a11
    NativeModuleEnv::InitializeCodeCache();
  
 diff --git a/src/node.h b/src/node.h
-index 1914e72ee8fa4361379725b8d44892c8a62084e1..d051b422d7c5a51a8590abda382676d3f661b532 100644
+index 33e11327e487bca9d0d7b5cd5a1c036c7009a359..7340d1a6f0cf2f912aaee15d66ed137fe2870bab 100644
 --- a/src/node.h
 +++ b/src/node.h
-@@ -218,6 +218,8 @@ namespace node {
+@@ -220,6 +220,8 @@ namespace node {
  
  class IsolateData;
  class Environment;

+ 2 - 2
patches/node/feat_add_uv_loop_watcher_queue_code.patch

@@ -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 06b6d001040e0422c672bbed0722343a852a7907..3c2b2eb68c3ea4e81833a376204cd955183f649b 100644
+index 2557961eedba7f8ab5d5a058859613910e3bb382..72fe36fdc8978c6cb9913f353ea97fb4027ad492 100644
 --- a/deps/uv/include/uv.h
 +++ b/deps/uv/include/uv.h
-@@ -1773,6 +1773,8 @@ union uv_any_req {
+@@ -1780,6 +1780,8 @@ union uv_any_req {
  struct uv_loop_s {
    /* User data - use this for whatever. */
    void* data;

+ 3 - 3
patches/node/fix_allow_preventing_initializeinspector_in_env.patch

@@ -11,7 +11,7 @@ initialize it in the browser process. This adds a new
 EnvironmentFlags option which allows preventing that invocation.
 
 diff --git a/src/api/environment.cc b/src/api/environment.cc
-index 4fa2d4175fb318f560b7b9a8ed8baa091d3ed6a2..cf6115d04ba3c184937c5db85c9d7ebc78ed3db7 100644
+index 5110c9f754f7653261f7de6d5f0c35e541880a4d..274d0481529ace763c997910ce40e2c730a20146 100644
 --- a/src/api/environment.cc
 +++ b/src/api/environment.cc
 @@ -358,12 +358,14 @@ Environment* CreateEnvironment(
@@ -63,10 +63,10 @@ index 38d17f4e18aa38fde2c2f59a9816c8fb0f65fd51..4fe2eb3b7699efcab87c377743a955ef
    inline worker::Worker* worker_context() const;
    Environment* worker_parent_env() const;
 diff --git a/src/node.h b/src/node.h
-index 80acb3f9f04ef8e6c363cf31384af4037abeeb87..22f037b0b26f39f9ce94c4a364b27cf204366cb9 100644
+index b9493d1f3d5b4f192609f1e7529715ec30ab46e2..019620ad0c6a0ca80e6cbcfc5a8322f4e1220bb1 100644
 --- a/src/node.h
 +++ b/src/node.h
-@@ -424,7 +424,11 @@ enum Flags : uint64_t {
+@@ -426,7 +426,11 @@ enum Flags : uint64_t {
    kNoRegisterESMLoader = 1 << 3,
    // Set this flag to make Node.js track "raw" file descriptors, i.e. managed
    // by fs.open() and fs.close(), and close them during FreeEnvironment().

+ 1 - 1
patches/node/fix_expose_internalcallbackscope.patch

@@ -6,7 +6,7 @@ Subject: fix: expose InternalCallbackScope
 This commit exposes InternalCallbackScope in order to allow us access to its internal flags.
 
 diff --git a/src/node_internals.h b/src/node_internals.h
-index dffaa084db409b833a869a851521e290e6789396..54e24d41e25293d3535cd853eb5a80a7b0fee122 100644
+index c8952e59a2b071c94eaba41393df5b2aa238318e..ab664208076ea776fcb2223dbc228cacd3eb7e58 100644
 --- a/src/node_internals.h
 +++ b/src/node_internals.h
 @@ -204,7 +204,7 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(

+ 4 - 4
patches/node/fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch

@@ -5,7 +5,7 @@ Subject: fix: expose tracing::Agent and use tracing::TracingController instead
  of v8::TracingController
 
 diff --git a/src/api/environment.cc b/src/api/environment.cc
-index bc1ab0bfcf87936b8d8156172319283704b05da8..4fa2d4175fb318f560b7b9a8ed8baa091d3ed6a2 100644
+index 9a2661ce8b6146a73b910444a49e01e20c8d96e5..5110c9f754f7653261f7de6d5f0c35e541880a4d 100644
 --- a/src/api/environment.cc
 +++ b/src/api/environment.cc
 @@ -472,6 +472,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
@@ -20,10 +20,10 @@ index bc1ab0bfcf87936b8d8156172319283704b05da8..4fa2d4175fb318f560b7b9a8ed8baa09
      int thread_pool_size,
      node::tracing::TracingController* tracing_controller) {
 diff --git a/src/node.h b/src/node.h
-index d051b422d7c5a51a8590abda382676d3f661b532..80acb3f9f04ef8e6c363cf31384af4037abeeb87 100644
+index 7340d1a6f0cf2f912aaee15d66ed137fe2870bab..b9493d1f3d5b4f192609f1e7529715ec30ab46e2 100644
 --- a/src/node.h
 +++ b/src/node.h
-@@ -123,6 +123,7 @@ namespace node {
+@@ -125,6 +125,7 @@ namespace node {
  
  namespace tracing {
  
@@ -31,7 +31,7 @@ index d051b422d7c5a51a8590abda382676d3f661b532..80acb3f9f04ef8e6c363cf31384af403
  class TracingController;
  
  }
-@@ -510,6 +511,8 @@ NODE_DEPRECATED("Use GetMultiIsolatePlatform(env) instead",
+@@ -512,6 +513,8 @@ NODE_DEPRECATED("Use GetMultiIsolatePlatform(env) instead",
  NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
  NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
  

+ 0 - 36
patches/node/fix_window_c-ares_incompatibilities.patch

@@ -1,36 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shelley Vohr <[email protected]>
-Date: Wed, 29 Apr 2020 13:58:38 -0700
-Subject: fix: window c-ares incompatibilities
-
-Fixes LPCWSTR conversion incompatibilities introduced by a Node.js upgrade to
-c-ares v1.16.0 in https://github.com/nodejs/node/pull/32246. I've opened an issue for this
-on the c-ares repo as well as an upstream PR at https://github.com/c-ares/c-ares/pull/328.
-
-diff --git a/deps/cares/src/ares_getaddrinfo.c b/deps/cares/src/ares_getaddrinfo.c
-index 8265e4afc20f6043260efe003c3c890db4fa8b73..11e565aa2e9c8a1ee1f86c153ee6371568cc9bb4 100644
---- a/deps/cares/src/ares_getaddrinfo.c
-+++ b/deps/cares/src/ares_getaddrinfo.c
-@@ -456,18 +456,18 @@ static int file_lookup(struct host_query *hquery)
-           char tmp[MAX_PATH];
-           HKEY hkeyHosts;
- 
--          if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
-+          if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
-                            &hkeyHosts) == ERROR_SUCCESS)
-             {
-               DWORD dwLength = MAX_PATH;
--              RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
-+              RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
-                               &dwLength);
--              ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
-+              ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
-               RegCloseKey(hkeyHosts);
-             }
-         }
-       else if (platform == WIN_9X)
--        GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
-+        GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
-       else
-         return ARES_ENOTFOUND;
- 

+ 1 - 1
patches/node/fixme_comment_trace_event_macro.patch

@@ -7,7 +7,7 @@ This broke the build at some point. Does it still? We should probably remove
 this patch and find out!
 
 diff --git a/src/node_internals.h b/src/node_internals.h
-index 54e24d41e25293d3535cd853eb5a80a7b0fee122..59b7e0c225a096acaa191bd144f876cc9a1c4432 100644
+index ab664208076ea776fcb2223dbc228cacd3eb7e58..4a1c3392cf53490bcb883e826bf731a4a674ef61 100644
 --- a/src/node_internals.h
 +++ b/src/node_internals.h
 @@ -372,10 +372,11 @@ class TraceEventScope {

+ 2 - 2
patches/node/make_module_globalpaths_a_reference.patch

@@ -10,10 +10,10 @@ node's module code.
 (cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
 
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index 99e0bdc5084ee81b690451b7c0b22ae3c445f1c0..f32af0aa2f4c10047d54cd9d3558f00a13257a24 100644
+index 17ee0324225393a55505ccaacdefc1aa2909a5a4..9cacdc77237d3399f5c939d21f77f3c7d4e88a2f 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -1199,8 +1199,8 @@ Module._initPaths = function() {
+@@ -1216,8 +1216,8 @@ Module._initPaths = function() {
  
    modulePaths = paths;
  

+ 3 - 3
patches/node/pass_all_globals_through_require.patch

@@ -6,10 +6,10 @@ Subject: Pass all globals through "require"
 (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
 
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index f32af0aa2f4c10047d54cd9d3558f00a13257a24..922dd136f655e9ef3b6812964146789b0a372ac4 100644
+index 9cacdc77237d3399f5c939d21f77f3c7d4e88a2f..768d13d018f75f12061f1d9e7d69fb47ddd3552d 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -106,6 +106,13 @@ const {
+@@ -110,6 +110,13 @@ const {
    CHAR_COLON
  } = require('internal/constants');
  
@@ -23,7 +23,7 @@ index f32af0aa2f4c10047d54cd9d3558f00a13257a24..922dd136f655e9ef3b6812964146789b
  const {
    isProxy
  } = require('internal/util/types');
-@@ -1071,10 +1078,12 @@ Module.prototype._compile = function(content, filename) {
+@@ -1080,10 +1087,12 @@ Module.prototype._compile = function(content, filename) {
    if (requireDepth === 0) statCache = new Map();
    if (inspectorWrapper) {
      result = inspectorWrapper(compiledWrapper, thisValue, exports,

+ 3 - 3
patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch

@@ -22,10 +22,10 @@ index 6d6ca2af629c41df68fe1a4652cf94fef30be038..e1f70addc28e4fe31d3a7089ecec3b58
  process.config = JSONParse(internalBinding('native_module').config);
  require('internal/worker/js_transferable').setup();
 diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
-index 922dd136f655e9ef3b6812964146789b0a372ac4..c614adc508c37b7f8250d53a6e113a973008933c 100644
+index 768d13d018f75f12061f1d9e7d69fb47ddd3552d..7fd217560ec465b893116df87916d422f384b55f 100644
 --- a/lib/internal/modules/cjs/loader.js
 +++ b/lib/internal/modules/cjs/loader.js
-@@ -67,7 +67,7 @@ const internalFS = require('internal/fs/utils');
+@@ -71,7 +71,7 @@ const internalFS = require('internal/fs/utils');
  const path = require('path');
  const { sep } = path;
  const { emitWarningSync } = require('internal/process/warning');
@@ -34,7 +34,7 @@ index 922dd136f655e9ef3b6812964146789b0a372ac4..c614adc508c37b7f8250d53a6e113a97
  const packageJsonReader = require('internal/modules/package_json_reader');
  const { safeGetenv } = internalBinding('credentials');
  const {
-@@ -160,7 +160,7 @@ function stat(filename) {
+@@ -164,7 +164,7 @@ function stat(filename) {
      const result = statCache.get(filename);
      if (result !== undefined) return result;
    }