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

libmusl with static OpenSSL? #21

Closed
emk opened this issue Dec 29, 2016 · 8 comments
Closed

libmusl with static OpenSSL? #21

emk opened this issue Dec 29, 2016 · 8 comments
Labels
A-musl Area: musl libc targets enhancement

Comments

@emk
Copy link

emk commented Dec 29, 2016

This looks really cool!

There's a nice trick with musl-libc, where you can build a 100% static Rust executable that works on any distro with a reasonably modern kernel. It's also more-or-less possible to make this work with static OpenSSL. For an example, see https://github.com/emk/rust-musl-builder.

Is there any support for doing something like this with cross? If so, I'd be happy to retire rust-musl-builder and point people at cross!

@japaric
Copy link
Contributor

japaric commented Dec 30, 2016

It ... already works? cross build --target x86_64-unknown-linux-musl on the Cargo repo gives me a statically linked Cargo.

If you find sometimes that doesn't work, let me know and I'll look into it!

@emk
Copy link
Author

emk commented Dec 30, 2016

Sweet! I will look into this tomorrow and try converting a bunch of production projects at work, and let you know how it goes.

@jimmycuadra
Copy link

Follow up to this: Is there a reason OpenSSL is not included in the non-x86 musl targets? I'm interested in using cross to create static binaries targeting Raspberry Pi 3, but need OpenSSL. Previously I've used https://github.com/clux/muslrust for creating static binaries, but that project does not support multiple architectures. In clux/muslrust#11, we discuss this project superseding that one.

@japaric
Copy link
Contributor

japaric commented Apr 15, 2017

Is there a reason OpenSSL is not included in the non-x86 musl targets?

I couldn't get OpenSSL to compile using the MUSL toolchains last time I tried (and the alternative of compiling OpenSSL using the glibc toolchain resulted in link errors when trying to produce binaries, iirc). Sadly, I don't remember the details :-(.

@jimmycuadra
Copy link

@clux Any insight here?

@clux
Copy link

clux commented Apr 15, 2017

Hi.

No, not really. OpenSSL is difficult. In all my attempts at getting the linux musl build to work, I had to get OpenSSL compiled correctly with musl-gcc. Any attempt where I accidentally/purposefully used native gcc, I'd end up with link errors at the end of cargo build.

Also, I just gotta say that I really like how the docker images in here are set up. The tricks to compile then apt purge build dependencies for instance. Nice way of minimising dependencies and not accidentally relying on the wrong things (I ended up spending way too much time getting pkgconfig to do the right thing with custom prefixes).

@jimmycuadra
Copy link

FYI, I submitted this issue to This Week in Rust cause it's something that I really want for my home Kubernetes on Raspberry Pi 3 cluster, but it's far beyond my own knowledge. Hoping someone with the right skills will bite. :}

@malbarbo
Copy link
Contributor

This was fixed by #218.

@Alexhuszagh Alexhuszagh added enhancement A-musl Area: musl libc targets labels Nov 6, 2022
github-merge-queue bot pushed a commit that referenced this issue Dec 22, 2023
Fixes

```
#21 22.27 Get:2 http://ftp.ports.debian.org/debian-ports unreleased InRelease [50.3 kB]
#21 22.34 Err:1 http://ftp.ports.debian.org/debian-ports unstable InRelease
#21 22.34   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B523E5F3FC4E5F2C NO_PUBKEY 8D69674688B6CB36
#21 22.42 Err:2 http://ftp.ports.debian.org/debian-ports unreleased InRelease
#21 22.42   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B523E5F3FC4E5F2C NO_PUBKEY 8D69674688B6CB36
#21 22.43 Reading package lists...
#21 22.44 W: GPG error: http://ftp.ports.debian.org/debian-ports unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B523E5F3FC4E5F2C NO_PUBKEY 8D69674688B6CB36
#21 22.44 E: The repository 'http://ftp.ports.debian.org/debian-ports unstable InRelease' is not signed.
#21 22.44 W: GPG error: http://ftp.ports.debian.org/debian-ports unreleased InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B523E5F3FC4E5F2C NO_PUBKEY 8D69674688B6CB36
#21 22.44 E: The repository 'http://ftp.ports.debian.org/debian-ports unreleased InRelease' is not signed.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-musl Area: musl libc targets enhancement
Projects
None yet
Development

No branches or pull requests

7 participants