Skip to content
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

RFC: Build as single executable application #618

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZauberNerd
Copy link

This commit adds a build script to package the devcontainer CLI as a single executable application using the new (and experimental) Node.js feature of the same name.
https://nodejs.org/api/single-executable-applications.html

Distributing the devcontainer CLI as a single executable application allows to use it on systems where Node.js is not installed. For example on immutable systems like Fedora Silverblue or openSUSE MicroOS.

I'm aware of another PR that also tries to package standalone binaries via @vercel/pkg here: #343 but it seems that PR hasn't received updates in a while and I'm not sure if it is stale or not. Feel free to close my PR if the other approach is preferable.

TODOs:

Let me know what you think about either this PR or #343 and whether I should continue with the above outlined TODOs.

This commit adds a build script to package the `devcontainer` CLI as a
single executable application using the new (and experimental) Node.js
feature of the same name.
https://nodejs.org/api/single-executable-applications.html

Distributing the devcontainer CLI as a single executable application
allows to use it on systems where Node.js is not installed.
For example on immutable systems like Fedora Silverblue or
openSUSE MicroOS.
@ZauberNerd

This comment was marked as resolved.

@ZauberNerd
Copy link
Author

Let me know what you think about either this PR or #343 and whether I should continue with the above outlined TODOs.

cc @trxcllnt @jkeech because you were both involved in the above mentioned PR

@jkeech
Copy link
Contributor

jkeech commented Aug 28, 2023

Looping in @chrmarti as he was working with @trxcllnt on #343. I don't know enough about this new Node.js single executable application mechanism to compare it with the @vercel/pkg approach. I see that it is marked as Experimental, but given that we'd offer this as an additional mechanism to acquire/run the CLI instead of the only option, I don't think it would cause any issues.

I would love to see us get something in place to package the CLI as a standalone executable, whether that's using the approach in this PR, or #343, or something else altogether. Having a single file executable will make it a lot easier to run the CLI on new machines.

One thing I'm not sure about is the node-pty native dependency and how that would work in this packaging format. I'm guessing that it wouldn't work, but it would be good to double check.

@ZauberNerd
Copy link
Author

One thing I'm not sure about is the node-pty native dependency and how that would work in this packaging format. I'm guessing that it wouldn't work, but it would be good to double check.

Correct, native modules don't work with this packaging format. But #585 causes the node-pty to be optional, which makes this PR feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants