rust-lang / rust-lang/rust-analyzer

Please add version string into release metadata

Open
#19,769 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Before it was possible to check if there update required by checking name from release (which actually was a date) and date from --version string. Now this update script is not working because there is no more date reported by --version and no version field in releases.json. So, it would be nice to have the possibility to automatically match installed rust-analyzer binary against available in releases section.

#!/bin/bash
TMP_DIR=$(mktemp -d)
echo "Work in ${TMP_DIR}"
curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer your_secret_ro_token" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/rust-lang/rust-analyzer/releases > ${TMP_DIR}/releases.json

LAST_VER=`jq 'map(select(.prerelease == false)) | first.name ' ${TMP_DIR}/releases.json | tr -d v\"`
CURRENT_VER=$(~/bin/rust-analyzer --version|awk '{print $4}' | tr -d \))
if [[ $LAST_VER != $CURRENT_VER ]]; then
    echo "Versions differs: found last ${LAST_VER} vs old ${CURRENT_VER}"
    URL=`jq 'map(select(.prerelease == false)) | first.assets | map(select(.name=="rust-analyzer-x86_64-unknown-linux-gnu.gz"))[0].browser_download_url ' ${TMP_DIR}/releases.json | tr -d \"`
    cd $TMP_DIR
    wget $URL -O - | zcat - > /tmp/rust-analyzer
    mv /tmp/rust-analyzer ~/bin/rust-analyzer
    chmod +x ~/bin/rust-analyzer
fi

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the release metadata represented by releases.json and the rust-analyzer --version output, then trace the release process that produces them. Confirm that a version field is available for matching installed binaries with the latest non-prerelease release, and verify the shell update script can use it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
release
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.