Skip to content

feat: add self update command#450

Open
JosiahParry wants to merge 2 commits into
A2-ai:mainfrom
JosiahParry:feat/self-update
Open

feat: add self update command#450
JosiahParry wants to merge 2 commits into
A2-ai:mainfrom
JosiahParry:feat/self-update

Conversation

@JosiahParry
Copy link
Copy Markdown

@JosiahParry JosiahParry commented May 5, 2026

This PR adds a new self sub command to create a rv self update akin to uv self update and juliaup self update.

This is motivated by wanted to get recent and up to date changes from rv but having to go to the repo, then copying the install script, then pasting.

rv ⚡ rv self update
Checking target-arch... aarch64-apple-darwin
Checking current version... v0.20.0
Checking latest released version... v0.21.0 (1 versions available)
New release found! v0.20.0 --> v0.21.0
New release is *NOT* compatible

rv release status:
  * Current exe: "/Users/josiahparry/.cargo/bin/rv"
  * New exe release: "rv-v0.21.0-aarch64-apple-darwin.tar.gz"
  * New exe download url: "https://api.github.com/repos/A2-ai/rv/releases/assets/410120004"

The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] y
Downloading...
[00:00:01] [========================================] 3.29 MiB/3.29 MiB (0s) Done       
Extracting archive... Done
Replacing binary file... Done
rv updated to 0.21.0

Comment thread Cargo.toml Outdated
Copy link
Copy Markdown
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it show if the user is not allowed to write to where the binary is?

Comment thread Cargo.toml
ctrlc = { version = "3", optional = true, features = ["termination"] }
libc = "0.2.172"
taplo = "0.14.0"
self_update = {version = "0.44", optional = true, features = ["archive-tar", "compression-flate2"] }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use the ureq and rustls feature? We already use those elsewhere

@JosiahParry
Copy link
Copy Markdown
Author

For testing a non-writable path, do you have an idea how to test that? My thinking is make rv rwx for root then run as subuser on linux with only rx permissions. Does that sound right?

@Keats
Copy link
Copy Markdown
Collaborator

Keats commented May 7, 2026

Yep sounds good. It doesn't need to be a test in the repo, it can just be a test you make locally

@dpastoor
Copy link
Copy Markdown
Member

dpastoor commented May 9, 2026

yep - the context is enterprise customers install rv to like /usr/local/bin/rv then if a user attempts to run that it should fail gracefully.

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.

3 participants