Evaluate use of pkg to make single-binary server
See original GitHub issuepkg
is a application that compiles the project into a single executable, which we currently do, but pkg
seems to be flexible as you can provide runtime version and such with the sacrifice of requiring some of the requires to be __dirname
’d
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
vercel/ncc: Compile a Node.js project into a single file ... - GitHub
This is useful for packages that want to use .js files as modules in native Node.js using a "type": "module" in the package.json...
Read more >Parameter server training with ParameterServerStrategy
ParameterServerStrategy will use all the available GPUs on each worker, with the restriction that all workers should have the same number of GPUs...
Read more >Create single binary from express + react app with zeit pkg?
I can start both like this: scripts element in package.json: "myapp": "concurrently --kill-others \"node server\" \"npm run --prefix client ...
Read more >Creating and Publishing a Package - Oracle Help Center
Publication in IPS consists of the following steps: Generate a package manifest. Add necessary metadata to the generated manifest. Evaluate dependencies. Add ...
Read more >Comparing Go vs. C in embedded applications
In this evaluation process Go, C, and C++ were shortlisted as candidates ... in C and reuse code between the client and server...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To go back a bit first, I think the main draws were that a single binary is easy to run (just download one file and execute it), easy to install (just copy one file), and easy to clean up (just delete one file).
Unfortunately the single binary ended up not being straightforward because there are extensions that make file reads to some of the files distributed with code-server which fail because those files are not actually individually on the filesystem; they are in the binary. Another example is the git extension; it was attempting to spawn a shell script distributed with code-server which does not work for the same reason. There may be other broken scenarios we did not discover.
To deal with this I believe there were three ideas:
In practice the first two strategies sort of worked but they were brittle (basically a game of whack-a-mole) and the patching only works for JavaScript code. Self-extraction deviates from why we wanted a single binary in the first place since it is not especially different from an archive except less flexible since you cannot choose the extraction location.
If there was a general and robust way of solving these issues then I feel like going back to the single binary would be a good option.
Interesting! Smaller is definitely appealing. I don’t know the full history around some of the hacks or limitations from the early years of the project.
@code-asher do you have any context? Is this worth considering?