-
Notifications
You must be signed in to change notification settings - Fork 901
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
On managing the stability guarantee in 2.0 and later #4128
Comments
Agreed, and that could indeed be problematic for some folks. IMO there's also a benefit for rustfmt with the current feature-gate approach because it allows users to test the new gated style/features and provide feedback. I wonder if in this new model we could publish the "bleeding edge" version of rustfmt (master) as a separate crate and/or as pre-built binaries (perhaps as part of a GitHub pre-Release) to let those users get access to the latest without having to build from source?
This one I fear could get complicated, at least conceptually, especially if there's a long cycle between major releases. Seems like we could end up needing to keep a mental map of the breaking changes that have been merged to master to be able to address required changes/bug fixes on the released version of rustfmt. For example: if there's a breaking change that's merged to master, and subsequently a bug is discovered in the current/stable/released version where the bug fix deals with the same source code as that already-merged-to-master breaking change. IIUC a user that wanted to fix that bug would need to do so directly against the That would probably be manageable as long as the number of breaking changes on |
Thank you for your feedback! Publishing a bleeding-edge sounds good to me. We can think of many possible installation methods. Currently, for historical reasons, there are two versions of rustfmt on crates.io;
The divergence between the master and release branches is a concern for me as well. I was wondering whether breaking the development phase could mitigate it. For example, if we define the development period for 2.0 as six months, then in the first four months, we only accept PRs that won't affect the default formatting (e.g., critical bug fixes, updating syntax and issues related to configuration). After that, we will be open to PRs that will change the default formatting. |
SGTM!
That sounds reasonable, and the shorter cycle should definitely help keep things manageable. I suppose we could also consider having something of a vNext branch so that folks who really wanted to work on a breaking changing during that first ~4 months could base their changes on too if we find there's a lot of breaking changes being proposed/submitted. |
The idea of preparing a branch for breaking changes seems reasonable to me. My first thought was to simply reject PRs during the first period, though that leaves a bad feeling to contributors who are unfamiliar with the rule. I would like to avoid it if possible. |
As discussed over in #4154, another thing we'll probably need to address is how to provide documentation on available configuration options with this new model. I've seen a few questions now in Discord and in GH related to Configuration options as described in-repo vs. what's actually available for folks using a released rustfmt version. I.e. what configuration options are available on
|
The following is a summary of how we manage rustfmt development after 2.0:
|
Ah, this does not quite work...I'll have to think again. |
As for the documentation, I think it would be good to enrich the GitHub Page and make it so that you can specify which version to display like the CMake documentation page. |
Something else we should consider is adding some additional target repositories to use for our integration tests (perhaps even rustc and/or tokio) to get us some extra coverage and validation. Related aside, we're currently re-building rustfmt in each integration test job, so it may also be worth seeing if we can build the binary once and then just using that rustfmt binary in each job run (seems it could help speed them up) |
Currently, |
@calebcartwright I have rethought how we manage versioning and branches on rustfmt 2.0 and later. Let me hear your thought. To conclude, I'd like to create a branch for 2.y.z releases (let's say First of all, I've ditched the idea of the complicated branch management that I mentioned before. We don't have enough time or human resources to do anything complicated unless it's necessary. I also want to make it easier to move on to other management methods is the new management method doesn't work. The The As the difference between the I've come to this conclusion because I want to keep the development easy and straightforward. The downside is that delivering new features may be delayed once the difference between the |
Makes sense and SGTM. I generally prefer to use feature flags over separate branches, but understand the desire to move away from Do you feel like we've settled on the repository/module layout for 2.0 and going forward? It seems like we are, but obviously additional restructuring would complicate cherry picking commits. |
I think we have, and hence I am going to close this issue. I will add documentation about branch and version management in Wiki when I have time. |
I would like to discuss how we enforce the stability guarantee in 2.0 and later.
rustfmt must guarantee that the default formatting will not change between versions as long as their major versions remain the same.
During 1.x, we managed it by adding version-gates to code and checking the version at runtime. Unfortunately, this method was prone to bugs and code complexity. In 2.0 and later, we would like to use a different approach to guarantee stability.
Initially, I was thinking of using different versions of rustfmt-lib, depending on which version a user has specified. Unfortunately, it turns out that this method requires some serous rearchitecting of the code. Since we would like to release 2.0 as soon as possible, I am looking for another approach.
One way is to separate the development branch from the release branch. Currently, the development and release of rustfmt are done almost entirely on the master branch. I want to change this to the following way:
release
). PRs merged into the master branch that does not change the default formatting will be merged into the release branch; publishment to crates.io and submodule registration to the rust repository will be made only from the release branch.This way, we can guarantee stability without adding extra code to our development codebase. The downside is that users will lose access to the latest format style unless they build rustfmt from the source. I am expecting that the branch management won't be that bad, though we may need to introduce bot for auto-merging PRs.
The text was updated successfully, but these errors were encountered: