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

Installing multiple tools from one repo with ubi #2875

Closed
arlyon opened this issue Oct 31, 2024 · 7 comments
Closed

Installing multiple tools from one repo with ubi #2875

arlyon opened this issue Oct 31, 2024 · 7 comments

Comments

@arlyon
Copy link

arlyon commented Oct 31, 2024

Hi!

I like using mise+ubi and wanted to try out a tool called fluvio. They have a handful of clis all available in the same repo which I'd like to add using ubi, however since all the binaries come from the same repo, the keys clash.

I would like to suggest adding an additional syntax item to the key name that could be used by plugins for whatever they'd like to disambiguate. In the case of the ubi plugin, whatever is in the #suffix could be mapped to the matching key in the associated value.

[tools]
rust = "1.82.0"
- "ubi:infinyon/fluvio" = { version = "v0.12.0", matching = "fluvio" }
- "ubi:infinyon/fluvio" = { version = "v0.12.0", matching = "cdk" }
+ "ubi:infinyon/fluvio#fluvio" = { version = "v0.12.0" }
+ "ubi:infinyon/fluvio#cdk" = { version = "v0.12.0" }
@jdx
Copy link
Owner

jdx commented Nov 2, 2024

I think you might be able to do this with mise use ubi:infinyon/fluvio[matching=fluvio] but I haven't tested. If it doesn't work, try putting that into the config file as it might just be an issue with mise use

@fiadliel
Copy link
Contributor

fiadliel commented Nov 4, 2024

This is more than a file syntax issue; you can put two references to the same ubi package in different mise projects but with different downloaded binaries. Only one of these will work, as the other will believe the package is already downloaded and correctly installed.

e.g. project 1 has mise.toml:

[tools]
"ubi:infinyon/fluvio" = { version = "v0.12.0", matching = "fluvio" }

project 2 has mise.toml

[tools]
"ubi:infinyon/fluvio" = { version = "v0.12.0", exe = "cdk" }

Even though there's no issue with a config file key conflict, they do clash in the cache directory. The settings of whichever instance is installed first, is the one used.

This does work for me, if the exe and matching is encoded into the package name as suggested above; the tooling configuration is then also encoded into the cache file, e.g.

$ which fluvio
.../.local/share/mise/installs/ubi-infinyon-fluvio-matching-fluvio/0.12.1/bin/fluvio

I think these settings should always be encoded into the cache name.

@jdx
Copy link
Owner

jdx commented Nov 5, 2024

I see, this is tricky. I don't think it's a great idea to start adding the options onto the name. The name of the install is supposed to be part of the UX and appending a bunch of crap doesn't seem very usable—especially considering options might contain a ton of information.

That said, I don't know what a good alternative might be. #2885 would be a bandaid for this, but it would require some custom config just to make this work correctly.

@fiadliel
Copy link
Contributor

fiadliel commented Nov 5, 2024

I don't think it's a great idea to start adding the options onto the name.

What I meant was to add the options to the path to the cached files somehow (hash? sub-path? encode into an existing path component)? I wouldn't like this to be present in the UX unless you look at where the files are stored - I agree it's not friendly to have there.

The alias option mentioned in #2885 does workaround it slightly - but my main issue with this is that a defensive encoding of the mise config, with a scenario like above, would need to use aliases just in case another project requests a different binary in the same repo. And as mise usage expands in the ecosystem, the chances of this happening increase.

@jdx
Copy link
Owner

jdx commented Nov 5, 2024

I wouldn't like this to be present in the UX unless you look at where the files are stored

the file structure is the UX. I intend for users to interact directly with the mise install directories.

@pdecat
Copy link
Contributor

pdecat commented Nov 6, 2024

This UBI issue houseabsolute/ubi#68 may help if implemented.

@jdx
Copy link
Owner

jdx commented Nov 25, 2024

I think the solution here is to use aqua

@jdx jdx closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants