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

Support for arbitrary URLs? #98

Open
dradtke opened this issue Feb 11, 2025 · 7 comments
Open

Support for arbitrary URLs? #98

dradtke opened this issue Feb 11, 2025 · 7 comments

Comments

@dradtke
Copy link

dradtke commented Feb 11, 2025

Is there any plan to support arbitrary URLs, alongside Github and Gitlab?

For instance, Elvish has a custom URL structure that would be easy enough to parameterize, but its binaries are self-hosted.

@autarch
Copy link
Member

autarch commented Feb 11, 2025

There's already a --url flag that would do most of this. I think there would just need to be some tweaks to allow the URL to not be a GitHub or GitLab URL, but that should be fairly easy.

@autarch
Copy link
Member

autarch commented Feb 11, 2025

I would note that at this point I'm not sure that ubi is doing much. The main point of it, IMO, is that it finds the right thing to download for your platform. The --url is there as a backdoor for certain CI use cases where you want to avoid GitHub/Lab rate limits.

So without the "pick the right thing", it's not much different than curl $url | tar -xvzf -.

@autarch
Copy link
Member

autarch commented Feb 12, 2025

I just looked a the Elvish site and I thought it was kind of funny that their recommended install mechanism is ...

curl -so - https://dl.elv.sh/linux-amd64/elvish-v0.21.0.tar.gz | sudo tar -xzvC /usr/local/bin

@dradtke
Copy link
Author

dradtke commented Feb 12, 2025

My motivation for opening this issue is to be able to install something like Elvish using the ubi backend in Mise, and having that feature in ubi I think is the first step. ubi itself may not be doing much more than curl, but if the feature is there then I think Mise could be updated to support it.

@autarch
Copy link
Member

autarch commented Feb 12, 2025

I see. Thanks for the context. I've been switching my own projects to mise recently.

I think in this case, it might make more sense to submit a PR to add this to aqua - https://github.com/aquaproj/aqua-registry

From what I can see, aqua already supports installing from an arbitrary URL.

@autarch
Copy link
Member

autarch commented Feb 12, 2025

Although looking at aqua more closely, it seems like it only supports one version of a package at a time in its registry, which is a bit odd.

@dradtke
Copy link
Author

dradtke commented Feb 12, 2025

The benefit of ubi is that it lets you install arbitrary binaries, even if they are not in a registry. It may make sense to add Elvish to aqua, but I still think extending ubi or Mise to support downloading binaries from a known path would be a good feature.

From an end-user perspective, it's odd to me that binaries can only be downloaded from Github or Gitlab. Having knowledge of those platforms to ease installation in most cases is great, but it seems like a natural extension to allow any URL. It already kind of does here, but that fails if you try to use any non-Github URL:

$ mise use 'ubi:https://dl.elv.sh/linux-amd64/elvish-v0.21.0.tar.gz'
mise ERROR failed to install ubi:https://dl.elv.sh/linux-amd64/elvish-v0.21.0.tar.gz@latest
mise ERROR Failed to install with ubi 'ubi:https://dl.elv.sh/linux-amd64/elvish-v0.21.0.tar.gz@latest': HTTP status client error (404 Not Found) for url (https://api.github.com/repos/linux-amd64/elvish-v0.21.0.tar.gz/releases/tags/vlatest)
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

It also would need to be extended to be more templated, mainly to allow for substitution of the platform name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants