/// User-specified configuration from `config.toml`.
config: Config,
+ // Version information
+ version: String,
+
// Properties derived from the above configuration
src: PathBuf,
out: PathBuf,
.unwrap()
.to_path_buf();
+ let version = std::fs::read_to_string(src.join("src").join("version"))
+ .expect("failed to read src/version");
+ let version = version.trim();
+
let mut build = Build {
initial_rustc: config.initial_rustc.clone(),
initial_cargo: config.initial_cargo.clone(),
targets: config.targets.clone(),
config,
+ version: version.to_string(),
src,
out,
.next()
.unwrap()
.trim();
- let my_version = channel::CFG_RELEASE_NUM;
- if local_release.split('.').take(2).eq(my_version.split('.').take(2)) {
+ if local_release.split('.').take(2).eq(version.split('.').take(2)) {
build.verbose(&format!("auto-detected local-rebuild {}", local_release));
build.local_rebuild = true;
}
match which {
GitRepo::Rustc => {
- let sha = self.rust_sha().unwrap_or(channel::CFG_RELEASE_NUM);
+ let sha = self.rust_sha().unwrap_or(&self.version);
Some(format!("/rustc/{}", sha))
}
GitRepo::Llvm => Some(String::from("/rustc/llvm")),
/// Returns the value of `release` above for Rust itself.
fn rust_release(&self) -> String {
- self.release(channel::CFG_RELEASE_NUM)
+ self.release(&self.version)
}
/// Returns the "package version" for a component given the `num` release
/// Returns the value of `package_vers` above for Rust itself.
fn rust_package_vers(&self) -> String {
- self.package_vers(channel::CFG_RELEASE_NUM)
+ self.package_vers(&self.version)
}
/// Returns the value of `package_vers` above for Cargo
}
fn llvm_tools_package_vers(&self) -> String {
- self.package_vers(channel::CFG_RELEASE_NUM)
+ self.package_vers(&self.version)
}
fn llvm_tools_vers(&self) -> String {
/// Note that this is a descriptive string which includes the commit date,
/// sha, version, etc.
fn rust_version(&self) -> String {
- self.rust_info.version(self, channel::CFG_RELEASE_NUM)
+ self.rust_info.version(self, &self.version)
}
/// Returns the full commit hash.