emk / rust-musl-builder

Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.
Apache License 2.0
1.54k stars 193 forks source link

[fix] always link zlib static #38

Closed bomgar closed 6 years ago

bomgar commented 6 years ago

libz-sys uses these options https://github.com/alexcrichton/libz-sys/blob/8eb6f9e8f45cef71f8a3fa94d849ac54a263c090/build.rs#L52

bomgar commented 6 years ago

fixes https://github.com/emk/rust-musl-builder/issues/37

emk commented 6 years ago

@bomgar Could you please run ./test-image.sh for me with these options and verify that it works correctly? Thank you!

Also, if you're feeling really ambitious, feel free to add another short test program to examples/ which triggers this case, and to add code to ./test-image.sh to build it and make sure it's statically linked. This isn't necessarily—I'll accept the PR without it—but it would greatly reduce the chance that I accidentally break this functionality in the future. Thank you for considering it!

bomgar commented 6 years ago

test-image works. I will add a demo project.

bomgar commented 6 years ago

The test now uses the code @mriehl suggested.

It might be a good idea to let travis execute the test-image script.

bomgar commented 6 years ago

Travis works https://travis-ci.org/bomgar/rust-musl-builder/

bomgar commented 6 years ago

https://github.com/emk/rust-musl-builder/pull/41 there you go