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

build fails with error[E0463]: can't find crate for rustc_macros which rustc depends on in rustc_llvm #62447

Open
Cogitri opened this issue Jul 6, 2019 · 10 comments
Labels
O-musl Target: The musl libc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Cogitri
Copy link

Cogitri commented Jul 6, 2019

Hello,

We hit this while compiling rust 1.35.0 -> rust 1.36.0 on x86. This is for the distro package for Alpine Linux. Please note that we're compiling against our own triplets, in this case it's for i586-alpine-linux-musl, see the definition here: https://gist.github.com/6bae5fdcf6bb5a95b3b779ceb2dd79f7

I'm pretty sure that that error is on us - but the error message doesn't really help me solve it, so maybe x.py/configure should catch this and give a better error message? A pointer in the right direction would certainly be very appreciated :)

See https://cloud.drone.io/alpinelinux/aports/8259/1/1

Thanks

@mati865
Copy link
Contributor

mati865 commented Jul 24, 2019

Errors like this often happen when rustbuild decides the target does not support dylibs (defaults to static crt).

From the x86 build log:

configure: target.x86_64-unknown-linux-musl.musl-root := /usr

Try changing it to match the target, in this case: i586-alpine-linux-musl

If that doesn't work you can try with RUSTFLAGS="-C target-feature=-crt-static". If that works then something went horribly wrong.

@jonas-schievink jonas-schievink added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) O-musl Target: The musl libc labels Jul 24, 2019
@Cogitri
Copy link
Author

Cogitri commented Jul 24, 2019

Errors like this often happen when rustbuild decides the target does not support dylibs (defaults to static crt).

Hm, thought that too, but our triplets already disable crt-static by default: https://github.com/alpinelinux/aports/blob/d314157469eb1d0278f99d561e7ffcca22c92aa5/community/rust/alpine-target.patch#L45 🤔

Try changing it to match the target, in this case: i586-alpine-linux-musl

Oh, didn't notice that, will try, thanks.

@Cogitri
Copy link
Author

Cogitri commented Jul 24, 2019

Seems like neither of those things helped: https://cloud.drone.io/alpinelinux/aports/8847/4/1

Here's the build recipe: https://github.com/alpinelinux/aports/pull/9353/files

@mati865
Copy link
Contributor

mati865 commented Jul 24, 2019

Sorry but I have no idea. It fails in stage0 so maybe host compiler is not working properly. Does x86_64 work?

@Cogitri
Copy link
Author

Cogitri commented Jul 28, 2019

Yup, x86_64 has been working for some releases now :/

@Cogitri
Copy link
Author

Cogitri commented Jul 29, 2019

Hm, I changed the triplets to be closer to the upstream ones (https://github.com/alpinelinux/aports/pull/9353/files#diff-ccfaa4435cf05bd784144a7d7720c82cR39) but it still doesn't work, so I guess it's not on the triplets: https://gist.github.com/1dfdf04db4e88950a8db2840b3ce97d1

I'm a bit confused because it does build rustc_macros earlier in the build but then can't find it :/

Just to make sure that it's not on one of our patches, I just built rustc again without any of our patches (other than for the alpine triplets) and it's still bad.

@Cogitri
Copy link
Author

Cogitri commented Jul 29, 2019

Hm, the same compiler works fine for the upstream triplets, I'm honestly unsure what's going wrong here

@Cogitri
Copy link
Author

Cogitri commented Aug 1, 2019

Huh, it even fails with this triplet:

$cat aarch64_alpine_linux_musl.rs 

use crate::spec::TargetResult;

pub fn target() -> TargetResult {
    let base = super::aarch64_unknown_linux_musl::target()?;

    Ok(base)
}

Cogitri added a commit to Cogitri/aports that referenced this issue Aug 27, 2019
Use upstream triplets for now, rust doesn't seem to want to work with our
triplets...

See rust-lang/rust#62447
Cogitri added a commit to Cogitri/aports that referenced this issue Aug 27, 2019
Use upstream triplets for now, rust doesn't seem to want to work with our
triplets...

See rust-lang/rust#62447
Cogitri added a commit to Cogitri/aports that referenced this issue Aug 28, 2019
Use upstream triplets for now, rust doesn't seem to want to work with our
triplets...

See rust-lang/rust#62447
algitbot pushed a commit to alpinelinux/aports that referenced this issue Aug 30, 2019
Use upstream triplets for now, rust doesn't seem to want to work with our
triplets...

See rust-lang/rust#62447
@workingjubilee
Copy link
Member

Hm. Is this still a problem?

@lrvick
Copy link

lrvick commented Dec 8, 2023

@workingjubilee I -think- I am running into the same or a similar problem in my efforts to bootstrap 1.54 here:

thepowersgang/mrustc#324 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-musl Target: The musl libc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants