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

compile_test fails at head: dependencies not found in depinfo #8248

Closed
sourcefrog opened this issue Jan 8, 2022 · 3 comments · Fixed by #8249
Closed

compile_test fails at head: dependencies not found in depinfo #8248

sourcefrog opened this issue Jan 8, 2022 · 3 comments · Fixed by #8249
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@sourcefrog
Copy link
Contributor

sourcefrog commented Jan 8, 2022

Summary

In a clean checkout of v0.0.212-9018-g917890bab, using rustc 1.59.0-nightly (78fd0f633 2021-12-29), I ran

rm -r target
cargo b
cargo t

It fails:

Reproducer

In a clean checkout of v0.0.212-9018-g917890bab, using rustc 1.59.0-nightly (78fd0f633 2021-12-29), I ran

rm -r target
cargo b
cargo t

I expected to see the tests pass.

I actually get:

    Finished test [unoptimized + debuginfo] target(s) in 0.02s
     Running unittests (target/debug/deps/clippy_driver-e7ed8bd0df772200)

running 1 test
test test_arg_value ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/compile-test.rs (target/debug/deps/compile_test-10c01cabd6447209)

running 1 test
test compile_test ... FAILED

failures:

---- compile_test stdout ----
thread 'compile_test' panicked at 'dependencies not found in depinfo: ["clippy_utils", "derive_new", "futures", "if_chain", "itertools", "quote", "regex", "serde", "serde_derive", "syn", "tokio", "parking_lot"]
help: Make sure the `-Z binary-dep-depinfo` rust flag is enabled
help: Try adding to dev-dependencies in Cargo.toml', tests/compile-test.rs:102:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    compile_test

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--test compile-test'

Version

rustc 1.59.0-nightly (78fd0f633 2021-12-29)
binary: rustc
commit-hash: 78fd0f633faaa5b6dd254fc1456735f63a1b1238
commit-date: 2021-12-29
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0

Additional Labels

No response

@sourcefrog sourcefrog added the C-bug Category: Clippy is not doing the correct thing label Jan 8, 2022
@sourcefrog
Copy link
Contributor Author

Trying with cargo +stable t, which uses

rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-unknown-linux-gnu
release: 1.57.0
LLVM version: 13.0.0

I get

error[E0463]: can't find crate for `rustc_ast`
  --> clippy_utils/src/lib.rs:19:1
   |
19 | extern crate rustc_ast;
   | ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

Running that command, I get

info: component 'rust-src' is up to date
info: component 'rustc-dev' for target 'x86_64-unknown-linux-gnu' is up to date
info: component 'llvm-tools-preview' for target 'x86_64-unknown-linux-gnu' is up to date

(Maybe this is just confused due to this tree having an override?)

@sourcefrog sourcefrog changed the title compile_test fails at head compile_test fails at head: dependencies not found in depinfo Jan 8, 2022
@sourcefrog
Copy link
Contributor Author

cargo -Z binary-dep-depinfo test does seem to fix it.

@sourcefrog
Copy link
Contributor Author

I see this is set in .cargo/config.toml but it doesn't seem to be having the right effect with this toolchain?

@rustbot claim

bors added a commit that referenced this issue Jan 9, 2022
Set binary-dep-depinfo in .cargo/config.toml

Fixes #8248

According to https://doc.rust-lang.org/cargo/reference/unstable this
seems to be the right place to set it, and it does fix the build for me.

I haven't removed the other `rustflags` because perhaps it's needed on
different cargo/rust versions?

---

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: none
@bors bors closed this as completed in 3ea5208 Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant