Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallback for the x86-64-linux-musl-gcc is not available and cause build failures #1452

Closed
Majestry opened this issue Apr 6, 2025 · 4 comments · Fixed by #1455
Closed

fallback for the x86-64-linux-musl-gcc is not available and cause build failures #1452

Majestry opened this issue Apr 6, 2025 · 4 comments · Fixed by #1455

Comments

@Majestry
Copy link

Majestry commented Apr 6, 2025

Build env (docker image):

cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian

Installed musl packages:

musl/oldstable,now 1.2.2-1 amd64 [installed,automatic]
musl-dev/oldstable,now 1.2.2-1 amd64 [installed]
musl-tools/oldstable,now 1.2.2-1 amd64 [installed]
Cargo version:

cargo 1.85.0 (d73d2caf9 2024-12-31)
release: 1.85.0
commit-hash: d73d2caf9e41a39daf2a8d6ce60ec80bf354d2a7
commit-date: 2024-12-31
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Linux [64-bit]

After update of cc to 1.2.18, the build for the target x86_64-unknown-linux-musl fails with the error message

/bin/sh: 1: x86_64-linux-musl-gcc: not found
make[1]: *** [Makefile:3058: apps/lib/libapps-lib-app_libctx.o] Error 127
make: *** [Makefile:1577: build_libs] Error 2

According to the #1443, the /usr/bin/musl-gcc should be the symlink, but it's actually not:

file /usr/bin/musl-gcc
/usr/bin/musl-gcc: POSIX shell script, ASCII text executable

The issue first appeared with the cc crate 1.2.18, it was not present in 1.2.17 and below

Looks like the fallback for the musl-gcc should be preserved

UPD: workaround which works for me: creating the symlink to musl-gcc:

ln -s /usr/bin/musl-gcc /usr/bin/x86_64-linux-musl-gcc

@NobodyXu
Copy link
Collaborator

NobodyXu commented Apr 6, 2025

Perhaps we would need to have two possible prefixes instead of one?

NobodyXu added a commit that referenced this issue Apr 6, 2025
Fixed #1452

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@madsmtm
Copy link
Collaborator

madsmtm commented Apr 6, 2025

Yeah, this is my bad, I argued that it shouldn't exist as a fallback in #1443, but apparently, that was wrong. Sorry!

@Majestry
Copy link
Author

Majestry commented Apr 6, 2025

It happens :) Thank you for the fast response and fix!

@madsmtm
Copy link
Collaborator

madsmtm commented Apr 7, 2025

Fixed in #1455, will be released on Friday.

tgross35 added a commit to tgross35/rust-libc that referenced this issue Apr 9, 2025
Work around a `cc` issue that doesn't have a fix released yet [1], which
is causing CI failures for musl targets.

[1]: rust-lang/cc-rs#1452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants