Touch up rls integration
* Use the right version when building combined installer * Update dependencies of rls as it depends on rustc and plugins * Fix build-manifest and the versions it uses for the rls
This commit is contained in:
parent
5766d526a2
commit
13d008d1e8
2
cargo
2
cargo
@ -1 +1 @@
|
||||
Subproject commit 4e95c6b41eca3388f54dd5f7787366ad2df637b5
|
||||
Subproject commit 4729175045b41b688ab903120860866ce7a22ba9
|
@ -39,8 +39,10 @@ use util::{cp_r, libdir, is_dylib, cp_filtered, copy, exe};
|
||||
fn pkgname(build: &Build, component: &str) -> String {
|
||||
if component == "cargo" {
|
||||
format!("{}-{}", component, build.cargo_package_vers())
|
||||
} else if component == "rls" {
|
||||
format!("{}-{}", component, build.package_vers(&build.release_num("rls")))
|
||||
} else {
|
||||
assert!(component.starts_with("rust") || component == "rls");
|
||||
assert!(component.starts_with("rust"));
|
||||
format!("{}-{}", component, build.rust_package_vers())
|
||||
}
|
||||
}
|
||||
@ -598,7 +600,8 @@ pub fn rls(build: &Build, stage: u32, target: &str) {
|
||||
|
||||
let src = build.src.join("rls");
|
||||
let release_num = build.release_num("rls");
|
||||
let name = format!("rls-{}", build.package_vers(&release_num));
|
||||
let name = pkgname(build, "rls");
|
||||
let version = build.rls_info.version(build, &release_num);
|
||||
|
||||
let tmp = tmpdir(build);
|
||||
let image = tmp.join("rls-image");
|
||||
@ -614,6 +617,15 @@ pub fn rls(build: &Build, stage: u32, target: &str) {
|
||||
install(&src.join("LICENSE-MIT"), &doc, 0o644);
|
||||
install(&src.join("LICENSE-APACHE"), &doc, 0o644);
|
||||
|
||||
// Prepare the overlay
|
||||
let overlay = tmp.join("rls-overlay");
|
||||
drop(fs::remove_dir_all(&overlay));
|
||||
t!(fs::create_dir_all(&overlay));
|
||||
install(&src.join("README.md"), &overlay, 0o644);
|
||||
install(&src.join("LICENSE-MIT"), &overlay, 0o644);
|
||||
install(&src.join("LICENSE-APACHE"), &overlay, 0o644);
|
||||
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
|
||||
|
||||
// Generate the installer tarball
|
||||
let mut cmd = Command::new("sh");
|
||||
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
|
||||
@ -623,6 +635,7 @@ pub fn rls(build: &Build, stage: u32, target: &str) {
|
||||
.arg(format!("--image-dir={}", sanitize_sh(&image)))
|
||||
.arg(format!("--work-dir={}", sanitize_sh(&tmpdir(build))))
|
||||
.arg(format!("--output-dir={}", sanitize_sh(&distdir(build))))
|
||||
.arg(format!("--non-installed-overlay={}", sanitize_sh(&overlay)))
|
||||
.arg(format!("--package-name={}-{}", name, target))
|
||||
.arg("--component-name=rls")
|
||||
.arg("--legacy-manifest-dirs=rustlib,cargo");
|
||||
@ -991,6 +1004,7 @@ pub fn hash_and_sign(build: &Build) {
|
||||
cmd.arg(today.trim());
|
||||
cmd.arg(build.rust_package_vers());
|
||||
cmd.arg(build.package_vers(&build.release_num("cargo")));
|
||||
cmd.arg(build.package_vers(&build.release_num("rls")));
|
||||
cmd.arg(addr);
|
||||
|
||||
t!(fs::create_dir_all(distdir(build)));
|
||||
|
@ -151,6 +151,7 @@ pub struct Build {
|
||||
out: PathBuf,
|
||||
rust_info: channel::GitInfo,
|
||||
cargo_info: channel::GitInfo,
|
||||
rls_info: channel::GitInfo,
|
||||
local_rebuild: bool,
|
||||
|
||||
// Probed tools at runtime
|
||||
@ -234,6 +235,7 @@ impl Build {
|
||||
};
|
||||
let rust_info = channel::GitInfo::new(&src);
|
||||
let cargo_info = channel::GitInfo::new(&src.join("cargo"));
|
||||
let rls_info = channel::GitInfo::new(&src.join("rls"));
|
||||
let src_is_git = src.join(".git").exists();
|
||||
|
||||
Build {
|
||||
@ -246,6 +248,7 @@ impl Build {
|
||||
|
||||
rust_info: rust_info,
|
||||
cargo_info: cargo_info,
|
||||
rls_info: rls_info,
|
||||
local_rebuild: local_rebuild,
|
||||
cc: HashMap::new(),
|
||||
cxx: HashMap::new(),
|
||||
|
@ -572,7 +572,13 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
||||
.run(move |s| compile::tool(build, s.stage, s.target, "cargo"));
|
||||
rules.build("tool-rls", "rls")
|
||||
.host(true)
|
||||
.dep(|s| s.name("libstd"))
|
||||
.dep(|s| s.name("librustc"))
|
||||
.dep(move |s| {
|
||||
// rls, like cargo, uses procedural macros
|
||||
s.name("librustc-link")
|
||||
.target(&build.config.build)
|
||||
.host(&build.config.build)
|
||||
})
|
||||
.run(move |s| compile::tool(build, s.stage, s.target, "rls"));
|
||||
|
||||
// ========================================================================
|
||||
@ -695,7 +701,6 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
||||
.run(move |s| dist::docs(build, s.stage, s.target));
|
||||
rules.dist("dist-analysis", "analysis")
|
||||
.dep(|s| s.name("dist-std"))
|
||||
.default(true)
|
||||
.only_host_build(true)
|
||||
.run(move |s| dist::analysis(build, &s.compiler(), s.target));
|
||||
rules.dist("dist-rls", "rls")
|
||||
|
@ -135,6 +135,7 @@ macro_rules! t {
|
||||
struct Builder {
|
||||
rust_release: String,
|
||||
cargo_release: String,
|
||||
rls_release: String,
|
||||
input: PathBuf,
|
||||
output: PathBuf,
|
||||
gpg_passphrase: String,
|
||||
@ -143,6 +144,7 @@ struct Builder {
|
||||
date: String,
|
||||
rust_version: String,
|
||||
cargo_version: String,
|
||||
rls_version: String,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@ -152,6 +154,7 @@ fn main() {
|
||||
let date = args.next().unwrap();
|
||||
let rust_release = args.next().unwrap();
|
||||
let cargo_release = args.next().unwrap();
|
||||
let rls_release = args.next().unwrap();
|
||||
let s3_address = args.next().unwrap();
|
||||
let mut passphrase = String::new();
|
||||
t!(io::stdin().read_to_string(&mut passphrase));
|
||||
@ -159,6 +162,7 @@ fn main() {
|
||||
Builder {
|
||||
rust_release: rust_release,
|
||||
cargo_release: cargo_release,
|
||||
rls_release: rls_release,
|
||||
input: input,
|
||||
output: output,
|
||||
gpg_passphrase: passphrase,
|
||||
@ -167,6 +171,7 @@ fn main() {
|
||||
date: date,
|
||||
rust_version: String::new(),
|
||||
cargo_version: String::new(),
|
||||
rls_version: String::new(),
|
||||
}.build();
|
||||
}
|
||||
|
||||
@ -174,6 +179,7 @@ impl Builder {
|
||||
fn build(&mut self) {
|
||||
self.rust_version = self.version("rust", "x86_64-unknown-linux-gnu");
|
||||
self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");
|
||||
self.rls_version = self.version("rls", "x86_64-unknown-linux-gnu");
|
||||
|
||||
self.digest_and_sign();
|
||||
let Manifest { manifest_version, date, pkg } = self.build_manifest();
|
||||
@ -223,11 +229,8 @@ impl Builder {
|
||||
self.package("rust-std", &mut manifest.pkg, TARGETS);
|
||||
self.package("rust-docs", &mut manifest.pkg, TARGETS);
|
||||
self.package("rust-src", &mut manifest.pkg, &["*"]);
|
||||
|
||||
if self.rust_release == "nightly" {
|
||||
self.package("rls", &mut manifest.pkg, HOSTS);
|
||||
self.package("rust-analysis", &mut manifest.pkg, TARGETS);
|
||||
}
|
||||
self.package("rls", &mut manifest.pkg, HOSTS);
|
||||
self.package("rust-analysis", &mut manifest.pkg, TARGETS);
|
||||
|
||||
let mut pkg = Package {
|
||||
version: self.cached_version("rust").to_string(),
|
||||
@ -266,6 +269,14 @@ impl Builder {
|
||||
});
|
||||
}
|
||||
|
||||
extensions.push(Component {
|
||||
pkg: "rls".to_string(),
|
||||
target: host.to_string(),
|
||||
});
|
||||
extensions.push(Component {
|
||||
pkg: "rust-analysis".to_string(),
|
||||
target: host.to_string(),
|
||||
});
|
||||
for target in TARGETS {
|
||||
if target != host {
|
||||
extensions.push(Component {
|
||||
@ -273,16 +284,6 @@ impl Builder {
|
||||
target: target.to_string(),
|
||||
});
|
||||
}
|
||||
if self.rust_release == "nightly" {
|
||||
extensions.push(Component {
|
||||
pkg: "rust-analysis".to_string(),
|
||||
target: target.to_string(),
|
||||
});
|
||||
extensions.push(Component {
|
||||
pkg: "rls".to_string(),
|
||||
target: host.to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
extensions.push(Component {
|
||||
pkg: "rust-src".to_string(),
|
||||
@ -348,6 +349,8 @@ impl Builder {
|
||||
format!("rust-src-{}.tar.gz", self.rust_release)
|
||||
} else if component == "cargo" {
|
||||
format!("cargo-{}-{}.tar.gz", self.cargo_release, target)
|
||||
} else if component == "rls" {
|
||||
format!("rls-{}-{}.tar.gz", self.rls_release, target)
|
||||
} else {
|
||||
format!("{}-{}-{}.tar.gz", component, self.rust_release, target)
|
||||
}
|
||||
@ -356,6 +359,8 @@ impl Builder {
|
||||
fn cached_version(&self, component: &str) -> &str {
|
||||
if component == "cargo" {
|
||||
&self.cargo_version
|
||||
} else if component == "rls" {
|
||||
&self.rls_version
|
||||
} else {
|
||||
&self.rust_version
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user