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

Ubuntu 20.04 #98

Open Raniz85 opened 4 years ago

Raniz85 commented 4 years ago

As the title says. Would be nice to have access to newer packages when building customized CI images.

emk commented 4 years ago

Good idea! I'll consider that for Rust 1.47.0. I also want to update to PostgreSQL 12 at the same time.

gibfahn commented 3 years ago

+1, it's not exactly a big deal, but newer versions of included deps is always nice.

e.g. git in the current image doesn't support git branch --show-current, which I used in an integration test. In this case it was easy enough to change to git rev-parse --abbrev-ref HEAD, but with focal it wouldn't have been an issue.

emk commented 3 years ago

I tried to update to Ubuntu 20.04 for the Rust 1.49.0 release, but it broke the ./test-image tests for sqlx, which picked up a dependency on a shared library. So I'm going to hold off on this for now. My apologies!

emk commented 2 years ago

This might be worth revisiting at some point, now that I'm getting CI working on GitHub. This will make it easier to run all the linking tests on PRs, to see if they're working.

emk commented 2 years ago

I have just tried Ubuntu 20.04 again, and sqlx is still failing.

--- Test case for sqlx:
ldd says:
    /lib/ld-musl-x86_64.so.1 (0x7f790b7e1000)
[FAIL] Executable is not static!

sqlx now claims to work with rustls, so maybe we could consider dropping sqlx support at some point, allowing for an Ubuntu 20.04 upgrade. But that would break anyone using sqlx, and they'd have to stick with an older image or migrate to TLS.

At least one major hosted PostgreSQL provider, Citus Data, uses certs that break rustls. They'll shut down in January 2022, but I think we want to hang onto sqlx Citus support until then.

asaaki commented 2 years ago

The issue with the static link check is slightly different, as I have described in my comment of the linked PR. The gist is: the check is not reliable and I went a different route to test this.

emk commented 2 years ago

@asaaki Ah, thank you! I hadn't seen that note.

I'm going to copy the affected binaries back to main container, and check the linking there. And I'll aim to release Ubuntu 20.04 support when Rust 1.58 ships, to avoid upgrading the existing 1.57 version of the image.

Thank you so much for taking the time to figure out what was going wrong!

emk commented 2 years ago

The PR #134 contains the new image testing script. Thank you to @asaaki! I plan to ship it when Rust 1.58 is released.