-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
sea: add option to disable the experimental SEA warning #47588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nodejs-github-bot
merged 26 commits into
nodejs:main
from
RaisinTen:sea-add-option-to-disable-experimental-sea-warning
May 4, 2023
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4b66620
sea: add option to disable the experimental SEA warning
RaisinTen e69de9f
src: use string_views in JSONParser
RaisinTen ec57d90
src: proper Maybe usage in JSONParser
RaisinTen 4442309
src: add TODO for adding support for non-ASCII encoded string fields
RaisinTen f49d7ef
doc: use `disableExperimentalSEAWarning` in SEA example
RaisinTen ec0cdd6
sea: use a uint32_t bit field instead of bool disable_experimental_se…
RaisinTen a4af172
sea: use std::bitset instead of uint32_t
RaisinTen 41669e4
fixup! sea: use std::bitset instead of uint32_t
RaisinTen 2fd9f9a
fixup! fixup! sea: use std::bitset instead of uint32_t
RaisinTen 8bb2fed
sea: use the SeaFlags enum class instead of std::bitset
RaisinTen 457dfcd
sea: move flags before code in SeaResource struct
RaisinTen ff0a9c7
sea: expose only isExperimentalSeaWarningNeeded to JS from the binding
RaisinTen 8d67348
doc: omit false option from disableExperimentalSEAWarning doc
RaisinTen 5096a28
doc: omit disableExperimentalSEAWarning from the summary
RaisinTen 5ce2126
fixup! sea: expose only isExperimentalSeaWarningNeeded to JS from the…
RaisinTen 0ff4075
sea: check IsSingleExecutable value before calling FindSingleExecutab…
RaisinTen 305b7a6
src: support UTF8 fields in JSONParser
RaisinTen c2da60b
src: do proper Maybe usage
RaisinTen eb858c1
test: move single executable E2E tests to sequential
RaisinTen b3f437a
test: convert the SEA skips into a helper in test/common
RaisinTen 83f996b
fixup! test: convert the SEA skips into a helper in test/common
RaisinTen 5d21e60
Revert "src: do proper Maybe usage"
RaisinTen 009fe2f
src: define kHeaderSize and use it everywhere
RaisinTen d6642b7
test: wrap inject + code signing part into a helper
RaisinTen 3373bd5
fixup! test: wrap inject + code signing part into a helper
RaisinTen 2b5804e
fixup! src: define kHeaderSize and use it everywhere
RaisinTen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const fixtures = require('../common/fixtures'); | ||
|
||
const { readFileSync } = require('fs'); | ||
const { execFileSync } = require('child_process'); | ||
|
||
function skipIfSingleExecutableIsNotSupported() { | ||
if (!process.config.variables.single_executable_application) | ||
common.skip('Single Executable Application support has been disabled.'); | ||
|
||
if (!['darwin', 'win32', 'linux'].includes(process.platform)) | ||
common.skip(`Unsupported platform ${process.platform}.`); | ||
|
||
if (process.platform === 'linux' && process.config.variables.is_debug === 1) | ||
common.skip('Running the resultant binary fails with `Couldn\'t read target executable"`.'); | ||
|
||
if (process.config.variables.node_shared) | ||
common.skip('Running the resultant binary fails with ' + | ||
'`/home/iojs/node-tmp/.tmp.2366/sea: error while loading shared libraries: ' + | ||
'libnode.so.112: cannot open shared object file: No such file or directory`.'); | ||
|
||
if (process.config.variables.icu_gyp_path === 'tools/icu/icu-system.gyp') | ||
common.skip('Running the resultant binary fails with ' + | ||
'`/home/iojs/node-tmp/.tmp.2379/sea: error while loading shared libraries: ' + | ||
'libicui18n.so.71: cannot open shared object file: No such file or directory`.'); | ||
|
||
if (!process.config.variables.node_use_openssl || process.config.variables.node_shared_openssl) | ||
common.skip('Running the resultant binary fails with `Node.js is not compiled with OpenSSL crypto support`.'); | ||
|
||
if (process.config.variables.want_separate_host_toolset !== 0) | ||
common.skip('Running the resultant binary fails with `Segmentation fault (core dumped)`.'); | ||
|
||
if (process.platform === 'linux') { | ||
const osReleaseText = readFileSync('/etc/os-release', { encoding: 'utf-8' }); | ||
const isAlpine = /^NAME="Alpine Linux"/m.test(osReleaseText); | ||
if (isAlpine) common.skip('Alpine Linux is not supported.'); | ||
|
||
if (process.arch === 's390x') { | ||
common.skip('On s390x, postject fails with `memory access out of bounds`.'); | ||
} | ||
|
||
if (process.arch === 'ppc64') { | ||
common.skip('On ppc64, this test times out.'); | ||
} | ||
} | ||
} | ||
|
||
function injectAndCodeSign(targetExecutable, resource) { | ||
const postjectFile = fixtures.path('postject-copy', 'node_modules', 'postject', 'dist', 'cli.js'); | ||
execFileSync(process.execPath, [ | ||
postjectFile, | ||
targetExecutable, | ||
'NODE_SEA_BLOB', | ||
resource, | ||
'--sentinel-fuse', 'NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2', | ||
...process.platform === 'darwin' ? [ '--macho-segment-name', 'NODE_SEA' ] : [], | ||
]); | ||
|
||
if (process.platform === 'darwin') { | ||
execFileSync('codesign', [ '--sign', '-', targetExecutable ]); | ||
execFileSync('codesign', [ '--verify', targetExecutable ]); | ||
} else if (process.platform === 'win32') { | ||
let signtoolFound = false; | ||
try { | ||
execFileSync('where', [ 'signtool' ]); | ||
signtoolFound = true; | ||
} catch (err) { | ||
console.log(err.message); | ||
} | ||
if (signtoolFound) { | ||
let certificatesFound = false; | ||
try { | ||
execFileSync('signtool', [ 'sign', '/fd', 'SHA256', targetExecutable ]); | ||
certificatesFound = true; | ||
} catch (err) { | ||
if (!/SignTool Error: No certificates were found that met all the given criteria/.test(err)) { | ||
throw err; | ||
} | ||
} | ||
if (certificatesFound) { | ||
execFileSync('signtool', 'verify', '/pa', 'SHA256', targetExecutable); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = { | ||
skipIfSingleExecutableIsNotSupported, | ||
injectAndCodeSign, | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.