pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rust: fix for https://github.com/rust-lang/rust/issues/86436



Module Name:	pkgsrc-wip
Committed By:	Adam Ciarciński <aciarcinski%teonite.com@localhost>
Pushed By:	adam
Date:		Tue Jun 22 10:43:20 2021 +0200
Changeset:	13fac88d735e4038f828996e80b013036775add0

Modified Files:
	rust/distinfo
Added Files:
	rust/patches/patch-src_tools_miri_cargo-miri_bin.rs
	rust/patches/patch-src_tools_miri_cargo-miri_build.rs

Log Message:
rust: fix for https://github.com/rust-lang/rust/issues/86436

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=13fac88d735e4038f828996e80b013036775add0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust/distinfo                                      |  2 ++
 .../patches/patch-src_tools_miri_cargo-miri_bin.rs | 34 ++++++++++++++++++++++
 .../patch-src_tools_miri_cargo-miri_build.rs       | 13 +++++++++
 3 files changed, 49 insertions(+)

diffs:
diff --git a/rust/distinfo b/rust/distinfo
index b8e369f084..c5354439e8 100644
--- a/rust/distinfo
+++ b/rust/distinfo
@@ -126,6 +126,8 @@ SHA1 (patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h) = 977
 SHA1 (patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp) = 2675b93a1d636b297a3e1e84b915a15a3da67939
 SHA1 (patch-src_tools_cargo_src_cargo_core_profiles.rs) = 3aac5d54a6fe96b9559552e67e497488142d4e80
 SHA1 (patch-src_tools_cargo_tests_testsuite_build.rs) = 10e6c1253adac0262b000aec7636fa0d2ebb666c
+SHA1 (patch-src_tools_miri_cargo-miri_bin.rs) = d0a9c01e1ade98b8074784f9451efdec8e323532
+SHA1 (patch-src_tools_miri_cargo-miri_build.rs) = 9d4e29a2be3caf815810acad1572fcb48756a0cb
 SHA1 (patch-src_tools_rls_rls_src_cmd.rs) = fade3e60fecac5c4e4d4ee5bee82659b4eb385b7
 SHA1 (patch-src_tools_rls_rls_src_server_io.rs) = 51af64526db55abcf6b4b3165df314a16cf62e34
 SHA1 (patch-src_tools_rust-installer_install-template.sh) = f2533c2ae0d45d48b5ebea5d36842b4a1b9009af
diff --git a/rust/patches/patch-src_tools_miri_cargo-miri_bin.rs b/rust/patches/patch-src_tools_miri_cargo-miri_bin.rs
new file mode 100644
index 0000000000..719a99c22f
--- /dev/null
+++ b/rust/patches/patch-src_tools_miri_cargo-miri_bin.rs
@@ -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) -> ! {
diff --git a/rust/patches/patch-src_tools_miri_cargo-miri_build.rs b/rust/patches/patch-src_tools_miri_cargo-miri_build.rs
new file mode 100644
index 0000000000..b0819edf6e
--- /dev/null
+++ b/rust/patches/patch-src_tools_miri_cargo-miri_build.rs
@@ -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)
+ }


Home | Main Index | Thread Index | Old Index