-
Notifications
You must be signed in to change notification settings - Fork 69
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
Document MSRV policy #881
Document MSRV policy #881
Conversation
4e871db
to
672fb2e
Compare
README.md
Outdated
## Supported Rust versions | ||
|
||
As a research project, MMTk is quite aggressive in following the latest releases of the Rust | ||
toolchain. The minimum supported Rust version (MSRV) is "N-1", that is, one minor version before the |
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 don't feel we want to eagerly increase our MSRV. Having a low MSRV is a benefit for users, but a drawback for our development. We can have something like "N-1", which means we can increase our MSRV to that version if there is a reason for us to do so (e.g. dependencies, new language features, etc), but we guarantee that the MSRV will be at least "N-1". In this case, we do not have to eagerly increase MSRV for no reason (which bothers users), and we can increase MSRV in the situation like what we are experiencing right now, according to the policy.
This is just my thought.
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 that's also OK. My understanding is,
- We always guarantee that "N-1" is supported.
- But the actual
rust-version
field inCargo.toml
may sometimes be older thanN-1
if we didn't make use of any newer features during the last 6 weeks of development, and no dependencies require a newerrust-version
. - If, during our development, we made a PR that uses a newer feature introduced in
N-m
whereM>=1
, we have a good reason to bumprust-version
toN-m
. - The CI shall test with both the latest stable version and the
rust-version
inCargo.toml
.
That still sounds good, but I still prefer bumping the MSRV eagerly (even for "no reason"), for the following reasons:
- If the MSRV is already bumped after a release, we don't have to deliberately bump it during development.
- If we cannot guarantee that
N-2
is supported, our users still cannot rely onN-2
even if therust-version
inCargo.toml
is sometimesN-2
or older. That's because it may change in the next release. Although the user may lock the version ofmmtk-core
to a version to satisfy their MSRV requirement, we should not encouraged this (at least for now) because MMTk is being rapidly developed, and relying on an outdated MMTk now will make it difficult for the users to migrate to the latest MMTk in the future.
However, we may change the policy if MMTk reached a stable state. By that time, we may prefer letting the MSRV "linger" at a version, like you suggested, if we do not make use of newer features. That will allow the users to use a newer mmtk-core
while still using an older Rust toolchain. At that time, it should be reasonable for the user to lock the version of mmtk-core
because mmtk-core
is relatively stable. But I don't think MMTk has reached such a state.
README.md
Outdated
latest stable Rust release. For example, if the latest Rust stable release is "1.61.2", then the | ||
MSRV will be "1.60.0". | ||
|
||
MMTk has a six-week release cycle, roughly the same as Rust itself. We bump the MSRV version |
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.
See my comment above. Also it does not mention the Rust version we use in rust-toolchain
. I feel it implies the version in rust-toolchain
will be the latest.
Last time we talked with @caizixian on this. We agreed on bumping the version in rust-toolchain
for every other release (he needs to update our dev and CI machines).
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.
Last time we talked with @caizixian on this. We agreed on bumping the version in rust-toolchain for every other release (he needs to update our dev and CI machines).
If updating the toolchains every 6 weeks is too much work, we can just say our MSRV is "N-2". I am still OK with "N-2" or "N-3". In the case of "N-2", MMTk-core will support three Rust stable versions, and each Rust version remain supported for 18 weeks. If we update our toolchains for every even (or odd) Rust releases (that is, every 12 weeks), the existing installed toolchain will remain supported by the time we do our update. In other word, on the day when an even Rust version (assume we update Rust at even versions) is released, both the currently installed toolchain and the newest toolchain will be supported, and we can do the update in the window of 6 weeks from that day until the next Rust release. (Actually we may have up to 12 weeks because the MSRV of MMTk core is the "N-2" right after the previous MMTk core release.)
@caizixian What do you think of it? If "N-2" is still too much work, we can use "N-3" instead.
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.
There is some confusion here. We have two Rust versions recorded in the repo: the version we use for testing and development (toolchain version) in the rust-toolchain
file, and the minimal Rust version we support (MSRV) in Cargo.toml
. When you say N-2, N is the toolchain version I assume, and the N-2 is MSRV.
When we bump Rust toolchain version, we need Zixian to update our dev machines. But for MSRV, we do not need any work from Zixian (in the current setup, we do not even need the MSRV installed on our dev machines -- we use Github runners to verify we can build with the version).
So using N-2 or N-3 doesn't really matter for Zixian. But how often we bump our toolchain version matters. I was saying the description added here implies we bump our toolchain version for every release.
I think @qinsoon is right that there are two separate problems here. The A conservative MSRV helps downstream projects that depend on MMTk, so that they are not forced to update their toolchain unless we decide that newer language features are worth bumping MSRV. Separately, pinning the Rust toolchain picked up by rustup (which is always >= MSRV) is important for reproducibility. Bumping that can help us access newer compiler checks and optimization (we will not accidentally depend on newer language feature as long as we have MSRV CI check in place). However, bumping that too frequency increases work on the infrastructure side (we need to make sure all machines we use actually have that specific version of the toolchain installed rather than just some random version >= MSRV), and it can also muddle the performance regression results because it will be harder to tease out performance trends of MMTk from the changes of the underlying toolchains. |
Sorry. I completely forgot the Actually I doubt about the effectiveness of One positive side of the @caizixian For "reproducibility", I think the answer is that whenever we do performance test, we always record the build string (including the exact version of Rust toolchain) that we used for building. (see this issue and this PR) This can be the version of Rust toolchain actually installed on the moma machines at the time of doing the test, instead of I suggest we do the following
If But I still remember @steveblackburn has some opinion about the |
This is roughly what we are doing. We update moma machines before a MMTk release, update the |
We discussed this:
One thing we haven't discussed:
|
I think you mean updating
I think it is good enough to increase MSRV on demand. Well, in practice, we always need a PR to bump MSRV after a release. It's just a matter whether we do it in a dedicated PR, or piggy-back the change with a PR that uses the new feature. |
Yeah. We update to the latest Rust stable before a release, and coordiante with Zixian to install that version. We do not merge it unless the version is installed on the moma machines and pass all the tests (including binding tests).
If we increase MSRV on demand, that means we don't have to bump MSRV for a release. We bump it when we need to use new features, new dependencies, or other reasons. The new policy allows us to bump MSRV to any version that is "N-m" (N is the version in the |
As long as it passes tests before merging, it should be OK.
Yes. We can still write in the document that 'we support "N-m" MSRV policy' (after discussion with @caizixian, |
I have just updated the contents of README.md to reflect the results of our discussions. |
This PR adds checks to build and unit test MMTk core with the latest Rust stable version. We do not require the tests with latest stable Rust to pass in order to merge a PR. See discussion in #881 (comment).
Co-authored-by: Yi Lin <qinsoon@gmail.com>
Co-authored-by: Yi Lin <qinsoon@gmail.com>
Co-authored-by: Yi Lin <qinsoon@gmail.com>
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.
LGTM. I added some further clarifications and you can adopt them where you see fit.
Co-authored-by: Zixian Cai <2891235+caizixian@users.noreply.github.com>
Co-authored-by: Zixian Cai <2891235+caizixian@users.noreply.github.com>
No description provided.