Skip to content

Commit

Permalink
chore: fixup patch indices
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Nov 29, 2023
1 parent 828846c commit b8986d8
Show file tree
Hide file tree
Showing 32 changed files with 165 additions and 167 deletions.
3 changes: 1 addition & 2 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This adds GN build files for Node, so we don't have to build with GYP.

diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..e2b19b7500b4710e3a55e08f662d989c18272b70
index 0000000000000000000000000000000000000000..cf4f9b577010ee1e3122bdc1097dfecdfc063b43
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,358 @@
Expand Down Expand Up @@ -2350,4 +2350,3 @@ index 11616e1bcac5308020eb68fdb811bfb86cb14dd5..845e6ce69d93983963a7a57117ecab3b

if 'false' == variables.get('node_shared_libuv'):
subdir_files('deps/uv/include', 'include/node/', action)

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new
This should not be upstreamed, it is a quality-of-life patch for downstream module builders.

diff --git a/common.gypi b/common.gypi
index 62cb46b328871d929f16ced2a4741bc6e6b004db..53ab7c255317d2280e2579435bc7097705f19c6e 100644
index a04a4a4e108862b64725345beaba73ad6f69eb51..f1c36cfd697485564f0fe7998eaf924aa30f140b 100644
--- a/common.gypi
+++ b/common.gypi
@@ -79,6 +79,8 @@
Expand Down Expand Up @@ -40,10 +40,10 @@ index 62cb46b328871d929f16ced2a4741bc6e6b004db..53ab7c255317d2280e2579435bc70977
'defines': [
'V8_COMPRESS_POINTERS',
diff --git a/configure.py b/configure.py
index 875d83e5db0037b902cff03c74852ea347513b03..8776cd057607ffe913bdd822a0aed5f9f1aa4a7a 100755
index 7b80ec63a082ce93ba81ca6dd41ec03041534ff7..926659883d3bd6d447c89a50d6770988b59d6f88 100755
--- a/configure.py
+++ b/configure.py
@@ -1524,6 +1524,7 @@ def configure_library(lib, output, pkgname=None):
@@ -1484,6 +1484,7 @@ def configure_library(lib, output, pkgname=None):


def configure_v8(o):
Expand All @@ -52,7 +52,7 @@ index 875d83e5db0037b902cff03c74852ea347513b03..8776cd057607ffe913bdd822a0aed5f9
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
diff --git a/src/node.h b/src/node.h
index c4cce244359d893acf31e78f935152d4d47b14cd..26368061a909e6abc62a4cf261a5dbbd79404f1a 100644
index 99d2e1384df4000d4e1f1ffeafa83d29a152054b..9ac0d5addcdd40d5c91d375b626099b95729548a 100644
--- a/src/node.h
+++ b/src/node.h
@@ -22,6 +22,12 @@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Aligns common.gypi with the current build flag state of //v8.
Specifically enables `V8_ENABLE_SANDBOX`, `V8_SANDBOXED_POINTERS`, `V8_COMPRESS_POINTERS` and `V8_COMPRESS_POINTERS_IN_SHARED_CAGE`.

diff --git a/common.gypi b/common.gypi
index 10d11f1e9aacfbe4bb53e1220afab1e68db98313..62cb46b328871d929f16ced2a4741bc6e6b004db 100644
index 0b073571cd482d5124123c4490c564f839429b28..a04a4a4e108862b64725345beaba73ad6f69eb51 100644
--- a/common.gypi
+++ b/common.gypi
@@ -65,6 +65,7 @@
Expand Down Expand Up @@ -42,10 +42,10 @@ index 10d11f1e9aacfbe4bb53e1220afab1e68db98313..62cb46b328871d929f16ced2a4741bc6
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}],
diff --git a/configure.py b/configure.py
index 7006ee65816989976b1648374565ebbae4b188f1..875d83e5db0037b902cff03c74852ea347513b03 100755
index 62f041ce52bf85136175e733216671e2811a337b..7b80ec63a082ce93ba81ca6dd41ec03041534ff7 100755
--- a/configure.py
+++ b/configure.py
@@ -1537,6 +1537,7 @@ def configure_v8(o):
@@ -1497,6 +1497,7 @@ def configure_v8(o):
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ index 9f2fbc1e53937448aa27c1f5fe110eabc7edc0df..ba0c926a7968ec6a4cf07a469f1fd931

std::vector<std::string_view> GetBuiltinIds() const;
diff --git a/tools/js2c.cc b/tools/js2c.cc
index 904fb6fa44d4f56fb67476e937edcbb797d78fe7..28dc4b59898fb5ac02dc55f930613f7a46a8a66e 100644
index 904fb6fa44d4f56fb67476e937edcbb797d78fe7..69078f3c2fcaab9f1b22d28c797a7e4cceb0646c 100644
--- a/tools/js2c.cc
+++ b/tools/js2c.cc
@@ -29,6 +29,7 @@ namespace js2c {
Expand Down Expand Up @@ -153,7 +153,7 @@ index 904fb6fa44d4f56fb67476e937edcbb797d78fe7..28dc4b59898fb5ac02dc55f930613f7a
+ // std::equal(prefix.begin(), prefix.end(), toCheck.begin())?
+ std::string original_fs_filename = filename;
+ std::replace(original_fs_filename.begin(), original_fs_filename.end(), "internal/fs/", "internal/original-fs/");
+
+
+ std::function<std::vector<char>(const std::vector<char>&)> ReadFileTransform = [](const char* path, size_t size, int* error) {
+ std::vector<char> code = ReadFileSync(path, size, &error);
+ std::replace(code.begin(), code.end(), "require('fs')", "require('original-fs')");
Expand Down Expand Up @@ -243,4 +243,3 @@ index 904fb6fa44d4f56fb67476e937edcbb797d78fe7..28dc4b59898fb5ac02dc55f930613f7a

return JS2C(js_it->second, mjs_it->second, gypi_it->second[0], output);
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ modules from being used in the renderer process. This should be upstreamed as
a customizable error message.

diff --git a/src/node_binding.cc b/src/node_binding.cc
index a82763cc5ad47f25b63b8c72e08bdc09ab841448..eb25fb4a81f53e2e443d0276bb1acbbf5700533a 100644
index 8cdee730101fbdc79415654aa6fe401573979c0e..34d5e146ffef255019dd33d8c23b0847d91ddee9 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -4,6 +4,7 @@
Expand All @@ -19,7 +19,7 @@ index a82763cc5ad47f25b63b8c72e08bdc09ab841448..eb25fb4a81f53e2e443d0276bb1acbbf
#include "util.h"

#include <string>
@@ -481,7 +482,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
@@ -480,7 +481,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
if (mp->nm_context_register_func == nullptr) {
if (env->force_context_aware()) {
dlib->Close();
Expand Down
Original file line number Diff line number Diff line change
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/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 001343b74ce236f89dca030c0fc9dd0299df0b39..6f277daf4ce846f093f634c473daec07939b4558 100644
index 84fea979d482d3d5cacfad4b09237e6345675cad..678ed0a7b43c30c5dd6102d83f490e23c95090ce 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1230,6 +1230,13 @@ Module.prototype._compile = function(content, filename) {
@@ -1215,6 +1215,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 All @@ -26,10 +26,10 @@ index 001343b74ce236f89dca030c0fc9dd0299df0b39..6f277daf4ce846f093f634c473daec07
try {
resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
index fcbd9ee1af002bc176937e6bb5af55791b2f64b2..cbfb6e3620a7e77658c86a4730c50661b8a937f7 100644
index 0dc769846b4e6fe84438cd6d8024c4a89eb90a9b..bff9bdc7ad58183e9eb04ee45b76592b4240952a 100644
--- a/lib/internal/process/pre_execution.js
+++ b/lib/internal/process/pre_execution.js
@@ -164,11 +164,13 @@ function patchProcessObject(expandArgv1) {
@@ -204,11 +204,13 @@ function patchProcessObject(expandArgv1) {
if (expandArgv1 && process.argv[1] &&
!StringPrototypeStartsWith(process.argv[1], '-')) {
// Expand process.argv[1] into a full path.
Expand Down
6 changes: 3 additions & 3 deletions patches/node/chore_expose_importmoduledynamically_and.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ index 985784383024450833a8324d45a7af2fe214a09c..524558b6d00969c2b62cd6050fde9de5

function isLoaderWorker() {
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 0645b3ddf506df2a76f5661f0ec6bb35d5d8b94e..e0f1b2d51f3055b2250f2c0dc1dfd1048b645dd9 100644
index a1b0f812391486c5a429398326091a30bbe81692..a316d077f2d2ff38564959345cf8ef29a3ac678f 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -547,7 +547,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
Expand All @@ -43,7 +43,7 @@ index 0645b3ddf506df2a76f5661f0ec6bb35d5d8b94e..e0f1b2d51f3055b2250f2c0dc1dfd104
Local<Context> context,
Local<v8::Data> host_defined_options,
Local<Value> resource_name,
@@ -629,12 +629,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
@@ -610,12 +610,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
Environment* env = Environment::GetCurrent(args);
HandleScope handle_scope(isolate);

Expand All @@ -59,7 +59,7 @@ index 0645b3ddf506df2a76f5661f0ec6bb35d5d8b94e..e0f1b2d51f3055b2250f2c0dc1dfd104
}

void ModuleWrap::HostInitializeImportMetaObjectCallback(
@@ -665,13 +666,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
@@ -652,13 +653,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
Environment* env = Environment::GetCurrent(args);
Isolate* isolate = env->isolate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This patch can be removed when Node.js upgrades to a version of V8 containing
the above CL.

diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
index 3b406703ce9f981411cd9de5379f8574384e170a..bc439ce0aa072a778a22ba860eed35263740a1cd 100644
index 942d7cc1305eb4cf327de5666551435802f0dbac..991c65215488b9526758b9aca96842ad17fc018e 100644
--- a/lib/.eslintrc.yaml
+++ b/lib/.eslintrc.yaml
@@ -33,10 +33,6 @@ rules:
Expand All @@ -24,10 +24,10 @@ index 3b406703ce9f981411cd9de5379f8574384e170a..bc439ce0aa072a778a22ba860eed3526
message: Use `const { Blob } = require('buffer');` instead of the global.
- name: BroadcastChannel
diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js
index 7fbfb64984c290a1d71c99c92084975c31ce18fe..be4d82086199855a10108528b3dacc663b839454 100644
index 12ae4a9b23212d3f8ff1566a1c2b815a47d3838a..4460042d7bfbb8286a9b2abcbfb9e44f21b5d944 100644
--- a/lib/internal/main/worker_thread.js
+++ b/lib/internal/main/worker_thread.js
@@ -108,7 +108,7 @@ port.on('message', (message) => {
@@ -112,7 +112,7 @@ port.on('message', (message) => {

require('internal/worker').assignEnvironmentData(environmentData);

Expand All @@ -37,10 +37,10 @@ index 7fbfb64984c290a1d71c99c92084975c31ce18fe..be4d82086199855a10108528b3dacc66
// not to workers created by other workers.
let cachedCwd = '';
diff --git a/lib/internal/worker.js b/lib/internal/worker.js
index 3d828d2f6f2b19554f7fc01ea880c0c144d8837d..78fcaec8d694580798783c83c3282ec1aaac4aa7 100644
index 401bc43550ea7f19847dfd588e3fba0507243905..560f69c6c2de2bd976bcd62cd7ac9c770b838446 100644
--- a/lib/internal/worker.js
+++ b/lib/internal/worker.js
@@ -93,8 +93,7 @@ let cwdCounter;
@@ -101,8 +101,7 @@ let cwdCounter;
const environmentData = new SafeMap();

// SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer.
Expand Down
4 changes: 2 additions & 2 deletions patches/node/chore_remove_use_of_deprecated_kmaxlength.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ index 606a6f5caa3b11b6d2a9068ed2fd65800530a5eb..080dcce21da05ccea398d8a856deb397
typedef void (*FreeCallback)(char* data, void* hint);

diff --git a/src/node_errors.h b/src/node_errors.h
index 1687eed35717ae385aedad952c03ebab4f0f3bf7..4cd96bf9dd721ec24dd5f23086da5b72be58d0a9 100644
index 569dafe82df83db02d93b0e58231ef804eb54be8..c6b8c3b5b36ea25a31bdf3c6a48ef20f3c1b6577 100644
--- a/src/node_errors.h
+++ b/src/node_errors.h
@@ -208,7 +208,7 @@ inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
@@ -218,7 +218,7 @@ inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
char message[128];
snprintf(message, sizeof(message),
"Cannot create a Buffer larger than 0x%zx bytes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ which causes the `ELECTRON_RUN_AS_NODE` variable to be lost. This patch
re-injects it.

diff --git a/test/common/assertSnapshot.js b/test/common/assertSnapshot.js
index c403751ac3ef5e39e7c0b1a1a8fb704ebf843dd7..83ee45f5f906adddcbc701112f373332dd1f66f9 100644
index 0bd0fc18534f8b3106b79a010dfc4ffe0ab17ec3..838ee86f74ea89e052676a5c25e23481369857fa 100644
--- a/test/common/assertSnapshot.js
+++ b/test/common/assertSnapshot.js
@@ -62,6 +62,7 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
@@ -76,6 +76,7 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
const flags = common.parseTestFlags(filename);
const executable = tty ? 'tools/pseudo-tty.py' : process.execPath;
const args = tty ? [process.execPath, ...flags, filename] : [...flags, filename];
Expand Down
2 changes: 1 addition & 1 deletion patches/node/enable_crashpad_linux_node_processes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used
by the crashpad client to connect with the handler process.

diff --git a/lib/child_process.js b/lib/child_process.js
index ec39a00ddb791e6e1ebe31aa45d290e7dcc4ebfc..1cd5d8969471b276211c45a9d8d76e9b10b1bb66 100644
index 9dd33ecbac3a5d516f9bff76fdbe1a8aece531f2..0464ecc7b53389cdff97a7fe4cb01582e8b72dbb 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -61,6 +61,7 @@ let debug = require('internal/util/debuglog').debuglog(
Expand Down
8 changes: 4 additions & 4 deletions patches/node/expose_get_builtin_module_function.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ modules to sandboxed renderers.
TODO(codebytere): remove and replace with a public facing API.

diff --git a/src/node_binding.cc b/src/node_binding.cc
index 259ce86b4c443c960dae6cb1c9d6c62b9ff23b30..a82763cc5ad47f25b63b8c72e08bdc09ab841448 100644
index 97257d47c6173872e55facf6f92801bd2fc3564b..8cdee730101fbdc79415654aa6fe401573979c0e 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -620,6 +620,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
@@ -638,6 +638,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(exports);
}

Expand All @@ -24,10 +24,10 @@ index 259ce86b4c443c960dae6cb1c9d6c62b9ff23b30..a82763cc5ad47f25b63b8c72e08bdc09
Environment* env = Environment::GetCurrent(args);

diff --git a/src/node_binding.h b/src/node_binding.h
index 32106afb0b7260b297c0e1a94527e03ed6039ee0..62a7473f64a618bb631b08cd5a32a1bcaa296aa8 100644
index 9f0692ca4e190bde251d4825aa9abac3d66b6ac6..f4024a05901f72f85e097a8ab6ddbd5812e9ba16 100644
--- a/src/node_binding.h
+++ b/src/node_binding.h
@@ -98,6 +98,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -134,6 +134,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Subject: feat: add kNoStartDebugSignalHandler to Environment to prevent
This patch should be upstreamed, it allows embedders to prevent the call to StartDebugSignalHandler which handles SIGUSR1 and starts the inspector agent. Apps that have --inspect disabled also don't want SIGUSR1 to have this affect.

diff --git a/src/env-inl.h b/src/env-inl.h
index 7ceab0da0c632f857f6e2d0fbf479bbc4f55df07..debd982c75805c51ea7d01229b9d635550060503 100644
index 793dc72e0dbad819a1c3a51521b4a39b76c7015d..222c78ef0cb9904742fd44f8182278ab1f50cd59 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -627,6 +627,10 @@ inline bool Environment::no_global_search_paths() const {
@@ -677,6 +677,10 @@ inline bool Environment::no_global_search_paths() const {
!options_->global_search_paths;
}

Expand All @@ -22,10 +22,10 @@ index 7ceab0da0c632f857f6e2d0fbf479bbc4f55df07..debd982c75805c51ea7d01229b9d6355
// configure --no-browser-globals
#ifdef NODE_NO_BROWSER_GLOBALS
diff --git a/src/env.h b/src/env.h
index b67a476701f9bd8abdfc0ef9cfe800e84fb8f8c2..45a9a7811b4abe1effb6acf2c89a772a7c2256c9 100644
index afe67d2237ae6933de44dd1141cf388e9a48cee3..87df6e1f32e584aa0c6ae21856299fff31d67669 100644
--- a/src/env.h
+++ b/src/env.h
@@ -748,6 +748,7 @@ class Environment : public MemoryRetainer {
@@ -787,6 +787,7 @@ class Environment : public MemoryRetainer {
inline bool tracks_unmanaged_fds() const;
inline bool hide_console_windows() const;
inline bool no_global_search_paths() const;
Expand All @@ -34,10 +34,10 @@ index b67a476701f9bd8abdfc0ef9cfe800e84fb8f8c2..45a9a7811b4abe1effb6acf2c89a772a
inline uint64_t thread_id() const;
inline worker::Worker* worker_context() const;
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index b1ba86b7b0b2349f771e01143630e45cf0aecc3b..4c9f7f636aeeb19a87150ac5a05e28159503f051 100644
index f0b4cc43c864aee1fab8e073ea110ea108c653ab..6d12e27b955fb9fddab24d846e563c969bb48ae7 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -703,8 +703,10 @@ bool Agent::Start(const std::string& path,
@@ -707,8 +707,10 @@ bool Agent::Start(const std::string& path,
StartIoThreadAsyncCallback));
uv_unref(reinterpret_cast<uv_handle_t*>(&start_io_thread_async));
start_io_thread_async.data = this;
Expand All @@ -51,10 +51,10 @@ index b1ba86b7b0b2349f771e01143630e45cf0aecc3b..4c9f7f636aeeb19a87150ac5a05e2815
parent_env_->AddCleanupHook([](void* data) {
Environment* env = static_cast<Environment*>(data);
diff --git a/src/node.h b/src/node.h
index b50bd5a941d381778d464fdb2770566a3ac34fed..c4cce244359d893acf31e78f935152d4d47b14cd 100644
index dcce529664e1d126115545d6ba7f5b8492b0e921..99d2e1384df4000d4e1f1ffeafa83d29a152054b 100644
--- a/src/node.h
+++ b/src/node.h
@@ -575,7 +575,11 @@ enum Flags : uint64_t {
@@ -654,7 +654,11 @@ enum Flags : uint64_t {
// This control is needed by embedders who may not want to initialize the V8
// inspector in situations where one has already been created,
// e.g. Blink's in Chromium.
Expand Down

0 comments on commit b8986d8

Please sign in to comment.