Instead of relying on a WASM build of postject to perform the injection, add LIEF as dependency and generate the SEA directly from core via a new CLI option --build-sea which takes the SEA config. This simplifies SEA generation for users and makes it easier to debug/maintain the SEA building process. PR-URL: https://github.com/nodejs/node/pull/61167 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
23 lines
633 B
JavaScript
23 lines
633 B
JavaScript
// This tests --build-sea when the config file contains invalid JSON.
|
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const tmpdir = require('../common/tmpdir');
|
|
const { skipIfBuildSEAIsNotSupported } = require('../common/sea');
|
|
const { writeFileSync } = require('fs');
|
|
const { spawnSyncAndAssert } = require('../common/child_process');
|
|
|
|
skipIfBuildSEAIsNotSupported();
|
|
|
|
tmpdir.refresh();
|
|
const config = tmpdir.resolve('invalid.json');
|
|
writeFileSync(config, '\n{\n"main"', 'utf8');
|
|
spawnSyncAndAssert(
|
|
process.execPath,
|
|
['--build-sea', config], {
|
|
cwd: tmpdir.path,
|
|
}, {
|
|
status: 1,
|
|
stderr: /INCOMPLETE_ARRAY_OR_OBJECT/,
|
|
});
|