-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
Getting error while building & testing rust 1.72 via the src/bootstrap/bootstrap.py
file in poky (cmd- bitbake rust
and then python3 src/bootstrap/bootstrap.py test test_suites_names --target x86_64-poky-linux-gnu
)in poky environment. Until rust 1.70 I was able to build & test the rust sources successfully.
But after updating to rust 1.72, there's an assertion failure causing the problem. The rust build fails as follows-
Note that not all variants of mir-opt tests are going to be blessed, as no mapping between a
32bit and a 64bit target was found for x86_64-poky-linux-gnu.
You can add that mapping by changing MIR_OPT_BLESS_TARGET_MAPPING in src/bootstrap/test.rs
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `x86_64-unknown-linux-gnu`,
right: `x86_64-poky-linux-gnu`: Cannot obtain compiler for non-native build triple at stage 0', compile.rs:1474:13
The code at compile.rs:1474
1470 fn run(self, builder: &Builder<'_>) -> Compiler {
1471 let target_compiler = self.target_compiler;
1472
1473 if target_compiler.stage == 0 {
1474 assert_eq!(
1475 builder.config.build, target_compiler.host,
1476 "Cannot obtain compiler for non-native build triple at stage 0"
1477 );
1478 // The stage 0 compiler for the build triple is always pre-built.
1479 return target_compiler;
1480 }
Build terminates as follows-
test [mir-opt] tests/mir-opt/reference_prop.rs ... ok
test [mir-opt] tests/mir-opt/inline/polymorphic_recursion.rs ... ok
test result: ok. 249 passed; 0 failed; 13 ignored; 0 measured; 0 filtered out; finished in 1.39s
error: the option `Z` is only accepted on the nightly compiler
note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>
help: consider switching to a nightly toolchain: `rustup default nightly`
note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>
thread 'main' panicked at 'failed to gather the target spec for i686-unknown-linux-gnu', synthetic_targets.rs:66:9
Build completed unsuccessfully in 0:05:27
Version it worked on
It most recently worked on Rust 1.70 and earlier versionsVersion with regression
Rust 1.72Backtrace
Backtrace
stack backtrace:
0: rust_begin_unwind
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:228:5
4: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
at ./src/bootstrap/compile.rs:1474:13
5: bootstrap::builder::Builder::ensure
at ./src/bootstrap/builder.rs:2055:23
6: bootstrap::builder::Builder::compiler
at ./src/bootstrap/builder.rs:943:9
7: <bootstrap::test::Compiletest as bootstrap::builder::Step>::run
at ./src/bootstrap/test.rs:1462:24
8: bootstrap::builder::Builder::ensure
at ./src/bootstrap/builder.rs:2055:23
9: <bootstrap::test::UiFullDeps as bootstrap::builder::Step>::run
at ./src/bootstrap/test.rs:1260:17
10: bootstrap::builder::Builder::ensure
at ./src/bootstrap/builder.rs:2055:23
11: <bootstrap::test::UiFullDeps as bootstrap::builder::Step>::make_run
at ./src/bootstrap/test.rs:1256:17
12: bootstrap::builder::StepDescription::maybe_run
at ./src/bootstrap/builder.rs:278:13
13: bootstrap::builder::StepDescription::run
at ./src/bootstrap/builder.rs:315:21
14: bootstrap::builder::Builder::run_step_descriptions
at ./src/bootstrap/builder.rs:935:9
15: bootstrap::builder::Builder::execute_cli
at ./src/bootstrap/builder.rs:916:9
16: bootstrap::Build::build
at ./src/bootstrap/lib.rs:697:17
17: bootstrap::main
at ./src/bootstrap/bin/main.rs:74:5
18: core::ops::function::FnOnce::call_once
at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:00:20
<!--
@rustbot modify labels: +regression-from-stable-to-{stable} -regression-untriaged
Metadata
Metadata
Assignees
Labels
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Noratrieb commentedon Sep 7, 2023
I believe
MIR_OPT_BLESS_TARGET_MAPPING
is unrelated to the issue you're seeing, but I'm not sure.Yashinde145 commentedon Sep 8, 2023
Yeah, I guess the assertion failure is main cause.
Why the two strings are different though? Until rust 1.70, I didn't faced this assertion failure(diff in
builder.config.build
i.e left:x86_64-unknown-linux-gnu
, andtarget_compiler.host
i.e right:x86_64-poky-linux-gnu
). When did git blame for these lines, found that this code was present (from 5 years i.e 2018)even in the earlier rust versions.apiraino commentedon Sep 12, 2023
Adding useful labels for triaging
@rustbot label -I-prioritize +T-bootstrap -needs-triage
onur-ozkan commentedon Sep 13, 2023
I couldn't reproduce this problem from the e39976f HEAD.
The assertation passes as expected(on `./x test bootstrap --target=..), I also printed them out.

The diff:

Sorry for sharing the the outputs in the image format; the attempt was done inside of QEMU(Debian 11).
Yashinde145 commentedon Sep 14, 2023
Thanks for checking @onur-ozkan,
But, my build shows following-
Note- The targets are printed 3 times and the assertion fails in the 3rd call
Moreover, if I bypass the assertion check and then build, why do the compiler asks to switch to nightly channel instead of continuing to stable? I am wondering how does it gets the
Z
option during the build since I did not not provide any such options.Let me know if I am missing something
onur-ozkan commentedon Sep 14, 2023
Do you have a custom
config.toml
?Yashinde145 commentedon Sep 14, 2023
The
config.toml
generated during the rust build is as follows-build_dir
is the directory where I am building rust (using cmdbitbake rust
in yocto poky sources)onur-ozkan commentedon Sep 14, 2023
iirc
bitbake rust
will give you the stable 1.68 compiler. If so, please removebuild.cargo
andbuild.rust
from your configuration, and use the beta compiler which will be downloaded from CI automatically during the bootstrapping.75 remaining items
onur-ozkan commentedon Jan 15, 2024
I meant sending tests and running in the qemu environment
Is the error always the same, like this?
Yashinde145 commentedon Jan 15, 2024
Yes, the error is always same.
onur-ozkan commentedon Jan 15, 2024
Can you try this patch onur-ozkan@43183f7 and tell me if it fixes the problem?
Yashinde145 commentedon Jan 15, 2024
The onur-ozkan@43183f7 patch does not fix the problem. Still, the same error is seen.
onur-ozkan commentedon Jan 15, 2024
I was able to repreduce the
io::copy(&mut file, dst) failed with Connection reset by peer (os error 104)
error, but only by sending large files (and the patch I linked fixes it).Unfortunately I don't know your use case, and I can't invest time on #115642 (comment) for debugging or trying to reproduce the error. If you can't debug and fix the problem you get, I suggest you to give more context about your use case (configurations, commands, etc.) under the #97669 issue.
Yashinde145 commentedon Jan 16, 2024
I got some work around for this,
by excluding
ui-fulldeps
test suite andsrc/tools/replace-version-placeholder
,src/tools/jsondoclint
tests and it works forx86_64-poky-linux-gnu
.But, when I check for other cross-compiled targets(
x86 32 bit, arm 32 & 64 bits and mips64
), the following lib failure is seenI am investigating the problem and will let you know if there are any updates.
onur-ozkan commentedon Jan 16, 2024
That seems to be related with MirOptPanicAbortSyntheticTarget tests
rust/src/bootstrap/src/core/build_steps/test.rs
Lines 1530 to 1534 in f9c2421
Yashinde145 commentedon Jan 16, 2024
Yes, the log says the same and the error was seen after
MirOptPanicAbortSyntheticTarget
test cases while building stage1 library artifacts.Meanwhile, I came across the following and have a doubt,
As mentioned in #40049 (comment), do we have to pass the
-C linker=
flag toRUSTFLAGS
explicitly for the linker error in #115642 (comment)?Earlier it was working without passing the flag explicitly.
onur-ozkan commentedon Jan 16, 2024
Earlier we didn't have those tests, so they might require passing
-C linker=
. You can try and see if that solves the problem.Yashinde145 commentedon Jan 17, 2024
Is there any way to handle this panic failure and make the tests run successfully?
onur-ozkan commentedon Jan 17, 2024
You can add
--skip mir-opt
to your command to exclude mir-opt tests, then runx test mir-opt
to run mir-opt tests withoutMirOptPanicAbortSyntheticTarget
.Rollup merge of #119619 - onur-ozkan:panic-abort-mir-opt, r=oli-obk
Rollup merge of #119619 - onur-ozkan:panic-abort-mir-opt, r=oli-obk
src/poky:rust: Disable rust oe-selftest