Comments (5)
@nodejs/single-executable
from postject.
I had the same problem, but found the bug and have a workaround. For me the problem was that I had the sentinel fuse inside of the package.json and this was included in the blob. This in turn confuses if (firstSentinel !== lastSentinel) {
as this is indeed not true, even if the that fuse was not used.
I fixed it by base64 encoding the string and in the command decode it before using
from postject.
Same on Darwin 23.1.0 with node v21.5.0, injection fails.
I also tested v22.0.0-nightly20240104084d761dfc, which injection appears to be succeeded but the produced binary still doesn't work.
...
➜ npx postject hello NODE_SEA_BLOB sea-prep.blob \
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
--macho-segment-name NODE_SEA
npm WARN cli npm v10.2.4 does not support Node.js v22.0.0-nightly20240104084d761dfc. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.
Start injection of NODE_SEA_BLOB in hello...
💉 Injection done!
➜ ./hello world
zsh: killed ./hello world
from postject.
.../postject/dist/api.js
...
const buffer = Buffer.from(data.buffer);
const firstSentinel = buffer.indexOf(sentinelFuse);
if (firstSentinel === -1) {
throw new Error(
`Could not find the sentinel ${sentinelFuse} in the binary`
);
}
const lastSentinel = buffer.lastIndexOf(sentinelFuse);
// if (firstSentinel !== lastSentinel) {
// throw new Error(
// `Multiple occurences of sentinel "${sentinelFuse}" found in the binary`
// );
// }
const colonIndex = firstSentinel + sentinelFuse.length;
if (buffer[colonIndex] !== ":".charCodeAt(0)) {
throw new Error(
`Value at index ${colonIndex} must be ':' but '${buffer[colonIndex].charCodeAt(0)}' was found`
);
}
...
I tried to comments the Error lines, and everything works.
from postject.
Same for me on MacOS 14.5 with M1 cpu, Darwin Kernel Version 23.5.0.
Tried both with nodejs 20.16.0 and 22.5.1.
in sea-config.json I have:
{
"main": "build/sea.js",
"output": "build/sea.blob",
"disableExperimentalSEAWarning": true,
"useSnapshot": false,
"useCodeCache": false,
"assets": {}
}
from postject.
Related Issues (20)
- Internally use `objcopy --add-section` on macOS and Linux HOT 10
- Unable to make build on macOS 13 due to deprecated functions HOT 3
- Calling `postject_find_resource()` segfaults on `rhel8-ppc64le` HOT 6
- Print a message when the build is successful HOT 1
- Weired output message `The signature seems corrupted!` on Windows HOT 7
- SEA created following Node.js documentation doesn't work HOT 9
- Can't read and write to target executable HOT 8
- single executable applications with warning HOT 4
- Investigate why running the wasm blob in Postject is slow
- upx compatibility(Cannot pack after postject-ed) HOT 2
- Question about the sentinel fuse. HOT 5
- Error: buffer[colonIndex].charCodeAt is not a function HOT 2
- stripping postjected executable causes segmentation fault
- Can't read and write to target executable HOT 2
- SEA issue at step running postject to inject the blob HOT 1
- Error: Could not find the sentinel NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 in the binary
- injecting multiple resources to the same binary.
- Signing a `darwin-x64` node executable on `darwin-arm64` leads to a segmentation fault when started [SOLVED] HOT 1
- Types/Typescript support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postject.