-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 report future-incompat #2834
Cargo report future-incompat #2834
Conversation
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 seems to boil down to "how annoying is an un-silencable warning". This seems to be a pretty decent balance, though it is tough to predict how people will react.
We could try conservative steps to see how it goes. For example, only turn it on for 1 lint, and see how long it takes for packages on crates.io to update.
Another possibility is to have a policy of a grace period when a future-incompatible lint is first introduced, leave it as capable for 1 Rust release, and then make it un-capable. This would give 6 weeks for opportunistic updates before forcing the warning on everyone. I don't know if that is really necessary, though, or what the typical timeline will look like. I assume existing lints have already been around for a while.
Co-Authored-By: Eric Huss <[email protected]>
IMO, for most users, most of the time this would be useless and therefore annoying - the only way to exert pressure upstream is submitting a PR and most users can't or won't do that. Where this might be useful is where the maintainer of the downstream crate also maintains the upstream crate. The Cargo team just discussed the PR. We think this would be nice to have (especially if @pnkfelix can implement), but not with every build. I.e., we should rate limit in some way. Some suggestions from the Cargo team:
Once we decide on the warning schedule then we can accept the RFC and begin implementation with the caveat that we would intend to iterate on the frequency of warnings in the future as they are found to not have the desired effect or be too annoying. |
Not to detract from the rest of your points, but why is this the only way? Issues, mentioning the author in forum posts / social media, etc. are all ways to encourage a library to update. |
Ooh, I like this telescoping warning frequency. Of course, doing this would exacerbate the problem I mentioned in the RFC text when I covered the annoyance as a drawback:
But I really like this approach, especially the idea of tying the frequency to when the lint is actually going to become a hard error. It seems like right balance to strike. And as @nrc says, the details of the actual frequency is a policy matter that can be resolved later, in tandem with implementation. I will update the RFC text to incorporate annoyance modulation into the system. (I personally would like to expose knobs to let the end-user tweak this, but that is yet another detail that can be resolved later.) |
It would be useful if there was a way to generate a "future-incompat" report for use in CI/integrations with GitHub etc. Does cargo currently have any kind of telemetry? |
I should have said something like "only effective way" - unless the maintainer is just unaware of the change (which seems unlikely if the crate is maintained) then I think either the maintainer will eagerly correct the issue, or won't correct the issue no matter how many issues are filed or complaints made (apologies for the end of year cynicism :-) ). |
|
I maintain a bunch of crates. Most of those do not get regular active updates. I don't run the compiler on all my crates every time a new rustc is released to check for new future incompat links, and I don't want to do it. I'd claim that most of crates.io crates are maintained that way.
Yeah some maintainers can be stubborn. Then it's especially valuable to have downstream be informed about the situation, as the upstream maintainer dangers their build. People can switch away for example, fork the crate, etc.
In fact I think this would lead to more annoyance, not less. If it's always warning, you'll encounter it when you update your rustc or introduce a crate to your dependencies either through an update or an addition to a Cargo.toml. You know the warning is there and can blend it out. If it appears out of nowhere to you while you are doing something completely unrelated, you will be far more annoyed. You'll be even more annoyed if since then, you have closed the console, overflown the buffer or you gotten a report by a user but can't reproduce it because the report was done on a different day and now the user can't tell you the precise crate with the problem either. And after you committed a fix, how are you sure it's actually a fix to your issue? Consider you don't want any dependencies that create such warnings in your tree. How do you review PRs for them? TLDR: I don't think that volatile warnings based on time, a random variable or such would be good ideas.
Knobs to always turn it on would be very useful. They could only live in the CI of a project to prevent introduction of problematic crates. |
This is a compelling argument to me that the default setting should be what I described in the RFC, while @nrc's argument still convinces me that users should be given some form of an annoyance modulation knob. |
…er occurs on nightly.
… mechanisms. Just state that I do not intend for us to blindly convert every future incompat lint to use this system.
before discussing anything with crates.io.
Also, fixed some text that clearly dates from the now-irrelevant issues we used to have with diagnostics on path-dependencies.
So get rid of text wondering about making that a step in the implementation strategy.
I would think that this is an orthogonal issue/bug from the one described here? |
Okay, commit 7bebac8 is my attempt to resolve this (hopefully last?) remaining point. I always relish any opportunity to make absurdly subtle references to my past jobs |
@rfcbot reviewed |
1 similar comment
@rfcbot reviewed |
ping @Zoxc @estebank @michaelwoerister @petrochenkov regarding checkboxes |
I do not think this is the place to decide on such a policy and that this should be left to the language and compiler teams to tweak things as necessary. I also don't agree with the guidance proposed. It is wildly more conservative than was discussed originally regarding when the infrastructure in rust-lang/rust#59658 would be activated. Imposing these requirements also doesn't seem justifiable by RFC 1122. There are a number of problems with it that render the guidance quite counter productive to fixing bugs in the compiler:
|
One may argue that this is exactly the right alignment of incentives: those who are proposing things that may break should feel the pain that they may break. That this disincentives them to make said changes is a positive, not a negative.
It could also be considered unfair that the community bears the burden of unglamorous, repetitive, and boring work, simply because a team would rather not do it, yet wants to make a change anyway. |
I think it's definitely not a positive to dis-incentivize fixing bugs (and worse yet, soundness holes when those occurs) in the compiler. This also increases the requirements to get things right when shipping and the speed at which we can make improvements if we then impose a lot of constraints when mistakes are made in implementation. Dis-incentivizing making the change in the first place, particularly as it relates to soundness holes is I think counter to the spirit (and text) of RFC 1122 and to the notion that Rust is a safe language (which is more important than backwards compatibility).
It's not repetitive because it's distributed to several people who might only have to do a small change in a single crate as opposed to the team or the PR author who would have to do the same fix over and over again (particularly if the regression is large). So no, I do not agree that it is an unfair burden when any individual person's burden is small. (It's even less unfair when large companies are involved.) |
Just to keep things clear, at least in my own head:
|
I think this nudges us towards a policy that is more conservative than today, whereas I think we need to move in the opposite direction as the compiler team has failed to actually triage the C-future-compatibility bugs as e.g. noted in:
and generally does not invest the time into fixing the not-adhering-to-the-spec-spec bugs.
|
Taking a page from the JavaScript world, if Rust had a "codemod" / "codeshift" like facility, that might lower the burden of certain types of large scale changes, instead of moving the burden around. The Rust team could prepare the transformation and apply it against the compiler and "key" crates verifying it works, then allow the long tail of affected people to apply it to their code. The team could submit PRs for "appropriate" crates as well. It could even potentially be integrated with crater to find out how successful a proposed fix is in the wild. |
There's rerast, but I don't know how well it can handle existing future-incompat things. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@shepmaster How far off is My understanding is that those JS projects are effectively compiler frontends (or even more of a compiler), whereas IIRC, as part of Rust 2018, paths (e.g. in |
@eddyb my inference is that, at least historically, the scope of |
(but maybe your comment is that we should expand the scope of |
I think it is used for much more than edition migrations. MachineApplicable suggestions are used in everyday development. Several editors provide one-click auto-fix suggestions, and some developers just run |
my mistake then! I should have done more research before responding |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
It looks like the FCP finished - should this RFC be merged? |
ping @rust-lang/rfc-pushers why hasn't this been merged yet? |
Huzzah! The @rust-lang/compiler and @rust-lang/cargo teams have decided to accept this RFC. To track further discussion, subscribe to the tracking issue here: rust-lang/rust#71249 |
rendered
Summary: Cargo should alert developers to upstream dependencies that trigger future-incompatibility warnings. Cargo should list such dependencies even when these warnings have been suppressed (e.g. via
--cap-lints
or#[allow(..)]
attributes.)Cargo could additionally provide feedback for tactics a maintainer of the downstream crate could use to address the problem (the details of such tactics is not specified nor mandated by this RFC).
Pre-RFC internals thread