rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Sarthak Singh <sarthak.singh99@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Sarthak Singh" <ss269@uw.edu>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Dirk Behme" <dirk.behme@de.bosch.com>,
	rust-for-linux@vger.kernel.org,
	"Lukas Wirth" <lukas.wirth@ferrous-systems.com>
Subject: Re: [PATCH v2] rust: Support latest version of `rust-analyzer`
Date: Tue, 23 Jul 2024 16:07:11 +0200	[thread overview]
Message-ID: <CANiq72keKdr7ZhufjdeM3g0tgDo80nk2NNBN5SBSepHry-LaQQ@mail.gmail.com> (raw)
In-Reply-To: <20240723104052.2924378-1-sarthak.singh99@gmail.com>

Hi Sarthak,

Thanks for the patch! A few notes below.

On Tue, Jul 23, 2024 at 12:41 PM Sarthak Singh
<sarthak.singh99@gmail.com> wrote:
>
> From: Sarthak Singh <ss269@uw.edu>

In case you are wondering, this line is here because you are
submitting the patch from a different email address than this one. It
would be ideal if you can submit from the address that you are
signing-off-by (if you cannot, please send me a dummy private message
from that address).

> Sets the `sysroot` field in rust-project.json which is now needed in
> newer versions of rust-analyzer instead of the `sysroot_src` field.
>
> `sysroot` over `sysroot_src` has been working since rust 1.74.0 (which
> was released on Nov 16, 2023). Since we are going to target rust 1.78.0
> going forward we should set `sysroot` to support all currently used and
> future versions of rust-analyzer.

Hmm... it would be nice to know the root cause, i.e. what changed in
rust-analyzer?

From a quick look, the `sysroot` key has existed in rust-analyzer
since 2022 (189521a4db6e), but undocumented. Then it got documented in
2023 (5da14237eb29). So I am not sure what "`sysroot` over
`sysroot_src`" means (and the current docs are not very clear on what
each does and their intended interactions, e.g. what happens if one
specifies `sysroot_src` but not `sysroot`, or the other way around?
Should `sysroot_src` be relative to `sysroot` like the default?)

Anyway, we are passing the paths for `core` etc. in `crates`, and we
don't have a custom `alloc` anymore, so I wonder if we should either
delete both keys (or however one disables auto-search) or delete the
crates in `crates` and let the sysroot logic find them.

(Cc'ing Lukas since he may able to tell us about the background.)

> Code editors like VS Code try to use the latest version of rust-analyzer
> (which is updated every week) instead of the version of rust-analyzer
> that comes with the rustup toolchain (which is updated every six weeks
> along with the rust version).
>
> Without this change rust-analyzer is breaking for anyone using VS Code.

Just to confirm, does this make it work for distribution and
`rustup`-using installs?

> Signed-off-by: Sarthak Singh <ss269@uw.edu>

Dirk gave a Tested-by tag to v1 -- normally you would pick up those
tags if you submit a new version and you consider them still valid
(before the Signed-off-by). I think you didn't change the contents of
the patch, right?

Cheers,
Miguel

  reply	other threads:[~2024-07-23 14:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 10:40 [PATCH v2] rust: Support latest version of `rust-analyzer` Sarthak Singh
2024-07-23 14:07 ` Miguel Ojeda [this message]
2024-07-23 16:01   ` Sarthak Singh
2024-07-23 17:35     ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANiq72keKdr7ZhufjdeM3g0tgDo80nk2NNBN5SBSepHry-LaQQ@mail.gmail.com \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dirk.behme@de.bosch.com \
    --cc=gary@garyguo.net \
    --cc=lukas.wirth@ferrous-systems.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sarthak.singh99@gmail.com \
    --cc=ss269@uw.edu \
    --cc=wedsonaf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).