Skip to content

Rust building and testing fails while bootstrapping it in poky #115642

Closed
@Yashinde145

Description

@Yashinde145

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 versions

Version with regression

Rust 1.72

Backtrace

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

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions