cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

x86_64-linux-musl-g++ when compiling musl target

Open Masber opened this issue 6 months ago • 5 comments

Dear cc-rs community,

I am new to this type of compilation and I am trying to build a musl binary from my project. For some reason the compilation fails https://github.com/eth-cscs/manta/actions/runs/15229587583/job/42836254358

I would like to understand how to solve this issue

kind regards

Masber avatar May 24 '25 20:05 Masber

It looks like you are using cmake-rs

Did you install musl toolchain?

NobodyXu avatar May 25 '25 02:05 NobodyXu

I just added this like to the pipeline rustup target add x86_64-unknown-linux-musl but it still fails with same error

Masber avatar May 25 '25 11:05 Masber

For C/C++, you would need to also install musl-tools, or use something like cargo-zigbuild

NobodyXu avatar May 25 '25 14:05 NobodyXu

installing musl-tools did not fix the issue. I would like to avoid cargo-zigbuild if possible because I am using cargo dist and using cargo-zigbuild means rewriting the CI ...

Masber avatar May 25 '25 16:05 Masber

@Masber there might be some special things with cmake

From the build log, it looks like it's using cmake, and cmake uses cc for some detection

NobodyXu avatar May 26 '25 11:05 NobodyXu