Skip to content
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

rye self update always re-downloading binary, even when up to date. #1033

Open
poopsicles opened this issue Apr 20, 2024 · 4 comments
Open

Comments

@poopsicles
Copy link

Steps to Reproduce

  1. Install the latest version of rye on Linux.
  2. Attempt to update it with rye self update

Expected Result

It should check and see that it's the latest version and report "Already up to date."

Actual Result

It re-downloads the binary and makes a new virtualenv.

image

Version Info

$ rye --version
rye 0.32.0
commit: 0.32.0 (e1b4f2a29 2024-03-29)
platform: linux (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true

Stacktrace

No response

@mikky-j
Copy link

mikky-j commented Apr 20, 2024

A possible fix for this would be to host the checksum of the latest version (preferrably on GitHub) and then use that to validate if the user's binary is up to date or not

@ashemedai
Copy link

I guess it would be similar to what uv does:

% uv self update
info: Checking for updates...
success: You're on the latest version of `uv` (v0.1.38).

@mikky-j
Copy link

mikky-j commented Apr 26, 2024

Exactly. The ideal case would be something like what uv is doing

Looking at the the uv codebase, I can see that it is using AxoUpdater which is a crate that is used to install files distributed using cargo-dist

here for the uv implementation

The functionality that we would want is already built into AxoUpdater but we would need to ensure that rye can be distributed using cargo-dist

From the little testing that I did with AxoUpdater, "rye" is not currently using cargo-dist

So we have two options if we want to do this

  1. We implement the checksum by providing it in the releases and then comparing the checksum of the current binary to that one to know if we need a release similar to what a tool like rustup here
  2. We need to use cargo-dist for rye's distribution

Note: For rustup, instead checksums they have a toml file that they get the latest stable version from and then they compare it to the current version of that the program is running on. This is much simpler than the checksum.

I think the team is probably planning on 2 because they did it for uv so it would make sense that they would do it for rye but I'm not sure why (maybe there's an issue using cargo-dist?).

For a hotfix, something like what rustup does would be the likely candidate

If there is an interest in adding this feature, I would like be assigned to it.

@mikky-j
Copy link

mikky-j commented Apr 26, 2024

There's already a MANIFEST.json in the releases so implementing any of the solutions mentioned below would be trival

So we have two options if we want to do this

1. We implement the checksum by providing it in the releases and then comparing the checksum of the current binary to that one to know if we need a release similar to what a tool like `rustup` [here](https://github.com/rust-lang/rustup/blob/bbb9276d24519f8684cd616b2e46b7596f7dd891/src/cli/self_update.rs#L1214)

2. We need to use `cargo-dist` for rye's distribution

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

No branches or pull requests

3 participants