Skip to content

Commit

Permalink
Auto merge of #1709 - hyd-dev:rlib, r=RalfJung
Browse files Browse the repository at this point in the history
[cargo-miri] Don't skip `rlib` crates

Fixes #1691.
  • Loading branch information
bors committed Feb 14, 2021
2 parents 7ac8be8 + 0737de8 commit c3f7069
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
13 changes: 5 additions & 8 deletions cargo-miri/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
5 changes: 5 additions & 0 deletions test-cargo-miri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion test-cargo-miri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ edition = "2018"

[dependencies]
byteorder = "1.0"
issue_1567 = { path ="issue-1567" }
issue_1567 = { path = "issue-1567" }
issue_1691 = { path = "issue-1691" }

[dev-dependencies]
rand = { version = "0.7", features = ["small_rng"] }
Expand Down
8 changes: 8 additions & 0 deletions test-cargo-miri/issue-1691/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "issue_1691"
version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"

[lib]
crate-type = ["rlib"]
3 changes: 3 additions & 0 deletions test-cargo-miri/issue-1691/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn use_me() -> bool {
true
}
2 changes: 1 addition & 1 deletion test-cargo-miri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/// assert!(cargo_miri_test::make_true());
/// ```
pub fn make_true() -> bool {
true
issue_1691::use_me()
}

0 comments on commit c3f7069

Please sign in to comment.