Skip to content

Compatibility to rustc (1.50.0+dfsg1+llvm-0ubuntu5) shipped with Ubuntu 21.04 (hirsute) #9629

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

Closed
wants to merge 17 commits into from

Conversation

KOLANICH
Copy link
Contributor

@KOLANICH KOLANICH commented Jul 19, 2021

IMHO it was too early to use the recently stabilized features of Rust before the changes appearred in all the distros.

I know most of you like/have to to use rustup and curl ... | bash, but Rust Foundation packaging practices are just inacceptable. Fortunately in distros some versions of Rust are packaged. Unfortunately the versions they ship are "old" compared to the pace of Rust language development (and IMHO it was a mistake to add support of experimental features into stable flavour of rust but give no way to enable them, if the language develops in such a pace).

So here is the series of patches. Some of them revert some cosmetic commits, some of them revert the commits with the features I haven't managed to rewrite into older syntax and stdlib (I don't know Rust well enough for it), some of them just rewrite pieces of code into old syntax.

@matklad
Copy link
Member

matklad commented Jul 19, 2021

Note that this is the wrong place do discuss the overall rust-lang policy of compiler upgrades. The right place for that discussion would be the internals forum: https://internals.rust-lang.org.

As for the language version policy of the rust-analyzer itself, we currently explicitly only support the latest stable compiler, both at the compile time (you need stable rust to compile ra) and at runtime (using rust-analyzer with other versions of rustc might result in proc macros not working).

My practical advice, for the cases where only an old compiler is available, is to pick the corresponding older version of rust-analyzer. For example, for distro packaging, it makes sense to package the version which is distrubuted via rustup for the corresponding rustc version.

I don't think it's likely that we'll make the MSRV of rust-analyzer itself more lax. If anything, we might end up using nightly/beta instead of stable once we move closer to rustc. As such, I am going to close this PR. If you believe that the policy is wrong, and that we should support older compilers at compile time, please open an issue for discussion: it's not useful to charge ahead with patches reverting an explicit decision: https://github.com/rust-analyzer/rust-analyzer/blob/64bf67c5aa096eb6a059d6bb8304981ecb90318e/xtask/src/install.rs#L10-L12

@matklad matklad closed this Jul 19, 2021
@ramxrem420

This comment has been minimized.

@KOLANICH
Copy link
Contributor Author

using rust-analyzer with other versions of rustc might result in proc macros not working

Thanks for the info.

I don't think it's likely that we'll make the MSRV of rust-analyzer itself more lax.
I am going to close this PR.
It's not useful to charge ahead with patches reverting an explicit decision

In fact I haven't been expecting it to be merged (Rust community really likes using nightly versions, I am not here to dissuade them). I have done them for myself (and other like-minded people), but they are here just to increase their visibility and to get the feedback.

@matklad
Copy link
Member

matklad commented Jul 19, 2021

In fact I haven't been expecting it to be merged (Rust community really likes using nightly versions, I am not here to dissuade them). I have done them for myself (and other like-minded people), but they are here just to increase their visibility and to get the feedback.

Ah sorry, I've misunderstood your intention then! I still suggest creating an issue for this purpose, an open issue is a better point of coordination than a closed PR!

@lnicola
Copy link
Member

lnicola commented Jul 21, 2021

Just to correct some factual errors that might confuse other Debian users who find this thread:

  • you're not supposed to install rustup with curl | sudo sh, but rather curl | sh, since it doesn't modify system-wide files; more so, a distro can package rustup without any issues, and some (but not Debian) actually do that
  • rust-analyzer currently compiles on the latest stable version, not nightly
  • a recent rust-analyzer will often panic when running proc macros built with an old compiler, which leads to a bad user experience
  • there are no (working) experimental features in the stable compiler; that might crop up in error messages, but it means that the feature was experimental when the compiler was released (and didn't work on stable). If you get these errors in a project, it probably needs a recent stable compiler, not a nightly one
  • "all the distros" is a vague term; I wouldn't expect e.g. CentOS 7 to have a recent rustc version, and yet it has 1.53 (the latest version, as of today, as opposed to 1.41 in Debian)

@KOLANICH KOLANICH mentioned this pull request May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants