Skip to content

Please also release fully statically linked executables #4354

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

Closed
kuznero opened this issue May 6, 2020 · 3 comments
Closed

Please also release fully statically linked executables #4354

kuznero opened this issue May 6, 2020 · 3 comments

Comments

@kuznero
Copy link

kuznero commented May 6, 2020

In NixOS for example it is necessary to patchelf --set-interpreter on each executable that is dynamically linked. And taking into account the way different editor plugins/extensions download updates it would be wise to ensure that it can run without additional steps to remedy problems like this.

An example of how it is possible to produce fully statically linked binaries in Rust can be found in the blog post Building statically linked binaries in Rust.

If it is going to be an accepted approach going forward, I can volunteer to craft a PR to produce such binary and make it part of the release flow if necessary.

@kiljacken
Copy link
Contributor

We do know how to produce statically linked executables, and we did do it for a while. It does have one glaring issue for us right now: statically linked musl cannot dlopen which hinders support for proc macros.

Ideally we'll reach a point in rustc's lifecycle where all proc macros are sandboxed wasm, but that's still quite far out in the future.

We could possibly provide a static build as well, and force disable proc macro support in that build, but that seems like a lot of special casing. Maybe we can add a workaround for NixOS instead and call patchelf on the downloaded executable ourselves?

@kuznero
Copy link
Author

kuznero commented May 7, 2020

Please have a look at the PR #4369 - this is a working example

@kuznero
Copy link
Author

kuznero commented May 8, 2020

Closing, more explanation can be found in the first linked and closed pr.

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

No branches or pull requests

2 participants