Uh oh!
There was an error while loading. Please reload this page.
x.py: don't enable -Zconfig-profile or -Zexternal-macro-backtrace with x.py clippy - #69388
x.py: don't enable -Zconfig-profile or -Zexternal-macro-backtrace with x.py clippy#69388matthiaskrgr wants to merge 1 commit into
Conversation
rust-highfive
commented
Feb 23, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
I would also like comments on the added checks indicating that they're (presuming this is true) limitations of clippy today.
I will note that I am not super happy with needing to do this -- it seems like a bug somewhere upstream that we have to? Is there a fix in the works? Ideally we would not have to diverge in cargo flags for clippy / rustc.
There was a problem hiding this comment.
Seems strange to gate this flag only on stage == 0, presumably it should be around the whole thing?
matthiaskrgr
commented
Feb 23, 2020
I'm not sure how to avoid this as long as cargo comes from beta-channel but clippy comes from nightly channel, unless we explicitly force beta clippy to run. |
a15a00b to
1413fa7Comparematthiaskrgr
commented
Feb 24, 2020
@rustbot modify labels to +S-waiting-on-review, -S-waiting-on-author |
There was a problem hiding this comment.
I am actually rather surprised by us needing to do this, as AFAICT if the cmd is clippy we should always be in stage 0? When is that not the case today?
(and if Clippy is already in stage 0, then the right flags would be in RUSTFLAGS_BOOTSTRAP, right?)
There was a problem hiding this comment.
You are right, my code comment is simply wrong.
Looking at --verbose output, we are indeed in stage 0 all the time.
Looking at the error I was getting previously
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> src/librustc_data_structures/box_region.rs:87:52
|
87 | let result = Pin::new(&mut self.generator).resume();
| ^^^^^^- supplied 0 arguments
|
help: expected the unit value `()`; create it with empty parentheses
|
87 | let result = Pin::new(&mut self.generator).resume(());
| ^^
and the corresponding code
#[cfg(bootstrap)]pubfncomplete(&mutself) -> R{// Tell the generator we want it to complete, consuming it and yielding a resultBOX_REGION_ARG.with(|i| i.set(Action::Complete));let result = Pin::new(&mutself.generator).resume();ifletGeneratorState::Complete(r) = result { r }else{panic!()}}#[cfg(not(bootstrap))]pubfncomplete(&mutself) -> R{// Tell the generator we want it to complete, consuming it and yielding a resultBOX_REGION_ARG.with(|i| i.set(Action::Complete));let result = Pin::new(&mutself.generator).resume(());ifletGeneratorState::Complete(r) = result { r }else{panic!()}}we actually need to disable cfg=booststrap for x.py clippy in order to have it work from what it seems.
nikomatsakis
commented
Feb 25, 2020
1413fa7 to
70b72eeCompareMark-Simulacrum
commented
Feb 25, 2020
Hm, so AFAIK x.py clippy today is just using the clippy it finds in the environment, right? Can we perhaps make sure that's a nightly clippy (e.g,. running Basically I feel like this is going to some non-trivial effort to patch over the fact that we're using different versions of clippy and we don't know what we're using which feels like it's never going to work out quite as well as trying to detect what we're using. We should likely also be using the same cargo as the clippy we're using, right? vs. using the beta cargo with (for example) a nightly clippy? |
Yeah.
I've been thinking about whether we could simply install the "clippy" component for I would prefer to run a nightly clippy on x.py clippy since that's more up to date and we can use it to spot false positives on new lints or other clippy bugs for example. As far as I can remember, x.py clippy has been broken most of the time, except for maybe one week after nightly gets promoted to beta, then nightly and beta get out of "sync" and x.py clippy runs into errors again... |
Mark-Simulacrum
commented
Feb 26, 2020
Here's a proposal: We edit clippy-driver (or whatever the clippy we're using is) to provide the "channel" in the --version (e.g., nightly, beta, etc.). I think this is the easiest way for us to determine what "stage" we should be running in. Then we modify the cargo function to, if we're running cargo clippy, get the version information and if it's a nightly clippy, force stage 1, if it's a beta clippy, force stage 0, and if it's a stable clippy use stage 0 but print a warning that it's not really supported to do that. This would, I think, work well. However, it's quite a bit of work (and we'd need to wait for the channel printing to roll out) -- I would propose that in this PR we just set stage = 1 if we're running cargo clippy and document that you should be using nightly. I think that should work, right? And we'd presumably not need any of the other changes then? |
matthiaskrgr
commented
Feb 26, 2020
I think this already works today:
Are you referring to cargo code or x.py/bootstrap.rs here? |
Mark-Simulacrum
commented
Feb 26, 2020
Huh, I'm pretty sure I ran that with the clippy I had (a stable clippy) and it didn't work. x.py for the cargo function. |
joelpalmer
commented
Mar 9, 2020
Triaged |
bors
commented
Mar 17, 2020
☔ The latest upstream changes (presumably #70062) made this pull request unmergeable. Please resolve the merge conflicts. |
…h x.py clippy run clippy on #[cfg(not(bootstrap)] code
70b72ee to
548958aComparematthiaskrgr
commented
Mar 20, 2020
rebase for @Centril |
Dylan-DPC-zz
commented
Mar 30, 2020
@Mark-Simulacrum this is ready for review |
matthiaskrgr
commented
Mar 30, 2020
Sorry, this is not ready for review. I'll just close it to avoid confusion. |
It seems we need this to make
x.py clippyrun again.