@@ -465,35 +465,73 @@ impl Step for RustAnalyzer {
465465
466466 /// Runs `cargo test` for rust-analyzer
467467 fn run ( self , builder : & Builder < ' _ > ) {
468- let host = self . compilers . target ( ) ;
468+ let build_compiler = self . compilers . build_compiler ( ) ;
469+ let target = self . compilers . target ( ) ;
470+
471+ // NOTE: rust-analyzer repo currently (as of 2025-12-11) does not run tests against 32-bit
472+ // targets, so we also don't run them in rust-lang/rust CI (because that will just mean that
473+ // subtree syncs will keep getting 32-bit-specific failures that are not observed in
474+ // rust-analyzer repo CI).
475+ //
476+ // Some 32-bit specific failures include e.g. target pointer width specific hashes.
477+
478+ // FIXME: eventually, we should probably reduce the amount of target tuple substring
479+ // matching in bootstrap.
480+ if target. starts_with ( "i686" ) {
481+ return ;
482+ }
469483
470- let workspace_path = "src/tools/rust-analyzer" ;
471- // until the whole RA test suite runs on `i686`, we only run
472- // `proc-macro-srv` tests
473- let crate_path = "src/tools/rust-analyzer/crates/proc-macro-srv" ;
474484 let mut cargo = tool:: prepare_tool_cargo (
475485 builder,
476- self . compilers . build_compiler ( ) ,
486+ build_compiler,
477487 Mode :: ToolRustcPrivate ,
478- host ,
488+ target ,
479489 Kind :: Test ,
480- crate_path ,
490+ "src/tools/rust-analyzer" ,
481491 SourceType :: InTree ,
482492 & [ "in-rust-tree" . to_owned ( ) ] ,
483493 ) ;
484494 cargo. allow_features ( tool:: RustAnalyzer :: ALLOW_FEATURES ) ;
485495
486- let dir = builder. src . join ( workspace_path) ;
487- // needed by rust-analyzer to find its own text fixtures, cf.
488- // https://github.com/rust-analyzer/expect-test/issues/33
489- cargo. env ( "CARGO_WORKSPACE_DIR" , & dir) ;
496+ // N.B. it turns out _setting_ `CARGO_WORKSPACE_DIR` actually somehow breaks `expect-test`,
497+ // even though previously we actually needed to set that hack to allow `expect-test` to
498+ // correctly discover the r-a workspace instead of the outer r-l/r workspace.
490499
491- // RA's test suite tries to write to the source directory, that can't
492- // work in Rust CI
500+ // FIXME: RA's test suite tries to write to the source directory, that can't work in Rust CI
501+ // without properly wiring up the writable test dir.
493502 cargo. env ( "SKIP_SLOW_TESTS" , "1" ) ;
494503
504+ // NOTE: we need to skip `src/tools/rust-analyzer/xtask` as they seem to exercise rustup /
505+ // stable rustfmt.
506+ //
507+ // NOTE: you can only skip a specific workspace package via `--exclude=...` if you *also*
508+ // specify `--workspace`.
509+ cargo. arg ( "--workspace" ) ;
510+ cargo. arg ( "--exclude=xtask" ) ;
511+
512+ let mut skip_tests = vec ! [ ] ;
513+
514+ // NOTE: the following test skips is a bit cheeky in that it assumes there are no
515+ // identically named tests across different r-a packages, where we want to run the
516+ // identically named test in one package but not another. If we want to support that use
517+ // case, we'd have to run the r-a tests in two batches (with one excluding the package that
518+ // we *don't* want to run the test for, and the other batch including).
519+
520+ // Across all platforms.
521+ skip_tests. extend_from_slice ( & [
522+ // FIXME: this test wants to find a `rustc`. We need to provide it with a path to staged
523+ // in-tree `rustc`, but setting `RUSTC` env var requires some reworking of bootstrap.
524+ "tests::smoke_test_real_sysroot_cargo" ,
525+ // NOTE: part of `smol-str` test suite; this tries to access a stable rustfmt from the
526+ // environment, which is not something we want to do.
527+ "check_code_formatting" ,
528+ ] ) ;
529+
530+ let skip_tests = skip_tests. iter ( ) . map ( |name| format ! ( "--skip={name}" ) ) . collect :: < Vec < _ > > ( ) ;
531+ let skip_tests = skip_tests. iter ( ) . map ( |s| s. as_str ( ) ) . collect :: < Vec < _ > > ( ) ;
532+
495533 cargo. add_rustc_lib_path ( builder) ;
496- run_cargo_test ( cargo, & [ ] , & [ ] , "rust-analyzer" , host , builder) ;
534+ run_cargo_test ( cargo, skip_tests . as_slice ( ) , & [ ] , "rust-analyzer" , target , builder) ;
497535 }
498536
499537 fn metadata ( & self ) -> Option < StepMetadata > {
0 commit comments