actions-rs / toolchain

🛠️ GitHub Action for `rustup` commands
https://github.com/marketplace/actions/rust-toolchain
MIT License
592 stars 91 forks source link

Install musl-tools #102

Open npmccallum opened 4 years ago

npmccallum commented 4 years ago

Do the checklist before filing an issue:

(I don't speak TypeScript...)

Motivation

When setting up the toolchain for any target that ends in -linux-musl, please apt install musl-tools as part of the toolchain setup. Rust dependencies that use cc to compile C code will expect musl-gcc to be installed.

Workflow example

No changes needed.

Additional context

musl-gcc is a thin wrapper around GCC that sets things up for compilation on musl. Many Rust packages require it to be installed when building for any musl target.

hoijui commented 2 years ago

Any comments on this? Is this wanted, and just waiting for someone to implement it?

vojtechkral commented 2 years ago

Yes, I would think so. For building against musl libs statically it seems musl-tools are required. Right now I install them using this:

- uses: awalsh128/cache-apt-pkgs-action@v1
  with:
    packages: musl-tools # provides musl-gcc
    version: 1.0

so, not and insurmountable problem, but still would be nice to have them out of the box with actions-rs IMO.

AraHaan commented 2 years ago

Wait, so those musl tools would also allow cmake to cross compile for it with CMakePresets.json as well right?

I found this issue when I need to be able to compile some C code in github actions for these presets: