[cargo-miri] Don't skip rlib crates

This commit is contained in:
hyd-dev 2021-02-14 02:02:21 +08:00
parent 7ac8be8529
commit 80112820fd
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
6 changed files with 25 additions and 9 deletions

View File

@ -596,16 +596,13 @@ fn phase_cargo_rustc(args: env::Args) {
let target_crate = is_target_crate();
let print = get_arg_flag_value("--print").is_some(); // whether this is cargo passing `--print` to get some infos
// rlib and cdylib are just skipped, we cannot interpret them and do not need them
// cdylib is just skipped, we cannot interpret it and do not need it
// for the rest of the build either.
match get_arg_flag_value("--crate-type").as_deref() {
Some("rlib") | Some("cdylib") => {
if verbose {
eprint!("[cargo-miri rustc] (rlib/cdylib skipped)");
}
return;
if get_arg_flag_value("--crate-type").as_deref() == Some("cdylib") {
if verbose {
eprint!("[cargo-miri rustc] (cdylib skipped)");
}
_ => {},
return;
}
let store_json = |info: CrateRunInfo| {

View File

@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "byteorder"
version = "1.3.4"
@ -13,6 +15,7 @@ dependencies = [
"byteorder",
"issue_1567",
"rand",
"rlib-dep",
"serde_derive",
]
@ -140,6 +143,10 @@ dependencies = [
"rand_core",
]
[[package]]
name = "rlib-dep"
version = "0.1.0"
[[package]]
name = "serde_derive"
version = "1.0.118"

View File

@ -9,6 +9,7 @@ edition = "2018"
[dependencies]
byteorder = "1.0"
rlib-dep.path = "rlib-dep"
issue_1567 = { path ="issue-1567" }
[dev-dependencies]

View File

@ -0,0 +1,8 @@
[package]
name = "rlib-dep"
version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"
[lib]
crate-type = ["rlib"]

View File

@ -0,0 +1,3 @@
pub fn use_me() -> bool {
true
}

View File

@ -3,5 +3,5 @@
/// assert!(cargo_miri_test::make_true());
/// ```
pub fn make_true() -> bool {
true
rlib_dep::use_me()
}