Skip to content

Commit 7eac88a

Browse files
committed
Auto merge of #79096 - pietroalbini:stable-build-manifest-newline, r=Mark-Simulacrum
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.
2 parents e619caf + 82a102b commit 7eac88a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/build-manifest/src/versions.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
77
use tar::Archive;
88

99
const DEFAULT_TARGET: &str = "x86_64-unknown-linux-gnu";
10-
const RUSTC_VERSION: &str = include_str!("../../../version");
1110

1211
#[derive(Debug, Hash, Eq, PartialEq, Clone)]
1312
pub(crate) enum PkgType {
@@ -172,10 +171,10 @@ impl Versions {
172171
) -> Result<String, Error> {
173172
let component_name = package.tarball_component_name();
174173
let version = match self.channel.as_str() {
175-
"stable" => RUSTC_VERSION.into(),
174+
"stable" => self.rustc_version().into(),
176175
"beta" => "beta".into(),
177176
"nightly" => "nightly".into(),
178-
_ => format!("{}-dev", RUSTC_VERSION),
177+
_ => format!("{}-dev", self.rustc_version()),
179178
};
180179

181180
if package.target_independent() {
@@ -186,6 +185,7 @@ impl Versions {
186185
}
187186

188187
pub(crate) fn rustc_version(&self) -> &str {
189-
RUSTC_VERSION
188+
const RUSTC_VERSION: &str = include_str!("../../../version");
189+
RUSTC_VERSION.trim()
190190
}
191191
}

0 commit comments

Comments
 (0)