-
Notifications
You must be signed in to change notification settings - Fork 1.7k
use ui_test dependency builder for test dependencies #14883
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
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
No clue about the |
Oh I see, and those are driven by the same runner. So depending on the test suite we'll need to use one or the other logic. |
that PR was made because it was prohibitively slow for many maintainers and contributors to build the deps in the test suite instead of in the main build. I don't see how that issue can be avoided. |
this is about |
The issue is avoided by noting having the clippy crates in I didn't implement this part yet; it's what I referred to here. |
Ah so the problem is that we pull in serde which pulls in a proc macro which has quote as a proc macro dep? Hm... They look different in what you print, one is in the Do clippy tests need serde with the proc macro or could we disable that feature? |
A lot of Clippy tests use |
Okay, damn. Then ui_test has to somehow figure out which dependencies belong where... |
I can give it another shot, but I may have to ask cargo to emit more data |
I tried to understand the problem and created an issue for further discussion: oli-obk/ui_test#327. |
b839767
to
c3087c8
Compare
10fe036
to
c81f3ee
Compare
After adding the internal dependencies back for the internal tests, this PR now passes when using a ui_test that includes oli-obk/ui_test#329. :) |
6b5f9f2
to
c2d0a45
Compare
Okay this should be good to go now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if the main
is empty today and may stay empty, could you add clippy_test_deps
to the list of packages in test/dogfood.rs
so that it gets linted as well when running cargo dev dogfood
? (for cargo dev fmt
, this is handled already as it looks for all *.rs
files, so there is nothing to do there)
I don't understand what that has to do with my PR...? |
Oh, because I added a new crate, and that's supposed to be a list of all crates there, I see. Will do. That crate really should stay empty though, it's code is not run or tested by anything anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM overall. I would not add that test crate to the dogfood list though. See below.
tests/dogfood.rs
Outdated
@@ -40,6 +40,7 @@ fn dogfood() { | |||
"clippy_lints", | |||
"clippy_utils", | |||
"clippy_config", | |||
"clippy_test_deps", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree here. If this crate is empty and should stay empty, we just add time to the dogfood tests waiting for the dependencies to be compiled. This will just increase the time of dogfood tests without any benefit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine either way, I hope the clippy maintainers can come to a consensus here. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samueltardieu Do you feel strongly about adding it to the dogfood list?
If not, r=me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I thought it was more "belts and suspensers" here in case something crept it, but I'm fine without it!
/// in `clippy_test_devs`. That saves a lot of time but also means they don't work in a stage 1 | ||
/// test in rustc bootstrap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustc bootstrap doesn't run Clippy's internal tests anyway. Which is sometimes annoying during the sync, so I'd like to enable this at some point. This kinda closes the door on that. At least for stage 1. IIUC on a stage 2 build, this would still be possible?
Anyway, the benefits of this is way bigger than the slight annoyance of not running ui-internal in the Rust repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kinda closes the door on that. At least for stage 1. IIUC on a stage 2 build, this would still be possible?
I think so, yeah. Or alternatively, when running in ./x
, the internal dependencies could also be managed by the clippy_test_deps crate. But that seems messy... so only doing it in stage 2 is probably best, similar to the "fulldep" tests in rustc.
It doesn't close any door on stage 1, the internal tests are equally broken in stage 1 before and after this PR. What the PR changes is that it hopefully un-breaks the other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood! Thanks for the explanation!
changelog: none
This tries to make progress on rust-lang/rust#78717 by using the ui_test dependency handling instead of linking in the dependencies of clippy itself with the tests. This partially reverts #11045. However, we still use the old style of dealing with dependencies for clippy's own crates and the "internal" tests, as otherwise those would get rebuilt which takes too long.