Skip to content

Commit 55a2261

Browse files
authored
Rollup merge of #75103 - Mark-Simulacrum:no-ra-for-riscv64, r=matklad
Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build. Should permit future rust-analyzer ups (e.g., #74813) to land.
2 parents 885d481 + d2fc809 commit 55a2261

File tree

1 file changed

+47
-27
lines changed

1 file changed

+47
-27
lines changed

src/bootstrap/dist.rs

+47-27
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ pub struct RustAnalyzer {
13551355
}
13561356

13571357
impl Step for RustAnalyzer {
1358-
type Output = PathBuf;
1358+
type Output = Option<PathBuf>;
13591359
const ONLY_HOSTS: bool = true;
13601360

13611361
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -1373,11 +1373,17 @@ impl Step for RustAnalyzer {
13731373
});
13741374
}
13751375

1376-
fn run(self, builder: &Builder<'_>) -> PathBuf {
1376+
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
13771377
let compiler = self.compiler;
13781378
let target = self.target;
13791379
assert!(builder.config.extended);
13801380

1381+
if target.contains("riscv64") {
1382+
// riscv64 currently has an LLVM bug that makes rust-analyzer unable
1383+
// to build. See #74813 for details.
1384+
return None;
1385+
}
1386+
13811387
let src = builder.src.join("src/tools/rust-analyzer");
13821388
let release_num = builder.release_num("rust-analyzer/crates/rust-analyzer");
13831389
let name = pkgname(builder, "rust-analyzer");
@@ -1431,7 +1437,7 @@ impl Step for RustAnalyzer {
14311437
builder.info(&format!("Dist rust-analyzer stage{} ({})", compiler.stage, target));
14321438
let _time = timeit(builder);
14331439
builder.run(&mut cmd);
1434-
distdir(builder).join(format!("{}-{}.tar.gz", name, target.triple))
1440+
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target.triple)))
14351441
}
14361442
}
14371443

@@ -1789,7 +1795,7 @@ impl Step for Extended {
17891795
tarballs.push(rustc_installer);
17901796
tarballs.push(cargo_installer);
17911797
tarballs.extend(rls_installer.clone());
1792-
tarballs.push(rust_analyzer_installer.clone());
1798+
tarballs.extend(rust_analyzer_installer.clone());
17931799
tarballs.push(clippy_installer);
17941800
tarballs.extend(miri_installer.clone());
17951801
tarballs.extend(rustfmt_installer.clone());
@@ -1867,7 +1873,9 @@ impl Step for Extended {
18671873
if rls_installer.is_none() {
18681874
contents = filter(&contents, "rls");
18691875
}
1870-
contents = filter(&contents, "rust-analyzer");
1876+
if rust_analyzer_installer.is_none() {
1877+
contents = filter(&contents, "rust-analyzer");
1878+
}
18711879
if miri_installer.is_none() {
18721880
contents = filter(&contents, "miri");
18731881
}
@@ -1914,7 +1922,9 @@ impl Step for Extended {
19141922
if rls_installer.is_some() {
19151923
prepare("rls");
19161924
}
1917-
prepare("rust-analyzer");
1925+
if rust_analyzer_installer.is_some() {
1926+
prepare("rust-analyzer");
1927+
}
19181928
if miri_installer.is_some() {
19191929
prepare("miri");
19201930
}
@@ -1976,7 +1986,9 @@ impl Step for Extended {
19761986
if rls_installer.is_some() {
19771987
prepare("rls");
19781988
}
1979-
prepare("rust-analyzer");
1989+
if rust_analyzer_installer.is_some() {
1990+
prepare("rust-analyzer");
1991+
}
19801992
if miri_installer.is_some() {
19811993
prepare("miri");
19821994
}
@@ -2076,23 +2088,25 @@ impl Step for Extended {
20762088
.arg(etc.join("msi/remove-duplicates.xsl")),
20772089
);
20782090
}
2079-
builder.run(
2080-
Command::new(&heat)
2081-
.current_dir(&exe)
2082-
.arg("dir")
2083-
.arg("rust-analyzer")
2084-
.args(&heat_flags)
2085-
.arg("-cg")
2086-
.arg("RustAnalyzerGroup")
2087-
.arg("-dr")
2088-
.arg("RustAnalyzer")
2089-
.arg("-var")
2090-
.arg("var.RustAnalyzerDir")
2091-
.arg("-out")
2092-
.arg(exe.join("RustAnalyzerGroup.wxs"))
2093-
.arg("-t")
2094-
.arg(etc.join("msi/remove-duplicates.xsl")),
2095-
);
2091+
if rust_analyzer_installer.is_some() {
2092+
builder.run(
2093+
Command::new(&heat)
2094+
.current_dir(&exe)
2095+
.arg("dir")
2096+
.arg("rust-analyzer")
2097+
.args(&heat_flags)
2098+
.arg("-cg")
2099+
.arg("RustAnalyzerGroup")
2100+
.arg("-dr")
2101+
.arg("RustAnalyzer")
2102+
.arg("-var")
2103+
.arg("var.RustAnalyzerDir")
2104+
.arg("-out")
2105+
.arg(exe.join("RustAnalyzerGroup.wxs"))
2106+
.arg("-t")
2107+
.arg(etc.join("msi/remove-duplicates.xsl")),
2108+
);
2109+
}
20962110
builder.run(
20972111
Command::new(&heat)
20982112
.current_dir(&exe)
@@ -2186,7 +2200,9 @@ impl Step for Extended {
21862200
if rls_installer.is_some() {
21872201
cmd.arg("-dRlsDir=rls");
21882202
}
2189-
cmd.arg("-dRustAnalyzerDir=rust-analyzer");
2203+
if rust_analyzer_installer.is_some() {
2204+
cmd.arg("-dRustAnalyzerDir=rust-analyzer");
2205+
}
21902206
if miri_installer.is_some() {
21912207
cmd.arg("-dMiriDir=miri");
21922208
}
@@ -2206,7 +2222,9 @@ impl Step for Extended {
22062222
if rls_installer.is_some() {
22072223
candle("RlsGroup.wxs".as_ref());
22082224
}
2209-
candle("RustAnalyzerGroup.wxs".as_ref());
2225+
if rust_analyzer_installer.is_some() {
2226+
candle("RustAnalyzerGroup.wxs".as_ref());
2227+
}
22102228
if miri_installer.is_some() {
22112229
candle("MiriGroup.wxs".as_ref());
22122230
}
@@ -2244,7 +2262,9 @@ impl Step for Extended {
22442262
if rls_installer.is_some() {
22452263
cmd.arg("RlsGroup.wixobj");
22462264
}
2247-
cmd.arg("RustAnalyzerGroup.wixobj");
2265+
if rust_analyzer_installer.is_some() {
2266+
cmd.arg("RustAnalyzerGroup.wixobj");
2267+
}
22482268
if miri_installer.is_some() {
22492269
cmd.arg("MiriGroup.wixobj");
22502270
}

0 commit comments

Comments
 (0)