Re: [PATCH v5 1/2] scripts: generate_rust_analyzer.py: add versioning infrastructure
From: Jesung Yang
Date: Fri May 01 2026 - 10:27:47 EST
On Thu, Apr 30, 2026 at 11:14 PM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
> On Thu, Apr 30, 2026 at 8:15 AM Jesung Yang via B4 Relay
> <devnull+y.j3ms.n.gmail.com@xxxxxxxxxx> wrote:
[...]
> > + # NOTE:
> > + # This rust-analyzer release should be kept in sync with our MSRV (currently 1.85.0).
> > + # When the MSRV is bumped, follow the steps below to retrieve the information needed
> > + # to update this:
> > + #
> > + # 1) Clone both Rust and rust-analyzer repositories.
> > + # ```console
> > + # $ git clone https://github.com/rust-lang/rust.git
> > + # $ git clone https://github.com/rust-lang/rust-analyzer.git
> > + # ```
> > + # 2) Run the following script, providing the new MSRV as an argument.
> > + # It uses `xdg-open` to open the matching [1] rust-analyzer release page.
> > + # ```bash
> > + # #!/usr/bin/env bash
> > + #
> > + # RUST_VERSION=$1
> > + # LOOKAHEAD=50
> > + #
> > + # subject_string=$(
> > + # git -C ./rust log -n "$LOOKAHEAD" --format='%s' "$RUST_VERSION" \
> > + # -- src/tools/rust-analyzer | grep 'Merge pull request #'
>
> This grep can be replaced with `--merges` and then you can just use
> `-n 1` instead of `-n $LOOKAHEAD`, right?
No, because of commits like "Merge from rust-lang/rust." Sometimes
those are more recent than the downstream PR merges we're looking for.
An example using 1.86.0:
$ git -C ./rust log --merges -n 1 --format='%s' 1.86.0 \
-- src/tools/rust-analyzer
Merge from rust-lang/rust
$ git -C ./rust-analyzer log -n 1 --fixed-strings \
--grep='Merge from rust-lang/rust'
commit 99894ccbccd63cd7480ac282ba636e84004427bc
Merge: d105b7e0d1 f13fe5a4dc
Author: Laurențiu Nicola <lnicola@xxxxxxx>
Date: Mon Jul 21 09:18:22 2025 +0300
Merge from rust-lang/rust
Since "Merge from rust-lang/rust" is a common subject name for
downstream synchronizations, we've picked up a more recent one here
(1.86.0 was released on Apr 3 2025, which predates the Jul 21 2025
commit shown above).
> > + # )
> > + # readarray -t subject_array <<< "$subject_string"
> > + #
> > + # hash=$(
> > + # git -C ./rust-analyzer log -n 1 --format='%H' --fixed-strings \
> > + # "${subject_array[@]/#/--grep=}"
> > + # )
> > + #
> > + # tag_predates=$(git -C ./rust-analyzer describe --tags --abbrev=0 "$hash")
> > + #
> > + # link_prefix="https://github.com/rust-lang/rust-analyzer/releases/tag"
> > + # xdg-open "$link_prefix/$tag_predates"
> > + # ```
>
> With or without the `--merges` change, this always takes me to a very
> recent tag. It seems like `git log -- src/tools/rust-analyzer` in the
> rust repo never shows merge commits?
Perhaps the MSRV wasn't provided as an argument? I see the nightly
release page if the version is missing or unknown.
$ ./check.sh 1.85.0
# This opens:
# https://github.com/rust-lang/rust-analyzer/releases/tag/2024-12-23
$ ./check.sh 1.94.0
# This opens:
# https://github.com/rust-lang/rust-analyzer/releases/tag/2026-01-05
$ ./check.sh 1.85
# This opens:
# https://github.com/rust-lang/rust-analyzer/releases/tag/nightly
$ ./check.sh
# This opens:
# https://github.com/rust-lang/rust-analyzer/releases/tag/nightly
I'll add `set -e` and a check to make the argument mandatory to prevent
this confusion.
As for the rest of your comments, I'll incorporate them in the next
version.
Best regards,
Jesung