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

Toolchain 'aarch64-unknown-linux-gnu' does not come with cc for official Docker Image. #96001

Closed
simbleau opened this issue Apr 13, 2022 · 2 comments

Comments

@simbleau
Copy link
Contributor

simbleau commented Apr 13, 2022

I'm trying to build a docker image for a Raspberry Pi 4 which uses Trunk to build a web page.

Pretty common use-case, right? I would think so. It doesn't build on Arm64v8 architecture and fails to find cc.

I checked /usr/local/rustup/toolchains/1.60.0-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/bin and confirmed cc does not exist, but gcc/g++ is installed.

Here was my Dockerfile:

FROM rust as builder
RUN rustup target add wasm32-unknown-unknown
RUN cargo install trunk # <--- BUILD FAILS HERE
RUN trunk build

I expected this small example to build.

Instead:

note: Error while loading /usr/local/rustup/toolchains/1.60.0-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/bin/cc: No such file or directory
#0 183.5           
#0 183.5 
#0 187.1 error: failed to compile `trunk v0.14.0`, intermediate artifacts can be found at `/tmp/cargo-installzc7X1O`
#0 187.1 
#0 187.1 Caused by:
#0 187.1   build failed

Meta

rustc --version --verbose:

#6 [3/6] RUN rustc --version --verbose
#6 1.773 rustc 1.60.0 (7737e0b5c 2022-04-04)
#6 1.773 binary: rustc
#6 1.773 commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
#6 1.773 commit-date: 2022-04-04
#6 1.773 host: aarch64-unknown-linux-gnu
#6 1.773 release: 1.60.0
#6 1.773 LLVM version: 14.0.0

@simbleau simbleau added the C-bug Category: This is a bug. label Apr 13, 2022
@itaylor
Copy link

itaylor commented May 5, 2022

I had this issue (missing cc) happen to me when trying to cross compile for an M1 Mac from an X86 machine. I was able to fix it by switching the docker buildx builder to use the multiarch/qemu-user-static as described here: docker/buildx#495 (comment). For me, I think the issue is that the arm64 builder that comes out of the box with buildx has incorrect/different paths. You might be experiencing something similar with the WASM builder and arm64?

@Enselic
Copy link
Member

Enselic commented Jun 7, 2024

Triage: Thanks for reporting! But I'm pretty sure no cc is ever distributed by Rust, so the problem must be somewhere else. In other words, I don't think this is a Rust bug. Feel free to re-open if you can prove or strongly indicate that this is a Rust bug.

@Enselic Enselic closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
@saethlin saethlin removed C-bug Category: This is a bug. needs-triage-legacy labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants