Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit cfb23e8

Browse files
committed
bootstrap: convert rls to use Tarball
1 parent 2b54f0d commit cfb23e8

File tree

2 files changed

+13
-50
lines changed

2 files changed

+13
-50
lines changed

src/bootstrap/dist.rs

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,63 +1070,19 @@ impl Step for Rls {
10701070
let target = self.target;
10711071
assert!(builder.config.extended);
10721072

1073-
let src = builder.src.join("src/tools/rls");
1074-
let release_num = builder.release_num("rls");
1075-
let name = pkgname(builder, "rls");
1076-
let version = builder.rls_info.version(builder, &release_num);
1077-
1078-
let tmp = tmpdir(builder);
1079-
let image = tmp.join("rls-image");
1080-
drop(fs::remove_dir_all(&image));
1081-
t!(fs::create_dir_all(&image));
1082-
1083-
// Prepare the image directory
1084-
// We expect RLS to build, because we've exited this step above if tool
1085-
// state for RLS isn't testing.
10861073
let rls = builder
10871074
.ensure(tool::Rls { compiler, target, extra_features: Vec::new() })
10881075
.or_else(|| {
10891076
missing_tool("RLS", builder.build.config.missing_tools);
10901077
None
10911078
})?;
10921079

1093-
builder.install(&rls, &image.join("bin"), 0o755);
1094-
let doc = image.join("share/doc/rls");
1095-
builder.install(&src.join("README.md"), &doc, 0o644);
1096-
builder.install(&src.join("LICENSE-MIT"), &doc, 0o644);
1097-
builder.install(&src.join("LICENSE-APACHE"), &doc, 0o644);
1098-
1099-
// Prepare the overlay
1100-
let overlay = tmp.join("rls-overlay");
1101-
drop(fs::remove_dir_all(&overlay));
1102-
t!(fs::create_dir_all(&overlay));
1103-
builder.install(&src.join("README.md"), &overlay, 0o644);
1104-
builder.install(&src.join("LICENSE-MIT"), &overlay, 0o644);
1105-
builder.install(&src.join("LICENSE-APACHE"), &overlay, 0o644);
1106-
builder.create(&overlay.join("version"), &version);
1107-
1108-
// Generate the installer tarball
1109-
let mut cmd = rust_installer(builder);
1110-
cmd.arg("generate")
1111-
.arg("--product-name=Rust")
1112-
.arg("--rel-manifest-dir=rustlib")
1113-
.arg("--success-message=RLS-ready-to-serve.")
1114-
.arg("--image-dir")
1115-
.arg(&image)
1116-
.arg("--work-dir")
1117-
.arg(&tmpdir(builder))
1118-
.arg("--output-dir")
1119-
.arg(&distdir(builder))
1120-
.arg("--non-installed-overlay")
1121-
.arg(&overlay)
1122-
.arg(format!("--package-name={}-{}", name, target.triple))
1123-
.arg("--legacy-manifest-dirs=rustlib,cargo")
1124-
.arg("--component-name=rls-preview");
1125-
1126-
builder.info(&format!("Dist RLS stage{} ({})", compiler.stage, target.triple));
1127-
let _time = timeit(builder);
1128-
builder.run(&mut cmd);
1129-
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target.triple)))
1080+
let mut tarball = Tarball::new(builder, "rls", &target.triple);
1081+
tarball.set_overlay(OverlayKind::RLS);
1082+
tarball.is_preview(true);
1083+
tarball.add_file(rls, "bin", 0o755);
1084+
tarball.add_legal_and_readme_to("share/doc/rls");
1085+
Some(tarball.generate())
11301086
}
11311087
}
11321088

src/bootstrap/tarball.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub(crate) enum OverlayKind {
1212
Clippy,
1313
Miri,
1414
Rustfmt,
15+
RLS,
1516
}
1617

1718
impl OverlayKind {
@@ -42,6 +43,11 @@ impl OverlayKind {
4243
"src/tools/rustfmt/LICENSE-APACHE",
4344
"src/tools/rustfmt/LICENSE-MIT",
4445
],
46+
OverlayKind::RLS => &[
47+
"src/tools/rls/README.md",
48+
"src/tools/rls/LICENSE-APACHE",
49+
"src/tools/rls/LICENSE-MIT",
50+
],
4551
}
4652
}
4753

@@ -59,6 +65,7 @@ impl OverlayKind {
5965
OverlayKind::Rustfmt => {
6066
builder.rustfmt_info.version(builder, &builder.release_num("rustfmt"))
6167
}
68+
OverlayKind::RLS => builder.rls_info.version(builder, &builder.release_num("rls")),
6269
}
6370
}
6471
}

0 commit comments

Comments
 (0)