Skip to content
Snippets Groups Projects
Unverified Commit f10ee11f authored by Aaron Hill's avatar Aaron Hill
Browse files

Fix build.rs failing with a rustc built from a tarball

Fixes #1601
parent bd48043e
No related branches found
No related tags found
No related merge requests found
...@@ -103,9 +103,16 @@ fn rustc_minor_nightly() -> Option<(u32, bool)> { ...@@ -103,9 +103,16 @@ fn rustc_minor_nightly() -> Option<(u32, bool)> {
} }
let minor = pieces.next(); let minor = pieces.next();
let nightly_raw = otry!(otry!(pieces.next()).split('-').nth(1));
let nightly = // If `rustc` was built from a tarball, its version string
nightly_raw.starts_with("dev") || nightly_raw.starts_with("nightly"); // will have neither a git hash nor a commit date
// (e.g. "rustc 1.39.0"). Treat this case as non-nightly,
// since a nightly build should either come from CI
// or a git checkout
let nightly_raw = otry!(pieces.next()).split('-').nth(1);
let nightly = nightly_raw
.map(|raw| raw.starts_with("dev") || raw.starts_with("nightly"))
.unwrap_or(false);
let minor = otry!(otry!(minor).parse().ok()); let minor = otry!(otry!(minor).parse().ok());
Some((minor, nightly)) Some((minor, nightly))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment