zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.09k stars 2.71k forks source link

Policy for Minimum Supported Rust Version (MSRV) #17402

Open niklaskorz opened 1 week ago

niklaskorz commented 1 week ago

Check for existing issues

Describe the feature

So far Zed's policy regarding MSRV is bumping to the latest Rust version as soon as it is released, and directly making use of features restricted to this release. As seen with #15757, this causes problems for package maintainers that have to use the rustc version available in their package repository.

Together with @GaetanLepage, I'm maintaining the zed-editor package for nixpkgs, the package repository of the NixOS Linux distribution. For NixOS, the current MSRV policy means that we can't backport updates of Zed to the stable channels of NixOS, as the rustc shipping in the stable channels very soon becomes unsupported by Zed.

Even for rolling release channels such as nixos-unstable, an MSRV bump in Zed means that we can't ship updates for Zed for a few weeks, as we first have to wait for the new rustc version to make its way into the unstable channels.

For NixOS in particular, it would be ideal if Zed's MSRV would be at least half a year old. I can't speak for other distributions but would be interested in hearing the perspective of other package maintainers.

I am not asking to downgrade the MSRV we have right now, but to think about freezing it to the current version.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

maxdeviant commented 1 week ago

Even for rolling release channels such as nixos-unstable, an MSRV bump in Zed means that we can't ship updates for Zed for a few weeks, as we first have to wait for the new rustc version to make its way into the unstable channels.

Do you have any insight you can share as to why it takes a few weeks for a new version of rustc to land on Nix unstable?

Is it a lack of maintainer bandwidth? A number of upgrades that need to be coordinated with the rustc bump?

At least for the unstable channel, I think that even if there is a lag of a few weeks whenever a new Rust version comes out (which would only be roughly every 6 weeks), that would be acceptable.

For NixOS in particular, it would be ideal if Zed's MSRV would be at least half a year old.

Would this just be for the Nix stable channel?

Half a year is a long time for us.

The Zed codebase, in particular, has a track record of benefiting greatly from the latest additions to Rust, and I think this will only continue to be the case looking at the upcoming roadmap (the ref-counting ergonomic improvements are something I'm especially looking forward to).

I don't think we're at a point where we want to commit to freezing our Rust version for a 6 month period.

niklaskorz commented 1 week ago

Do you have any insight you can share as to why it takes a few weeks for a new version of rustc to land on Nix unstable?

Is it a lack of maintainer bandwidth? A number of upgrades that need to be coordinated with the rustc bump?

Rustc updates first have to go into a staging branch, which is then blocked until all Rust applications in nixpkgs have been rebuilt by CI (hydra) with the new Rust version. This process can take up to a few weeks.

Would this just be for the Nix stable channel?

Half a year is a long time for us.

The Zed codebase, in particular, has a track record of benefiting greatly from the latest additions to Rust, and I think this will only continue to be the case looking at the upcoming roadmap (the ref-counting ergonomic improvements are something I'm especially looking forward to).

I don't think we're at a point where we want to commit to freezing our Rust version for a 6 month period.

Yes, the unstable channel will usually catch up to the latest Rust version in less than a month, but the stable channel will stick to the minor compiler version it was branched off (and only roll out new patch versions for it).

NixOS 24.05, the current stable release, ships with Rust 1.77, and, as of three weeks ago, also Rust 1.79. A special case where Rust updates (in this case, 1.79) get backported to the stable channels is if security critical applications (usually web browsers such as Chromium or Firefox) require a newer Rust version, so generally this is nothing we can count on for Zed.

Rust 1.81, which has been released today, will be the Rust version that NixOS 24.11 ships with in November.

Ideally we'll update Zed in NixOS 24.11 as long as it can be built with Rust 1.81, but afterwards, users of stable NixOS will have to wait until NixOS 25.05 (May 2025) to get versions of Zed that require Rust 1.82 or newer.