Closed johannesvollmer closed 11 months ago
This would be a perfect opportunity to have CROSS_DEBUG=1
actually show output of commands we invoke.
This seems like a problem with rustup not reporting correctly.
if you look at a successful run, here you see that cross installed the target, in the log where it first failed, it doesnt.
now, cross checks for what is needed using rustup target list
, if the target is not marked as installed, it'll install it. Curiously, in the failed run the target seems to have been reported as installed or not available and rust-src was installed instead.
The logic is here: https://github.com/cross-rs/cross/blob/88f49ff79e777bef6d3564531636ee4d3cc2f8d2/src/lib.rs#L469-L476
if target is not installed && target is available, install the target, else if rust-src is not installed, install rust-src (this is to then use build-std/xargo)
So, I suspect something is wrong with what rustup is reporting, it's probably saying that mips-unknown-linux-gnu
is not available. Why? No clue
if this issue still exists, can you show what rustup target list --toolchain stable-x86_64-unknown-linux-gnu
gives
and then run rustup target add mips-unknown-linux-gnu --toolchain stable-x86_64-unknown-linux-gnu
This is due to mips being demoted to t3. See https://github.com/rust-lang/rust/issues/115218
To solve this issue with the mips targets being demoted to t3, you'll have to enable build-std
, and also be on nightly.
#Cross.toml
[target.mips-unknown-linux-gnu]
build-std = true
Change the target to whatever mips you're using. We should update cross
to do this automatically when rustc >= 1.72.0
to not be on nightly, you might be able to instead use xargo = true
ping @rapiz1, this is the solution for your problem as well
This is due to mips being demoted to t3
Good to know. As I said, we solved the problem at hand by using a different target. I just wanted to let you know in case something was horribly wrong - but everything seems alright. Thanks for the time and for the solution :)
Checklist
Describe your issue
summary: mips suddenly stopped working due to std missing. works again when using powerpc target instead, which solves the issue for us. this is just to let you know something went wrong. locally, i couldn't reproduce the behaviour, but in the github workflows, it consistently failed.
details:
cross build --target mips-unknown-linux-gnu --verbose
error[E0463]: can't find crate for 'core' note: the 'mips-unknown-linux-gnu' target may not be installed help: consider downloading the target with 'rustup target add mips-unknown-linux-gnu'
and later cross-rs printswarning: rust-std is not available for mips-unknown-linux-gnu
powerpc-unknown-linux-gnu
What target(s) are you cross-compiling for?
mips-unknown-linux-gnu
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
0.2.5
Example
github-workflow-rust.yaml
Additional information / notes
No response