-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
$NetBSD$ | ||
|
||
https://github.com/rust-lang/miri/commit/e5b340017e39dc90e3f9cf9966244faa585321b5 | ||
|
||
--- src/tools/miri/cargo-miri/bin.rs.orig 2021-06-22 08:33:05.000000000 +0000 | ||
+++ src/tools/miri/cargo-miri/bin.rs | ||
@@ -6,6 +6,7 @@ use std::io::{self, BufRead, BufReader, | ||
use std::ops::Not; | ||
use std::path::{Path, PathBuf}; | ||
use std::process::Command; | ||
+use std::fmt::{Write as _}; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
@@ -90,12 +91,13 @@ fn show_help() { | ||
} | ||
|
||
fn show_version() { | ||
- println!( | ||
- "miri {} ({} {})", | ||
- env!("CARGO_PKG_VERSION"), | ||
- env!("VERGEN_GIT_SHA_SHORT"), | ||
- env!("VERGEN_GIT_COMMIT_DATE") | ||
- ); | ||
+ let mut version = format!("miri {}", env!("CARGO_PKG_VERSION")); | ||
+ // Only use `option_env` on vergen variables to ensure the build succeeds | ||
+ // when vergen failed to find the git info. | ||
+ if let Some(sha) = option_env!("VERGEN_GIT_SHA_SHORT") { | ||
+ write!(&mut version, " ({} {})", sha, option_env!("VERGEN_GIT_COMMIT_DATE").unwrap()).unwrap(); | ||
+ } | ||
+ println!("{}", version); | ||
} | ||
|
||
fn show_error(msg: String) -> ! { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$NetBSD$ | ||
|
||
https://github.com/rust-lang/miri/commit/e5b340017e39dc90e3f9cf9966244faa585321b5 | ||
|
||
--- src/tools/miri/cargo-miri/build.rs.orig 2021-06-22 08:31:31.000000000 +0000 | ||
+++ src/tools/miri/cargo-miri/build.rs | ||
@@ -7,5 +7,5 @@ fn main() { | ||
let mut gen_config = vergen::Config::default(); | ||
*gen_config.git_mut().sha_kind_mut() = vergen::ShaKind::Short; | ||
*gen_config.git_mut().commit_timestamp_kind_mut() = vergen::TimestampKind::DateOnly; | ||
- vergen(gen_config).expect("Unable to generate vergen keys!"); | ||
+ vergen(gen_config).ok(); // Ignore failure (in case we are built outside a git repo) | ||
} |