Commit Graph

17 Commits

Author SHA1 Message Date
Darshan Sen
6cd678965f
sea: add support for V8 bytecode-only caching
Refs: https://github.com/nodejs/single-executable/issues/73
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48191
Fixes: https://github.com/nodejs/single-executable/issues/73
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-07-26 10:10:35 +00:00
Joyee Cheung
ac34e7561a
src: support snapshot in single executable applications
This patch adds snapshot support to single executable applications.
To build a snapshot from the main script when preparing the
blob that will be injected into the single executable application,
add `"useSnapshot": true` to the configuration passed to
`--experimental-sea-config`. For example:

```
{
    "main": "snapshot.js",
    "output": "sea-prep.blob",
    "useSnapshot": true
}
```

The main script used to build the snapshot must invoke
`v8.startupSnapshot.setDeserializeMainFunction()` to configure the
entry point. The generated startup snapshot would be part of the
preparation blob and get injected into the final executable.

When the single executable application is launched, instead of running
the `main` script from scratch, Node.js would instead deserialize the
snapshot to get to the state initialized during build-time directly.

PR-URL: https://github.com/nodejs/node/pull/46824
Refs: https://github.com/nodejs/single-executable/discussions/57
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-07-20 22:57:00 +00:00
Yoav Vainrich
d9438ccbd8
doc: fix copy node executable in Windows
Windows where command lists all places it finds a pattern in Path.
The first one is the one that executes when called.
So the old code was overriding the first executable by any other match.

PR-URL: https://github.com/nodejs/node/pull/48624
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-07-06 19:28:59 +00:00
Antoine du Hamel
00fcff575e
doc: add version info on the SEA docs
PR-URL: https://github.com/nodejs/node/pull/48173
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2023-05-25 15:54:46 +00:00
Darshan Sen
a7a1fc5e0b
test,doc,sea: run SEA tests on ppc64
The recent Postject upgrade, https://github.com/nodejs/node/pull/48072,
included a performance improvement for the injection operation
(see https://github.com/nodejs/postject/pull/86), so now it might be
possible to run the SEA tests on the ppc64 architecture runners on
Jenkins, which was previously getting timed out.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/48111
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-05-24 10:49:05 +00:00
Rich Trott
c7fe303eaf
doc: update SEA source link
The code was moved in 3803b028d so the current source link is broken
in our docs.

PR-URL: https://github.com/nodejs/node/pull/48080
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-05-21 18:10:07 +00:00
Alex Schwartz
e49bb6851c doc: correct line break for Windows terminals
PR-URL: https://github.com/nodejs/node/pull/48083
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
2023-05-21 09:05:16 -07:00
Antoine du Hamel
30870d126b
doc: fix Windows code snippet tags
Those were wrongly marked as `bash`, when the text around it was
referencing PowerShell or Command Prompt.

PR-URL: https://github.com/nodejs/node/pull/48100
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
2023-05-21 11:27:16 +00:00
Antoine du Hamel
260092eca3
doc: harmonize fenced code snippet flags
We had a few code snippets that were using a non-descriptive tag (e.g.
`console` or `text`), whereas the actual language it's using describes
it better, and improves the syntax highlighting. This commit also
removes non-necessary leading chars (e.g. `$`, `>`, or `%`) to make it
easier for readers to copy and paste to try the command themselves.

PR-URL: https://github.com/nodejs/node/pull/48082
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2023-05-21 09:36:57 +02:00
Darshan Sen
2de10f5149
sea: add option to disable the experimental SEA warning
Refs: https://github.com/nodejs/single-executable/discussions/60
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/47588
Fixes: https://github.com/nodejs/node/issues/47741
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-05-04 15:27:54 +00:00
XLor
d225d95758 doc: add copy node executable guide on windows
PR-URL: https://github.com/nodejs/node/pull/47781
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-05-01 17:41:02 +05:30
Xuguang Mei
a75959b1bc
doc: mark signing the binary is macOS and Windows only in SEA
PR-URL: https://github.com/nodejs/node/pull/47722
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2023-04-28 09:02:55 +00:00
Joyee Cheung
491a5c968f
sea: use JSON configuration and blob content for SEA
PR-URL: https://github.com/nodejs/node/pull/47125
Refs: https://github.com/nodejs/single-executable/discussions/58
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-04-09 18:31:15 +00:00
Darshan Sen
86c831f643
doc,test: extend the list of platforms supported by single-executables
Now that https://github.com/nodejs/node/pull/46934 has landed, we can
extend the list of platforms and architectures where we can run the
single-executable test.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/47026
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-03-11 08:58:52 +00:00
Darshan Sen
4cde39e817
doc: add steps about signing the binary in single-executable docs
We didn't catch this in https://github.com/nodejs/node/pull/45038
because the binary wasn't signed by default unlike the official Node.js
binary, which is signed by the Node.js Foundation identity by default.

Refs: https://github.com/nodejs/postject/issues/76 (macOS arm64 part only)
Fixes: https://github.com/nodejs/postject/issues/75
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46764
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-26 12:26:40 +05:30
Myles Borins
89322aed7e
2023-02-21, Version 19.7.0 (Current)
Notable changes:

deps:
  * upgrade npm to 9.5.0 (npm team) https://github.com/nodejs/node/pull/46673
  * add ada as a dependency (Yagiz Nizipli) https://github.com/nodejs/node/pull/46410
doc:
  * add debadree25 to collaborators (Debadree Chatterjee) https://github.com/nodejs/node/pull/46716
  * add deokjinkim to collaborators (Deokjin Kim) https://github.com/nodejs/node/pull/46444
doc,lib,src,test:
  * rename --test-coverage (Colin Ihrig) https://github.com/nodejs/node/pull/46017
lib:
  * (SEMVER-MINOR) add aborted() utility function (Debadree Chatterjee) https://github.com/nodejs/node/pull/46494
src:
  * (SEMVER-MINOR) add initial support for single executable applications (Darshan Sen) https://github.com/nodejs/node/pull/45038
  * (SEMVER-MINOR) allow optional Isolate termination in node::Stop() (Shelley Vohr) https://github.com/nodejs/node/pull/46583
  * (SEMVER-MINOR) allow blobs in addition to `FILE*`s in embedder snapshot API (Anna Henningsen) https://github.com/nodejs/node/pull/46491
  * (SEMVER-MINOR) allow snapshotting from the embedder API (Anna Henningsen) https://github.com/nodejs/node/pull/45888
  * (SEMVER-MINOR) make build_snapshot a per-Isolate option, rather than a global one (Anna Henningsen) https://github.com/nodejs/node/pull/45888
  * (SEMVER-MINOR) add snapshot support for embedder API (Anna Henningsen) https://github.com/nodejs/node/pull/45888
  * (SEMVER-MINOR) allow embedder control of code generation policy (Shelley Vohr) https://github.com/nodejs/node/pull/46368
stream:
  * (SEMVER-MINOR) add abort signal for ReadableStream and WritableStream (Debadree Chatterjee) https://github.com/nodejs/node/pull/46273
test_runner:
  * add initial code coverage support (Colin Ihrig) https://github.com/nodejs/node/pull/46017
url:
  * replace url-parser with ada (Yagiz Nizipli) https://github.com/nodejs/node/pull/46410

PR-URL: https://github.com/nodejs/node/pull/46725
2023-02-21 13:12:58 -05:00
Darshan Sen
9bbde3d7ba
src: add initial support for single executable applications
Compile a JavaScript file into a single executable application:

```console
$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js

$ cp $(command -v node) hello

$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2

$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
    --macho-segment-name NODE_JS

$ ./hello world
Hello, world!
```

Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-02-18 02:49:18 +00:00