Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cargo check" makes "cargo test" fail #2896

Closed
matthiaskrgr opened this issue Jul 4, 2018 · 2 comments
Closed

"cargo check" makes "cargo test" fail #2896

matthiaskrgr opened this issue Jul 4, 2018 · 2 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@matthiaskrgr
Copy link
Member

repo is at
30a9879

cargo check
[...]
cargo test
[...]
test [run-pass] run-pass/regressions.rs ... ok
test [run-pass] run-pass/used_underscore_binding_macro.rs ... FAILED
test [run-pass] run-pass/returns.rs ... ok
test [run-pass] run-pass/whitelist/conf_whitelisted.rs ... ok
test [run-pass] run-pass/single-match-else.rs ... ok
failures:
---- [run-pass] run-pass/used_underscore_binding_macro.rs stdout ----
error: compilation failed!
status: exit code: 101
command: "target/debug/clippy-driver" "tests/run-pass/used_underscore_binding_macro.rs" "-L" "/home/matthias/vcs/github/rust-clippy/target/debug/test_build_base" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/home/matthias/vcs/github/rust-clippy/target/debug/test_build_base/used_underscore_binding_macro.stage-id" "-L" "target/debug" "-L" "target/debug/deps" "-Dwarnings" "-L" "/home/matthias/vcs/github/rust-clippy/target/debug/test_build_base/used_underscore_binding_macro.stage-id.aux"
stdout:
------------------------------------------
------------------------------------------
stderr:
------------------------------------------
error[E0464]: multiple matching crates for `serde`
  --> tests/run-pass/used_underscore_binding_macro.rs:10:10
   |
10 | #[derive(Deserialize)]
   |          ^^^^^^^^^^^
   |
   = note: candidates:
           crate `serde`: /home/matthias/vcs/github/rust-clippy/target/debug/deps/libserde-13a2511189973f33.rlib
error[E0463]: can't find crate for `_serde`
  --> tests/run-pass/used_underscore_binding_macro.rs:10:10
   |
10 | #[derive(Deserialize)]
   |          ^^^^^^^^^^^ can't find crate
error: aborting due to 2 previous errors
Some errors occurred: E0463, E0464.
For more information about an error, try `rustc --explain E0463`.
------------------------------------------
thread '[run-pass] run-pass/used_underscore_binding_macro.rs' panicked at 'explicit panic', /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.11/src/runtest.rs:2544:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
    [run-pass] run-pass/used_underscore_binding_macro.rs
test result: FAILED. 27 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
test compile_test ... FAILED
failures:
---- compile_test stdout ----
thread 'compile_test' panicked at 'Some tests failed', /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.11/src/lib.rs:89:22
failures:
    compile_test
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test compile-test'

If I just run cargo clean ; cargo test though, there is no panic.

@phansch phansch added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Jul 6, 2018
@matthiaskrgr
Copy link
Member Author

I wonder if we could solve this by switching the compiletests to edition 2018, but I don't know if compiletest-rs supports this.

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Sep 26, 2018

This can be fixed by manually injecting the paths to the serde libs into rustc_flags like --extern serde=path/to/serde.rlib

So, somehow we fail to inject the deps properly. This should be handled by
config.target_rustcflags = Some(format!("-L {0} -L {0}/deps -Dwarnings", host_libs().display()));
but apparently that is not enough. :/

matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this issue Oct 29, 2018
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this issue Oct 29, 2018
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this issue Oct 29, 2018
bors bot added a commit that referenced this issue Oct 29, 2018
3380: compiletest: clean rmeta data (from "cargo check") before running compiletest r=phansch a=matthiaskrgr

Fixes #2896
Fixes #2139

Co-authored-by: Matthias Krüger <[email protected]>
@bors bors bot closed this as completed in #3380 Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants