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
src,doc: Experimental support for SEA #42334
base: master
Are you sure you want to change the base?
Conversation
- add strategy as discussed in next-10 mini-summit - https://github.com/nodejs/next-10/blob/main/meetings/summit-nov-2021.md#single-executable-applications - add initial support single executable application support for linux Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
Review requested: |
|
@igorklopov, @jesec, @styfle could you look at what is documented/the proof of concept to confirm this is what we talked about in the next-10 mini-summit and that it's what is needed. If so would be great if you could help fill in the windows/osx versions. |
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: mscdex <mscdex@users.noreply.github.com>
…port.md Co-authored-by: Anna Henningsen <github@addaleax.net>
…port.md Co-authored-by: Anna Henningsen <github@addaleax.net>
|
@addaleax I had meant to mark this as a work in progress as I agree it's not complete (no tests, known memory leaks) but wanted some feedback/comments before going to far.
sure
agreed, it may be quite difficult without using an addon tool like LIEF which I don't think would make sense as part of the regular test suite. It would be easier if the tests were run nightly with additional dependencies. (EDITED), maybe the embedder API testing had a similar challenge, I'll look at that to see for ideas.
I like the idea of using strings with \0 instead of the command line itself. That will make things easier for escaping. In terms of the hex flags I was thinking it might help avoid endianess issues and was not too worried about the additional byes it would add
In the mini-summit from the discussions we had, we did not come up with anything that required more than bundling command line arguments and then running them given that '-e' could be used to specify the javascript that could be run. It might be more efficient if we also provided a binary section for data, but I don't think that is essential and could be added later on. If we had a list requirements that it would not address we could extend the format to cover those, but I'd suggest we keep it minimal until we have concrete requirements. |
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
doc/contributing/maintaining-single-executable-application-support.md
Outdated
Show resolved
Hide resolved
| for version `00000001` could be: | ||
|
|
||
| ```text | ||
| JSCODE0000000100000000-e \"console.log('Hello from single binary');\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe something with node or nodejs in it might be better?
If it’s not included in the regular CI runs, then it’s something that at least needs to be optionally addable, like CITGM/stress test/etc.. Also, I don’t know about the exact challenges with LIEF, you are probably better to judge that, but I don’t see a strong reason for not including it in our regular test suite, conceptually.
I wouldn’t worry too much about this, I think since we’re modifying a platform-specific binary file it’s okay to have platform-specific differences in that.
Yeah, I also don’t think that that’s essential – but it might be good to think about the path forward would potentially involve adding more binary sections, instead of using our own format for a single additional binary section (which may or may not be easier to work with, considering platform-specific differences).
I think that’s fair, and I’m not expecting to start out with a list of concrete requirements, but again, it’s good to think about these things, because even a “minimal” solution still makes choices about what can be added on top of it. For what it’s worth, I think the biggest reason why we would not currently look into using this approach here for our use case (and keep using boxednode) is that this approach does not enable bundling native addons. But I absolutely understand that that would be a fairly hard problem to solve when trying to avoid compilation. |
There is some discussion in - https://sourceware.org/bugzilla/show_bug.cgi?id=11767 about loading shared libraries from memory but from related discussion it did not sound like it was going to move forward. Part of that discussion is writing out the shared libary to a file and then loading it which would be possible but also pretty ugly. Does boxnode effectively statically link in the addons or something else? |
Yeah, it’s also possible to load them in-memory but that’s a huge amount of work that probably can’t be justified by this use case.
Yes, that.
I think that link might just be working for you |
sorry pasted wrong link, updated above and this is the right link: |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Signed-off-by: Michael Dawson mdawson@devrus.com