summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-16 13:59:11 +0000
committerbors <bors@rust-lang.org>2020-11-16 13:59:11 +0000
commit7eac88abb2e57e752f3302f02be5f3ce3d7adfb4 (patch)
tree2564819f75f95433f202ba57beb5257c85c25dad
parente619caf2c9257f2e3408e67c725b699547c4bfd5 (diff)
parent82a102bdf6dbd18807c085b2c2589d3a44c58393 (diff)
downloadrust-1.48.0.tar.gz
rust-1.48.0.zip
Auto merge of #79096 - pietroalbini:stable-build-manifest-newline, r=Mark-Simulacrum 1.48.0
build-manifest: strip newline from rustc version

While running the release process for Rust 1.48.0 I discovered a bug in `build-manifest`: it's not trimming the newline from `src/version`, and it tries to inspect tarballs called `rustc-1.48.0\n-x86_64-unknown-linux-gnu.tar.xz`. The bug only affects stable releases so this is why we're only seeing it right now.

r? `@Mark-Simulacrum`
We'll need to backport this to beta and nightly too.
-rw-r--r--src/tools/build-manifest/src/versions.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/build-manifest/src/versions.rs b/src/tools/build-manifest/src/versions.rs
index 79f2ef8dfc4..c5f3e338c31 100644
--- a/src/tools/build-manifest/src/versions.rs
+++ b/src/tools/build-manifest/src/versions.rs
@@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
 use tar::Archive;
 
 const DEFAULT_TARGET: &str = "x86_64-unknown-linux-gnu";
-const RUSTC_VERSION: &str = include_str!("../../../version");
 
 #[derive(Debug, Hash, Eq, PartialEq, Clone)]
 pub(crate) enum PkgType {
@@ -172,10 +171,10 @@ impl Versions {
     ) -> Result<String, Error> {
         let component_name = package.tarball_component_name();
         let version = match self.channel.as_str() {
-            "stable" => RUSTC_VERSION.into(),
+            "stable" => self.rustc_version().into(),
             "beta" => "beta".into(),
             "nightly" => "nightly".into(),
-            _ => format!("{}-dev", RUSTC_VERSION),
+            _ => format!("{}-dev", self.rustc_version()),
         };
 
         if package.target_independent() {
@@ -186,6 +185,7 @@ impl Versions {
     }
 
     pub(crate) fn rustc_version(&self) -> &str {
-        RUSTC_VERSION
+        const RUSTC_VERSION: &str = include_str!("../../../version");
+        RUSTC_VERSION.trim()
     }
 }