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

just self update to update itself #2006

Closed
woutervh opened this issue Apr 17, 2024 · 6 comments
Closed

just self update to update itself #2006

woutervh opened this issue Apr 17, 2024 · 6 comments

Comments

@woutervh
Copy link

It would be nice if just could update itself via just self update.

For example:

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

see astral-sh/uv#1591

@casey
Copy link
Owner

casey commented Apr 17, 2024

How would this work with just installed via package manager, where just can't overwrite the installed binary?

@woutervh
Copy link
Author

Not?
I always use the curl-script.

@casey
Copy link
Owner

casey commented Apr 18, 2024

If this were implemented, just would need to be able to detect if it was installed in such a way where it was not safe to self-update.

@laniakea64
Copy link
Contributor

The programs linked in the original comment appear to be package managers whose self update commands leverage their own package management systems. just not being a package manager, it doesn't have the required framework to implement this, it has no way to know how to self-update.

It's not inconceivable this could work implemented as --self-update gated behind a disabled-by-default Cargo feature. The Github release builds could opt into the feature, and the self update could check if the binary can be written to and if so, download and update to latest Github release build. Other builds of just simply wouldn't have the flag or the self update functionality (unless of course someone specifically enables the feature and doesn't mind their build overwritten with a later Github release build).

But even adding self update functionality only for Github release builds might be unwise. It would break backwards-compatibility of repackaging the Github release just binaries as-is into third-party package management systems, which IIRC some people are doing. Not sure whether just's commitment to backwards compatibility includes stuff like this?

@woutervh
Copy link
Author

The programs linked in the original comment appear to be package managers whose self update commands leverage their own package management systems.

No, uv is a stand-alone rust-based executable. The fact it is a replacement for pip that is a package manager for python is coincidence.

The implementation is here:
https://github.com/astral-sh/uv/pull/2228/files#diff-7fcfb3d9338c46fcb8b07d828537551de2a3e78090ded4ffbf4337d8c4dcdb8a
and uses https://github.com/axodotdev/axoupdater

How would this work with just installed via package manager, where just can't overwrite the installed binary?

image

@casey
Copy link
Owner

casey commented May 14, 2024

I think just is often installed via a package manager, where this isn't possible in a generic way, so I think this can't be done easily.

@casey casey closed this as completed May 14, 2024
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