-
Notifications
You must be signed in to change notification settings - Fork 896
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
rustfmt development, versioning, distribution, etc. #4346
Comments
One plausible mechanism here is to reduce the scope of the guarantee. For example the guarantee could be reduced from "Changes to formatting/style are considered breaking" This is weaker because the reverse does not hold, IE: an old version for rustfmt might reformat code in the format output by the new version. Then a new flag Once an addition boundary occurs the scope of what is permitted can be culled. So an upgrade path would look like this:
|
Thanks for the input! However, that doesn't buy us much in practice, as it's essentially what we're already dealing with today (the reverse already exists in places, for example with newer syntax). The biggest issue by far is that we can't be in a scenario where a newer version of rustfmt formats the code differently than any previous version (i.e. we can never have a
Similarly, this isn't too far off from what has been in place historically since the 1.0 release of rustfmt and it actually adds more complexity with the additional cli flags. This approach ends up creating a mess within the rustfmt codebase over time. Short-lived feature flags work great, but the notion of having feature flags and code live 2-3+ years is just not viable IMO. Plus, don't forget that there's only ever one standard: the Style Guide, and it can evolve independently. The whole objective with a major version release is to allow us to finally ship such breaking changes (which is in alignment with the original RFC on rustfmt versioning) so shipping a v2 of rustfmt that does the exact same thing as v1 doesn't buy us anything.
IMO something is going to have to give. I understand why folks have raised concerns about a 2.0 version of rustfmt being released outside a major rust release, but I just don't see how rustfmt can be fully complaint with the stability guarantee (in its current form), and always directly aligned to the Style Guide, and only be allowed to make breaking changes (as currently defined) every few years, all at the same time. |
The problem is that, unlike rustc, users often use rustfmt outside of the cargo context, and having 2015 as the default edition has been confusing to users. If we decide to sync the default edition in rustc and rustfmt, at least we should update rustfmt so that it respects the edition written in Cargo.toml even when it is run directly.
I have been thinking about removing the style/formatting changes from what we consider as breaking changes. If users need the formatting stability then they can pin to the specific release of rustup. If this is possible then we can avoid making a major version release after 2.0 (or avoid 2.0 release altogether with some hassle). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It has been a long time since I last posted; I'd like to summarize the current situation (to make sure I remember things correctly) and dump my thoughts. The current master branch contains breaking changes since the latest release (1.4.22). The scope of breaking changes is broad:
However, a concern was raised that whether we should make a major version update of rustfmt, which happens to be an official tool, in the first place. As such, we should start by creating an RFC (or pre-RFC to the forum?) about the rustfmt 2.0 release. To be honest, I have been reluctant to do so, as I expect the amount of communication to be enormous, and I don't have enough energy and time to handle such communication. Instead of, or in parallel with, preparing 2.0, we may restore breaking changes and release it as 1.5.
|
From what I've seen the questions about release 2.0 are more about doing so outside an edition release, and/or doing so without a substantive communication campaign. The latter of which I believe has generally universal agreement, as we wouldn't want to silently drop 2.0 on nightly with nothing but our changelog. I don't think this necessarily would require an RFC just for 2.0 release, but at a minimum we'd want a blog post (e.g. inside rust) I think we'll want to revisit the stability guarantee more generally first, which would require an RFC (at least IMO), as that will definitely impact the release/versioning aspects. |
During some recent discussions related to (unreleased) breaking changes in rustfmt, several distinct but related topics and questions were raised. Opening this to both summarize those items and track closure, though imagine some may spin off as separate issues and/or be moved elsewhere.
First, some salient points on the current state:
The default branch in this repo has been the active/primary development branch for 8+ months accumulating unreleased bug fixes, features, and some breaking changes. The published 1.x versions of rustfmt have mostly been in maintenance mode during that window and have only received rustc-ap bumps as necessary and the backporting of fixes for some higher impact bugs.
Questions/topics
Below are some of the topics/questions/feedback from recent discussions, and I'll also add that the decision and outcome for several of these questions could directly impact the others.
Finally, I'll add that one concern I have is that I think it's highly likely we'd end up in a scenario where rustfmt would be violating one or the other core constraints if those both remain in place, and rustfmt is not allowed to ship any new major versions outside of an Edition accompaniment. For example, certain changes to the Style Guide would require an update to default formatting in rustfmt that would in turn break the stability guarantee.
The text was updated successfully, but these errors were encountered: