-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add clippy as a submodule #43886
Add clippy as a submodule #43886
Conversation
This seems to block CI on clippy builds, yeah? It seems like rust-dev-tools/dev-tools-team#18 (comment) said we should do this too, but just want to check with @nrc again on that. I'm very happy if rustc blocks on clippy builds in CI, but I'm just not sure if that's what nrc was going for. |
Yes that's how I read that comment, too. I don't think it's too much of a burden on developers to "just get it compiling again", since they just got the entire rustc compiling again and know the knobs to twist. The runtime effects of such a change can then be left to us, as they traditionally are much less complex to figure out (once you have written a few lints). The only issue I see is that it requires a stage2 build due to a dependency on Note that currently this also builds |
We should document the process for fixing this somewhere before landing IMO. (I can do a writeup if you want)
Because of toml? Ideally libclippy.so or the rust-clippy driver won't read from toml at all, that's all cargo clippy's job. Though passing this info down to rust-clippy without a format will be annoying. |
done
We can probably pass these things as CLI flags, which are already parsed. |
CONTRIBUTING.md
Outdated
you can point the submodule at your pull request by calling | ||
|
||
``` | ||
git checkout pulls/$id_of_your_pr/head |
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.
might need a git fetch pulls/blah
as well.
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.
we should test this workflow on a test 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.
I'm doing that right now with the Cargo.lock
I'm not sure why this is marked |
probably because it's marked as WIP? |
How regularly should we be updating this? Only in the event of breakage, or should we keep it in sync every day so that rustc contributors have to do less merge conflict work upgrading? We probably should maintain a |
That makes sense. We can merge the |
This is up to the Clippy devs. Updating means a PR that has to go through the bors process (though it should be a rollup), so it is not trivial. I tend to update the RLS every week or two, basically when I do a release of the client or there is a significant change. |
Sorry, I was not 100% clear in that comment. I meant that building and testing should be possible, but neither should block landing PRs. |
This looks good to me (modulo the building blocking PRs thing). @Mark-Simulacrum - could you r? the build system changes please? |
Build system changes seem fine. Note that this won't dist clippy in the current configuration, but that's presumably intentional. |
I'm not sure what the point of running it inside CI is, if noone ever notices that the build breaks. Should I turn it on so it is unconditionally run and tested in Or is this where we add the exception file to the build system, so if clippy breaks, one adds it to the file and it's not built anymore on CI? This way everbody notices when they break clippy and have a choice between ignoring it and @ mentioning us or fixing it? |
It is a more long-term goal that Clippy block CI, the core team are not ready to do that until at least the RLS rides the trains to beta (it is considered too risky to have multiple tools doing new things).
That sounds good to me. |
Oh wait I think no, let's please not run tests yet. We are not in a position to do so right now. It wouldn't be a great experience to download broken trees from git "by default" as I suspect the clippy submodule will be broken quite often. Although we can land PRs that'd just hurt developers. I've commented elsewhere about how we're going to run tests, but that support isn't here yet. I don't personally know why we'd add build support in tree before there's infrastructure to actually run tests for it, but I won't stop it if others would like it. |
Makes total sense.
I'm very confused now. This PR only builds clippy. It does not run its tests.
broken as in doesn't build or broken as in "that commit doesn't exist, git will complain"? Because it'll only be the former.
The goal of this PR is to ensure that it will never be broken again, because it'll only break if the developer changes something that would break it. That developer is at the same time in the unique position to know exactly how to fix it (since they just had to fix it all over rustc).
Soo... simply as stated above
|
The goal of this PR, in that case, is not satisfiable right now. We aren't in a position to ensure that "clippy never breaks again". |
That's fine, it doesn't have to happen in this PR. If I made it easy to tune out the clippy building failure, but have it still happen by default on local builds, would that be ok? I mean it could be as simple as uncommenting an entry in a This way, if your PR breaks clippy, you either fix clippy, or turn building it off for everyone who comes after your build. In the first case, we get a PR at clippy, in the second case, someone should ping us, we create a new PR that reenables clippy together with the fixed clippy. This means noone ever gets a broken clippy without it being their fault. |
Clippy tests don't break often. Mostly clippy-side changes break them, and we CI Clippy side. If a rustc change breaks clippy that's the concern, and we're fine with having tests broken for a short while as we fix things. This PR has two goals. It starts giving Clippy authors early warning about breakage, and gives PR authors the ability to fix it. Many clippy breakages are from rustc changes that contain mostly automated fixes to the rest of The second goal is to prototype the eventual contribution model. This way we can work towards a smooth integration and work out all the kinks before all the parts are ready. |
Yes that's what the "planned infrastructure" is currently thought to look roughly like. This doesn't exist today, however, so no, I do not think we should enable anything for local builds. |
Ok. So I'm kind of lost here now wrt what I should do in this PR. I can create said infrastructure if that is desirable and noone has existing plans or already started working on it. Or should I just disable all the clippy building and require one to run |
Isn't that what this PR does? I don't mind adding more infrastructure here, although I'm not sure if we've hammered out precisely what we'd like it to look like. The discussion here leads me to believe that at least mine and @nrc's perceptions of these workflows may differ? |
No, it also builds clippy if you just do |
I disabled building clippy by default and edited the OP message to reflect the current state of the PR |
@oli-obk I've created a tracking issue for the requirements of what we think the infrastructure for running tests would look like. |
It sounds like this is back in the reviewers' court. @alexcrichton @nrc what are the next steps on this? (also it looks like travis passed even though it says it's still running) |
I believe this needs an r+ from @nrc |
@rust-lang/dev-tools It has been over 6 days since the last comment from a reviewer. Perhaps someone besides @nrc can step up? |
@@ -298,6 +298,32 @@ Speaking of tests, Rust has a comprehensive test suite. More information about | |||
it can be found | |||
[here](https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md). | |||
|
|||
### External Dependencies | |||
|
|||
Currently building Rust will also build the following external projects: |
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 think this documentation may wish to be updated with the current state of the PR
@bors: r+ (sorry for the delay) |
📌 Commit 20f1e68 has been approved by |
⌛ Testing commit 20f1e68 with merge b3b5b990c426f26e41d65475e6ac33f9e9e5aeb3... |
💔 Test failed - status-travis |
|
Add clippy as a submodule ~~This builds clippy as part of `./x.py build` (locally and in CI).~~ This allows building clippy with `./x.py build src/tools/clippy` ~~Needs rust-dev-tools/dev-tools-team#18 (comment) to be resolved before it can be merged.~~ Contributers can simply open a PR to clippy and point the submodule at the `pull/$pr_number/head` branch. This does **not** build clippy or test the clippy test suite at all as per rust-dev-tools/dev-tools-team#18 (comment) r? @nrc cc @Manishearth @llogiq @mcarton @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
This builds clippy as part of./x.py build
(locally and in CI).This allows building clippy with
./x.py build src/tools/clippy
Needs rust-dev-tools/dev-tools-team#18 (comment) to be resolved before it can be merged.Contributers can simply open a PR to clippy and point the submodule at thepull/$pr_number/head
branch.This does not build clippy or test the clippy test suite at all as per rust-dev-tools/dev-tools-team#18 (comment)
r? @nrc
cc @Manishearth @llogiq @mcarton @alexcrichton