From fbcbdb051beace27c992cf803031daa1e0bf60d5 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 17 Jul 2019 12:33:41 -0700 Subject: [PATCH] build: remove unused node patches (#19296) --- patches/node/.patches | 2 -- ...f_original-fs_and_custom_embedder_js.patch | 3 ++- ...owserglobals_from_global_not_process.patch | 8 ++++--- patches/node/export_nativemodule.patch | 22 ------------------ ...o_change_nobrowserglobals_at_runtime.patch | 23 ------------------- ...dder_overriding_of_internal_fs_calls.patch | 2 +- 6 files changed, 8 insertions(+), 52 deletions(-) delete mode 100644 patches/node/export_nativemodule.patch delete mode 100644 patches/node/fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch diff --git a/patches/node/.patches b/patches/node/.patches index f0a074eca8bb..c4f6cd2dfcaf 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -3,7 +3,6 @@ fix_don_t_create_console_window_when_creating_process.patch refactor_alter_child_process_fork_to_use_execute_script_with.patch feat_add_uv_loop_watcher_queue_code.patch feat_initialize_asar_support.patch -export_nativemodule.patch expose_get_builtin_module_function.patch fix_expose_traceeventhelper.patch fix_build_and_expose_inspector_agent.patch @@ -23,7 +22,6 @@ fixme_remove_async_id_assertion_check.patch src_use_check_false_in_switch_default_case.patch fixme_comment_trace_event_macro.patch fix_export_node_abort_and_assert.patch -fix_make_it_possible_to_change_nobrowserglobals_at_runtime.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 diff --git a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch index 89d603707a71..eba5b65899b7 100644 --- a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch +++ b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch @@ -1,7 +1,8 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 11 Apr 2019 17:16:13 +0900 -Subject: build: modify js2c.py to allow injection of original-fs and custom embedder JS +Subject: build: modify js2c.py to allow injection of original-fs and custom + embedder JS This patch does two things: * Updates js2c.py so that original-fs is automatically created with diff --git a/patches/node/chore_read_nobrowserglobals_from_global_not_process.patch b/patches/node/chore_read_nobrowserglobals_from_global_not_process.patch index 36b365d11789..5c53bb1b6212 100644 --- a/patches/node/chore_read_nobrowserglobals_from_global_not_process.patch +++ b/patches/node/chore_read_nobrowserglobals_from_global_not_process.patch @@ -1,18 +1,20 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 15 Jul 2019 17:45:02 -0700 -Subject: chore: read _noBrowserGlobals from global not process +Subject: chore: read _noBrowserGlobals from global not config +This is used so that we can modify the flag at runtime where +config can only be set at compile time. diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js -index 6f096ff3abce7d4b08a174a159217a9ac012f2b2..48c430e966e449397475887b4a65b9aea9021924 100644 +index 60c0bd845b18cd782d5b314f339e0c4e7bf88388..48c430e966e449397475887b4a65b9aea9021924 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -168,7 +168,7 @@ const { queueMicrotask } = require('internal/process/task_queues'); --if (!process._noBrowserGlobals) { +-if (!config.noBrowserGlobals) { +if (!global._noBrowserGlobals) { // Override global console from the one provided by the VM // to the one implemented by Node.js diff --git a/patches/node/export_nativemodule.patch b/patches/node/export_nativemodule.patch deleted file mode 100644 index 0bd7e87751af..000000000000 --- a/patches/node/export_nativemodule.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Cheng Zhao -Date: Sun, 27 Mar 2016 14:43:14 +0900 -Subject: Export NativeModule - -This is used by atom for doing module compile cache. - -(cherry picked from commit 83b45fddb9a36c1376f7a2b5c70717e37b6f0133) - -diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js -index bf63de07613b4d19d95607f404139e587319f11d..b99858fa9df3d817fb7a4614366154e4fbc560c8 100644 ---- a/lib/internal/bootstrap/loaders.js -+++ b/lib/internal/bootstrap/loaders.js -@@ -168,6 +168,8 @@ NativeModule.exposeInternals = function() { - } - }; - -+process.NativeModule = NativeModule; -+ - const { - moduleIds, - compileFunction diff --git a/patches/node/fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch b/patches/node/fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch deleted file mode 100644 index 4c9835ea465e..000000000000 --- a/patches/node/fix_make_it_possible_to_change_nobrowserglobals_at_runtime.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Cheng Zhao -Date: Fri, 29 Mar 2019 16:21:42 +0900 -Subject: fix: make it possible to change noBrowserGlobals at runtime - -This is a temporary hack in responding to Node's change: -https://github.com/nodejs/node/pull/26228 - -We need to figure out a better solution. - -diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js -index 8dee38a0e71698258bee7642f9b91c5c8b9060c2..1cdf79dfaa9aecc4ac3bcb05212514929b80603d 100644 ---- a/lib/internal/bootstrap/node.js -+++ b/lib/internal/bootstrap/node.js -@@ -164,7 +164,7 @@ const { - queueMicrotask - } = require('internal/process/task_queues'); - --if (!config.noBrowserGlobals) { -+if (!process._noBrowserGlobals) { - // Override global console from the one provided by the VM - // to the one implemented by Node.js - // https://console.spec.whatwg.org/#console-namespace diff --git a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch index 6f747309e207..75a8d10b6a97 100644 --- a/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch +++ b/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch @@ -5,7 +5,7 @@ Subject: refactor: allow embedder overriding of internal FS calls diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js -index 1cdf79dfaa9aecc4ac3bcb05212514929b80603d..6f096ff3abce7d4b08a174a159217a9ac012f2b2 100644 +index 8dee38a0e71698258bee7642f9b91c5c8b9060c2..60c0bd845b18cd782d5b314f339e0c4e7bf88388 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -65,6 +65,10 @@ if (ownsProcessState) {