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

Upgrade base image to Ubuntu 20.04 #134

Open emk opened 2 years ago

emk commented 2 years ago

Many thanks to @asaaki for having figured out the static link check was returning flase negatives with Alpine's lld. See:

https://github.com/emk/rust-musl-builder/pull/120#issuecomment-803407719

The plan is to merge this when Rust 1.58.0 is released, so people who need 18.04 can stick with1.57.0.

Closes #98. Closes #120.

satmandu commented 2 years ago

Now that 1.58.1 is out...

hoijui commented 2 years ago

This is also required to be able to use this container as a base for GitHub Actions, because the checkout action, which is almost always the first action of any build run, requires a newer version of git then is available in Ubuntu 18.04.

hoijui commented 2 years ago

Solution for GitHub Actions: Don't use this docker image, but the normal actions-rs/toolchain action you also use for non-MUSL building, and just add the target property like so:

      - name: "Get the Rust toolchain"
         uses: actions-rs/toolchain@v1
         with:
             toolchain: stable
             override: true
             target: x86_64-unknown-linux-musl
             components: rustfmt, clippy

      - name: "Build manual"
        run: cargo build --verbose --release --target=x86_64-unknown-linux-musl