Commit 9b7dd40
sea: implement execArgvExtension
This implements the execArgvExtension configuration field for SEA,
which takes one of three string values to specify whether and how
execution arguments can be extended for the SEA at run time:
* `"none"`: No extension is allowed. Only the arguments specified
in `execArgv` will be used,
and the `NODE_OPTIONS` environment variable will be ignored.
* `"env"`: _(Default)_ The `NODE_OPTIONS` environment variable can
extend the execution arguments.
This is the default behavior to maintain backward compatibility.
* `"cli"`: The executable can be launched with
`--node-options="--flag1 --flag2"`, and those flags
will be parsed as execution arguments for Node.js instead of being
passed to the user script. This allows using arguments that are
not supported by the `NODE_OPTIONS` environment variable.
PR-URL: #59560
Fixes: #55573
Fixes: nodejs/single-executable#100
Refs: #51688
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>1 parent d74799d commit 9b7dd40Copy full SHA for 9b7dd40
File tree
Expand file treeCollapse file tree
10 files changed
+372
-7
lines changedOpen diff view settings
Filter options
- doc/api
- src
- test
- fixtures
- sequential
Expand file treeCollapse file tree
10 files changed
+372
-7
lines changedOpen diff view settings
Collapse file
doc/api/single-executable-applications.md
Copy file name to clipboardExpand all lines: doc/api/single-executable-applications.md+37Lines changed: 37 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
180 | 180 | |
181 | 181 | |
182 | 182 | |
| 183 | + |
183 | 184 | |
184 | 185 | |
185 | 186 | |
| ||
314 | 315 | |
315 | 316 | |
316 | 317 | |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
| 328 | + |
| 329 | + |
| 330 | + |
| 331 | + |
| 332 | + |
| 333 | + |
| 334 | + |
| 335 | + |
| 336 | + |
| 337 | + |
| 338 | + |
| 339 | + |
| 340 | + |
| 341 | + |
| 342 | + |
| 343 | + |
| 344 | + |
| 345 | + |
| 346 | + |
| 347 | + |
| 348 | + |
| 349 | + |
| 350 | + |
| 351 | + |
| 352 | + |
| 353 | + |
317 | 354 | |
318 | 355 | |
319 | 356 | |
|
Collapse file
+11-1Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
989 | 989 | |
990 | 990 | |
991 | 991 | |
992 | | - |
| 992 | + |
| 993 | + |
| 994 | + |
| 995 | + |
| 996 | + |
| 997 | + |
| 998 | + |
| 999 | + |
| 1000 | + |
| 1001 | + |
| 1002 | + |
993 | 1003 | |
994 | 1004 | |
995 | 1005 | |
|
Collapse file
+74-5Lines changed: 74 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
7 | 7 | |
8 | 8 | |
9 | 9 | |
| 10 | + |
10 | 11 | |
11 | 12 | |
12 | 13 | |
| ||
86 | 87 | |
87 | 88 | |
88 | 89 | |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
89 | 95 | |
90 | 96 | |
91 | 97 | |
| ||
158 | 164 | |
159 | 165 | |
160 | 166 | |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
161 | 172 | |
162 | 173 | |
163 | 174 | |
| ||
212 | 223 | |
213 | 224 | |
214 | 225 | |
215 | | - |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
216 | 233 | |
217 | 234 | |
218 | 235 | |
| ||
297 | 314 | |
298 | 315 | |
299 | 316 | |
| 317 | + |
300 | 318 | |
301 | 319 | |
302 | 320 | |
303 | 321 | |
304 | 322 | |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
| 328 | + |
| 329 | + |
| 330 | + |
| 331 | + |
| 332 | + |
| 333 | + |
| 334 | + |
| 335 | + |
| 336 | + |
| 337 | + |
| 338 | + |
| 339 | + |
| 340 | + |
| 341 | + |
305 | 342 | |
306 | | - |
307 | | - |
| 343 | + |
| 344 | + |
| 345 | + |
| 346 | + |
308 | 347 | |
309 | 348 | |
310 | 349 | |
311 | 350 | |
312 | | - |
| 351 | + |
| 352 | + |
313 | 353 | |
314 | 354 | |
315 | 355 | |
316 | 356 | |
317 | 357 | |
318 | 358 | |
319 | | - |
| 359 | + |
| 360 | + |
| 361 | + |
| 362 | + |
| 363 | + |
| 364 | + |
| 365 | + |
320 | 366 | |
321 | 367 | |
322 | 368 | |
| ||
332 | 378 | |
333 | 379 | |
334 | 380 | |
| 381 | + |
335 | 382 | |
336 | 383 | |
337 | 384 | |
| ||
475 | 522 | |
476 | 523 | |
477 | 524 | |
| 525 | + |
| 526 | + |
| 527 | + |
| 528 | + |
| 529 | + |
| 530 | + |
| 531 | + |
| 532 | + |
| 533 | + |
| 534 | + |
| 535 | + |
| 536 | + |
| 537 | + |
| 538 | + |
| 539 | + |
| 540 | + |
| 541 | + |
| 542 | + |
| 543 | + |
| 544 | + |
| 545 | + |
478 | 546 | |
479 | 547 | |
480 | 548 | |
| ||
675 | 743 | |
676 | 744 | |
677 | 745 | |
| 746 | + |
678 | 747 | |
679 | 748 | |
680 | 749 | |
|
Collapse file
+9-1Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
34 | 40 | |
35 | 41 | |
| 42 | + |
36 | 43 | |
37 | 44 | |
38 | 45 | |
| ||
42 | 49 | |
43 | 50 | |
44 | 51 | |
45 | | - |
| 52 | + |
| 53 | + |
46 | 54 | |
47 | 55 | |
48 | 56 | |
|
Collapse file
test/fixtures/sea-exec-argv-extension-cli.js
Copy file name to clipboard+14Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
Collapse file
test/fixtures/sea-exec-argv-extension-env.js
Copy file name to clipboard+19Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
Collapse file
test/fixtures/sea-exec-argv-extension-none.js
Copy file name to clipboard+14Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
Collapse file
test/sequential/test-single-executable-application-exec-argv-extension-cli.js
Copy file name to clipboard+63Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
0 commit comments