electron/patches/node/feat_initialize_asar_support.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1,015 B
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 13 Sep 2018 08:56:07 -0700
Subject: feat: initialize asar support
chore: bump node to v12.16.1 (master) (#22168) * chore: bump node in DEPS to v12.16.0 * Fixup asar support setup patch https://github.com/nodejs/node/pull/30862 * Fixup InternalCallbackScope patch https://github.com/nodejs/node/pull/30236 * Fixup GN buildfiles patch https://github.com/nodejs/node/pull/30755 * Fixup low-level hooks patch https://github.com/nodejs/node/pull/30466 * Fixup globals require patch https://github.com/nodejs/node/pull/31643 * Fixup process stream patch https://github.com/nodejs/node/pull/30862 * Fixup js2c modification patch https://github.com/nodejs/node/pull/30755 * Fixup internal fs override patch https://github.com/nodejs/node/pull/30610 * Fixup context-aware warn patch https://github.com/nodejs/node/pull/30336 * Fixup Node.js with ltcg config https://github.com/nodejs/node/pull/29388 * Fixup oaepLabel patch https://github.com/nodejs/node/pull/30917 * Remove redundant ESM test patch https://github.com/nodejs/node/pull/30997 * Remove redundant cli flag patch https://github.com/nodejs/node/pull/30466 * Update filenames.json * Remove macro generation in GN build files https://github.com/nodejs/node/pull/30755 * Fix some compilation errors upstream * Add uvwasi to deps https://github.com/nodejs/node/pull/30258 * Fix BoringSSL incompatibilities * Fixup linked module patch https://github.com/nodejs/node/pull/30274 * Add missing sources to GN uv build https://github.com/libuv/libuv/pull/2347 * Patch some uvwasi incompatibilities * chore: bump Node.js to v12.6.1 * Remove mark_arraybuffer_as_untransferable.patch https://github.com/nodejs/node/pull/30549 * Fix uvwasi build failure on win * Fixup --perf-prof cli option error * Fixup early cjs module loading * fix: initialize diagnostics properly https://github.com/nodejs/node/pull/30025 * Disable new esm syntax specs https://github.com/nodejs/node/pull/30219 * Fixup v8 weakref hook spec https://github.com/nodejs/node/pull/29874 * Fix async context timer issue * Disable monkey-patch-main spec It relies on https://github.com/nodejs/node/pull/29777, and we don't override prepareStackTrace. * Disable new tls specs https://github.com/nodejs/node/pull/23188 We don't support much of TLS owing to schisms between BoringSSL and OpenSSL. Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-24 21:02:04 +00:00
This patch initializes asar support in Node.js.
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
chore: bump node to v16.17.0 (main) (#35350) * chore: bump node in DEPS to v16.17.0 * chore: fixup asar patch * lib: use null-prototype objects for property descriptors https://github.com/nodejs/node/pull/43270 * src: make SecureContext fields private https://github.com/nodejs/node/pull/43173 * crypto: remove Node.js-specific webcrypto extensions https://github.com/nodejs/node/pull/43310 * test: refactor to top-level await https://github.com/nodejs/node/pull/43500 * deps: cherry-pick two libuv fixes https://github.com/nodejs/node/pull/43950 * src: slim down env-inl.h https://github.com/nodejs/node/pull/43745 * util: add AggregateError.prototype.errors to inspect output https://github.com/nodejs/node/pull/43646 * esm: improve performance & tidy tests https://github.com/nodejs/node/pull/43784 * src: NodeArrayBufferAllocator delegates to v8's allocator https://github.com/nodejs/node/pull/43594 * chore: update patch indices * chore: update filenames * src: refactor IsSupportedAuthenticatedMode https://github.com/nodejs/node/pull/42368 * src: add --openssl-legacy-provider option https://github.com/nodejs/node/pull/40478 * lib,src: add source map support for global eval https://github.com/nodejs/node/pull/43428 * trace_events: trace net connect event https://github.com/nodejs/node/pull/43903 * deps: update ICU to 71.1 https://github.com/nodejs/node/pull/42655 This fails the test because it's missing https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3841093 * lib: give names to promisified exists() and question() https://github.com/nodejs/node/pull/43218 * crypto: add CFRG curves to Web Crypto API https://github.com/nodejs/node/pull/42507 * src: fix memory leak for v8.serialize https://github.com/nodejs/node/pull/42695 This test does not work for Electron as they do not use V8's ArrayBufferAllocator. * buffer: fix atob input validation https://github.com/nodejs/node/pull/42539 * src: fix ssize_t error from nghttp2.h https://github.com/nodejs/node/pull/44393 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-29 13:55:36 +00:00
index 337b95133bc94e395229211c9a00a055b279fcc9..25a8464e4833ff4655db2fe37f4bd482dc147865 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
chore: bump node to v16.17.0 (main) (#35350) * chore: bump node in DEPS to v16.17.0 * chore: fixup asar patch * lib: use null-prototype objects for property descriptors https://github.com/nodejs/node/pull/43270 * src: make SecureContext fields private https://github.com/nodejs/node/pull/43173 * crypto: remove Node.js-specific webcrypto extensions https://github.com/nodejs/node/pull/43310 * test: refactor to top-level await https://github.com/nodejs/node/pull/43500 * deps: cherry-pick two libuv fixes https://github.com/nodejs/node/pull/43950 * src: slim down env-inl.h https://github.com/nodejs/node/pull/43745 * util: add AggregateError.prototype.errors to inspect output https://github.com/nodejs/node/pull/43646 * esm: improve performance & tidy tests https://github.com/nodejs/node/pull/43784 * src: NodeArrayBufferAllocator delegates to v8's allocator https://github.com/nodejs/node/pull/43594 * chore: update patch indices * chore: update filenames * src: refactor IsSupportedAuthenticatedMode https://github.com/nodejs/node/pull/42368 * src: add --openssl-legacy-provider option https://github.com/nodejs/node/pull/40478 * lib,src: add source map support for global eval https://github.com/nodejs/node/pull/43428 * trace_events: trace net connect event https://github.com/nodejs/node/pull/43903 * deps: update ICU to 71.1 https://github.com/nodejs/node/pull/42655 This fails the test because it's missing https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3841093 * lib: give names to promisified exists() and question() https://github.com/nodejs/node/pull/43218 * crypto: add CFRG curves to Web Crypto API https://github.com/nodejs/node/pull/42507 * src: fix memory leak for v8.serialize https://github.com/nodejs/node/pull/42695 This test does not work for Electron as they do not use V8's ArrayBufferAllocator. * buffer: fix atob input validation https://github.com/nodejs/node/pull/42539 * src: fix ssize_t error from nghttp2.h https://github.com/nodejs/node/pull/44393 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-29 13:55:36 +00:00
@@ -94,6 +94,7 @@ function prepareMainThreadExecution(expandArgv1 = false,
chore: bump node to v12.16.1 (master) (#22168) * chore: bump node in DEPS to v12.16.0 * Fixup asar support setup patch https://github.com/nodejs/node/pull/30862 * Fixup InternalCallbackScope patch https://github.com/nodejs/node/pull/30236 * Fixup GN buildfiles patch https://github.com/nodejs/node/pull/30755 * Fixup low-level hooks patch https://github.com/nodejs/node/pull/30466 * Fixup globals require patch https://github.com/nodejs/node/pull/31643 * Fixup process stream patch https://github.com/nodejs/node/pull/30862 * Fixup js2c modification patch https://github.com/nodejs/node/pull/30755 * Fixup internal fs override patch https://github.com/nodejs/node/pull/30610 * Fixup context-aware warn patch https://github.com/nodejs/node/pull/30336 * Fixup Node.js with ltcg config https://github.com/nodejs/node/pull/29388 * Fixup oaepLabel patch https://github.com/nodejs/node/pull/30917 * Remove redundant ESM test patch https://github.com/nodejs/node/pull/30997 * Remove redundant cli flag patch https://github.com/nodejs/node/pull/30466 * Update filenames.json * Remove macro generation in GN build files https://github.com/nodejs/node/pull/30755 * Fix some compilation errors upstream * Add uvwasi to deps https://github.com/nodejs/node/pull/30258 * Fix BoringSSL incompatibilities * Fixup linked module patch https://github.com/nodejs/node/pull/30274 * Add missing sources to GN uv build https://github.com/libuv/libuv/pull/2347 * Patch some uvwasi incompatibilities * chore: bump Node.js to v12.6.1 * Remove mark_arraybuffer_as_untransferable.patch https://github.com/nodejs/node/pull/30549 * Fix uvwasi build failure on win * Fixup --perf-prof cli option error * Fixup early cjs module loading * fix: initialize diagnostics properly https://github.com/nodejs/node/pull/30025 * Disable new esm syntax specs https://github.com/nodejs/node/pull/30219 * Fixup v8 weakref hook spec https://github.com/nodejs/node/pull/29874 * Fix async context timer issue * Disable monkey-patch-main spec It relies on https://github.com/nodejs/node/pull/29777, and we don't override prepareStackTrace. * Disable new tls specs https://github.com/nodejs/node/pull/23188 We don't support much of TLS owing to schisms between BoringSSL and OpenSSL. Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-24 21:02:04 +00:00
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
loadPreloadModules();
initializeFrozenIntrinsics();
+ setupAsarSupport();
}
chore: bump node to v16.17.0 (main) (#35350) * chore: bump node in DEPS to v16.17.0 * chore: fixup asar patch * lib: use null-prototype objects for property descriptors https://github.com/nodejs/node/pull/43270 * src: make SecureContext fields private https://github.com/nodejs/node/pull/43173 * crypto: remove Node.js-specific webcrypto extensions https://github.com/nodejs/node/pull/43310 * test: refactor to top-level await https://github.com/nodejs/node/pull/43500 * deps: cherry-pick two libuv fixes https://github.com/nodejs/node/pull/43950 * src: slim down env-inl.h https://github.com/nodejs/node/pull/43745 * util: add AggregateError.prototype.errors to inspect output https://github.com/nodejs/node/pull/43646 * esm: improve performance & tidy tests https://github.com/nodejs/node/pull/43784 * src: NodeArrayBufferAllocator delegates to v8's allocator https://github.com/nodejs/node/pull/43594 * chore: update patch indices * chore: update filenames * src: refactor IsSupportedAuthenticatedMode https://github.com/nodejs/node/pull/42368 * src: add --openssl-legacy-provider option https://github.com/nodejs/node/pull/40478 * lib,src: add source map support for global eval https://github.com/nodejs/node/pull/43428 * trace_events: trace net connect event https://github.com/nodejs/node/pull/43903 * deps: update ICU to 71.1 https://github.com/nodejs/node/pull/42655 This fails the test because it's missing https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3841093 * lib: give names to promisified exists() and question() https://github.com/nodejs/node/pull/43218 * crypto: add CFRG curves to Web Crypto API https://github.com/nodejs/node/pull/42507 * src: fix memory leak for v8.serialize https://github.com/nodejs/node/pull/42695 This test does not work for Electron as they do not use V8's ArrayBufferAllocator. * buffer: fix atob input validation https://github.com/nodejs/node/pull/42539 * src: fix ssize_t error from nghttp2.h https://github.com/nodejs/node/pull/44393 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-29 13:55:36 +00:00
function refreshRuntimeOptions() {
@@ -584,6 +585,10 @@ function loadPreloadModules() {
}
}
+function setupAsarSupport() {
+ process._linkedBinding('electron_common_asar').initAsarSupport(require);
+}
+
module.exports = {
chore: bump node to v16.17.0 (main) (#35350) * chore: bump node in DEPS to v16.17.0 * chore: fixup asar patch * lib: use null-prototype objects for property descriptors https://github.com/nodejs/node/pull/43270 * src: make SecureContext fields private https://github.com/nodejs/node/pull/43173 * crypto: remove Node.js-specific webcrypto extensions https://github.com/nodejs/node/pull/43310 * test: refactor to top-level await https://github.com/nodejs/node/pull/43500 * deps: cherry-pick two libuv fixes https://github.com/nodejs/node/pull/43950 * src: slim down env-inl.h https://github.com/nodejs/node/pull/43745 * util: add AggregateError.prototype.errors to inspect output https://github.com/nodejs/node/pull/43646 * esm: improve performance & tidy tests https://github.com/nodejs/node/pull/43784 * src: NodeArrayBufferAllocator delegates to v8's allocator https://github.com/nodejs/node/pull/43594 * chore: update patch indices * chore: update filenames * src: refactor IsSupportedAuthenticatedMode https://github.com/nodejs/node/pull/42368 * src: add --openssl-legacy-provider option https://github.com/nodejs/node/pull/40478 * lib,src: add source map support for global eval https://github.com/nodejs/node/pull/43428 * trace_events: trace net connect event https://github.com/nodejs/node/pull/43903 * deps: update ICU to 71.1 https://github.com/nodejs/node/pull/42655 This fails the test because it's missing https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3841093 * lib: give names to promisified exists() and question() https://github.com/nodejs/node/pull/43218 * crypto: add CFRG curves to Web Crypto API https://github.com/nodejs/node/pull/42507 * src: fix memory leak for v8.serialize https://github.com/nodejs/node/pull/42695 This test does not work for Electron as they do not use V8's ArrayBufferAllocator. * buffer: fix atob input validation https://github.com/nodejs/node/pull/42539 * src: fix ssize_t error from nghttp2.h https://github.com/nodejs/node/pull/44393 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-29 13:55:36 +00:00
refreshRuntimeOptions,
patchProcessObject,