rustbuild: Don't hardcode 'nightly' for Cargo
It now follows rustc release trains
This commit is contained in:
parent
58c701f5c7
commit
fe2b7a4952
|
@ -37,8 +37,12 @@ use channel;
|
||||||
use util::{cp_r, libdir, is_dylib, cp_filtered, copy, exe};
|
use util::{cp_r, libdir, is_dylib, cp_filtered, copy, exe};
|
||||||
|
|
||||||
fn pkgname(build: &Build, component: &str) -> String {
|
fn pkgname(build: &Build, component: &str) -> String {
|
||||||
assert!(component.starts_with("rust")); // does not work with cargo
|
if component == "cargo" {
|
||||||
format!("{}-{}", component, build.rust_package_vers())
|
format!("{}-{}", component, build.cargo_package_vers())
|
||||||
|
} else {
|
||||||
|
assert!(component.starts_with("rust"));
|
||||||
|
format!("{}-{}", component, build.rust_package_vers())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn distdir(build: &Build) -> PathBuf {
|
fn distdir(build: &Build) -> PathBuf {
|
||||||
|
@ -533,7 +537,7 @@ pub fn cargo(build: &Build, stage: u32, target: &str) {
|
||||||
let src = build.src.join("cargo");
|
let src = build.src.join("cargo");
|
||||||
let etc = src.join("src/etc");
|
let etc = src.join("src/etc");
|
||||||
let release_num = build.cargo_release_num();
|
let release_num = build.cargo_release_num();
|
||||||
let name = format!("cargo-{}", build.package_vers(&release_num));
|
let name = pkgname(build, "cargo");
|
||||||
let version = build.cargo_info.version(build, &release_num);
|
let version = build.cargo_info.version(build, &release_num);
|
||||||
|
|
||||||
let tmp = tmpdir(build);
|
let tmp = tmpdir(build);
|
||||||
|
@ -591,12 +595,11 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
|
||||||
println!("Dist extended stage{} ({})", stage, target);
|
println!("Dist extended stage{} ({})", stage, target);
|
||||||
|
|
||||||
let dist = distdir(build);
|
let dist = distdir(build);
|
||||||
let cargo_vers = build.cargo_release_num();
|
|
||||||
let rustc_installer = dist.join(format!("{}-{}.tar.gz",
|
let rustc_installer = dist.join(format!("{}-{}.tar.gz",
|
||||||
pkgname(build, "rustc"),
|
pkgname(build, "rustc"),
|
||||||
target));
|
target));
|
||||||
let cargo_installer = dist.join(format!("cargo-{}-{}.tar.gz",
|
let cargo_installer = dist.join(format!("{}-{}.tar.gz",
|
||||||
build.package_vers(&cargo_vers),
|
pkgname(build, "cargo"),
|
||||||
target));
|
target));
|
||||||
let docs_installer = dist.join(format!("{}-{}.tar.gz",
|
let docs_installer = dist.join(format!("{}-{}.tar.gz",
|
||||||
pkgname(build, "rust-docs"),
|
pkgname(build, "rust-docs"),
|
||||||
|
@ -674,7 +677,7 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
|
||||||
|
|
||||||
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target)),
|
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target)),
|
||||||
&pkg.join("rustc"));
|
&pkg.join("rustc"));
|
||||||
cp_r(&work.join(&format!("cargo-nightly-{}", target)),
|
cp_r(&work.join(&format!("{}-{}", pkgname(build, "cargo"), target)),
|
||||||
&pkg.join("cargo"));
|
&pkg.join("cargo"));
|
||||||
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-docs"), target)),
|
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-docs"), target)),
|
||||||
&pkg.join("rust-docs"));
|
&pkg.join("rust-docs"));
|
||||||
|
@ -726,7 +729,7 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
|
||||||
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target))
|
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target))
|
||||||
.join("rustc"),
|
.join("rustc"),
|
||||||
&exe.join("rustc"));
|
&exe.join("rustc"));
|
||||||
cp_r(&work.join(&format!("cargo-nightly-{}", target))
|
cp_r(&work.join(&format!("{}-{}", pkgname(build, "cargo"), target))
|
||||||
.join("cargo"),
|
.join("cargo"),
|
||||||
&exe.join("cargo"));
|
&exe.join("cargo"));
|
||||||
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-docs"), target))
|
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-docs"), target))
|
||||||
|
|
|
@ -1015,6 +1015,11 @@ impl Build {
|
||||||
self.package_vers(channel::CFG_RELEASE_NUM)
|
self.package_vers(channel::CFG_RELEASE_NUM)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the value of `package_vers` above for Cargo
|
||||||
|
fn cargo_package_vers(&self) -> String {
|
||||||
|
self.package_vers(&self.cargo_release_num())
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the `version` string associated with this compiler for Rust
|
/// Returns the `version` string associated with this compiler for Rust
|
||||||
/// itself.
|
/// itself.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue