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

Providing static linked binaries #4

Closed
holdenger opened this issue Jul 29, 2019 · 4 comments
Closed

Providing static linked binaries #4

holdenger opened this issue Jul 29, 2019 · 4 comments

Comments

@holdenger
Copy link

Hey @breard-r

Thank you for your effor in acmed. It's a nice peace of software. However, can you please consider providing static linked binaries (including libc and openssl)? I would like to use acmed on CentOS6 and there is some problem in OpenSSL version (since i'm a total rust noob i can't even install rust tools env).

@holdenger holdenger changed the title Providing static linked libraries Providing static linked binaries Jul 29, 2019
@breard-r
Copy link
Owner

Hello!

Uploading statically linked binaries would mean that I have to maintain them and upload new ones each time OpenSSL has a vulnerability, which is several times a year. I don't think I should/can have this kind of responsibility. Furthermore, if I was to do so, I would limit it to stable releases; and currently there is none of those.

In a more technical point of view, it may be possible to create such binaries since, in one hand, the openssl crate has a "vendored" feature that statically links OpenSSL and, in the other hand, Rust has targets which uses a statically linked musl. Unfortunately, even if it does work on small test projects, I couldn't reproduce it with ACMEd. I think it's due to a specific dependency which prevent the "vendored" feature to propagate to its own dependencies. Anyway, I think I should spend time on cleaning and improving the code first (seriously, at some point I went sloppy and created a mess…), and only then solve this compilation mystery.

As for this issue, I think it should be keep opened so I remember to fix the static compilation some day.

@breard-r
Copy link
Owner

By the way, if I was you I would create a CentOS6 virtual machine and install rustup on it. Rustup will take care of installing one (or several) versions of rust for one (or multiple) targets. Very useful for cross-compilation and tests on different rust version, but in your case you can keep the defaults and simply use it as a basic Rust installer.

@holdenger
Copy link
Author

Thanks, i will try to build it with this: https://github.com/emk/rust-musl-builder

breard-r added a commit that referenced this issue Oct 10, 2020
@breard-r
Copy link
Owner

I updated the build system and was able to generate statically linked binaries. Here is how I processed on my system :

  1. Install musl
  2. Use rustup
  3. Add the target: rustup target add "x86_64-unknown-linux-musl"
  4. Compile ACMEd: make FEATURES="openssl_vendored" TARGET="x86_64-unknown-linux-musl"
  5. Install into a directory (useful for packaging): make DESTDIR="my_package_directory" TARGET="x86_64-unknown-linux-musl" install

Since building such binaries is now an easy task, I'm closing this issue. Feel free to reopen it if you have any question regarding this matter.

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