Skip to content

Commit

Permalink
feat: aqua backend (#2995)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Nov 12, 2024
1 parent c2326e4 commit 0bcdf72
Show file tree
Hide file tree
Showing 32 changed files with 689 additions and 35 deletions.
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ rmp-serde = "1"
serde = "1"
serde_derive = "1"
serde_ignored = "0.1"
serde_json = { version = "1", features = [] }
serde_json = "1"
serde_yaml = "0.9"
sha2 = "0.10.8"
shell-escape = "0.1"
shell-words = "1"
Expand Down Expand Up @@ -129,6 +130,7 @@ vfox = { version = "0.3", default-features = false }
walkdir = "2"
which = "7"
xx = { version = "1", features = ["glob"] }
xz2 = "0.1"
zip = { version = "2", default-features = false, features = ["deflate"] }

[target.'cfg(unix)'.dependencies]
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default defineConfig({
link: "/dev-tools/backends/",
collapsed: true,
items: [
{ text: "aqua", link: "/dev-tools/backends/aqua" },
{ text: "asdf", link: "/dev-tools/backends/asdf" },
{ text: "cargo", link: "/dev-tools/backends/cargo" },
{ text: "go", link: "/dev-tools/backends/go" },
Expand Down
25 changes: 25 additions & 0 deletions docs/dev-tools/backends/aqua.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Aqua Backend <Badge type="warning" text="experimental" />

[Aqua](https://aquaproj.github.io/) tools may be used natively in mise.

The code for this is inside the mise repository at [`./src/backend/aqua.rs`](https://github.com/jdx/mise/blob/main/src/backend/aqua.rs).

## Usage

The following installs the latest version of ripgrep and sets it as the active version on PATH:

```sh
$ mise use -g aqua:BurntSushi/ripgrep
$ rg --version
ripgrep 14.1.1
```

The version will be set in `~/.config/mise/config.toml` with the following format:

```toml
[tools]
"aqua:BurntSushi/ripgrep" = "latest"
```

Some tools will default to use aqua if they're specified in [registry.toml](https://github.com/jdx/mise/blob/main/registry.toml)
to use the aqua backend. To see these tools, run `mise registry | grep aqua:`.
15 changes: 3 additions & 12 deletions docs/dev-tools/backends/vfox.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Vfox Backend <Badge type="warning" text="experimental" />

[Vfox](https://github.com/version-fox/vfox) plugins may be used in mise as an alternative for asdf
plugins. On Windows, only vfox plugins are supported since asdf plugins require POSIX compatibility.
[Vfox](https://github.com/version-fox/vfox) plugins may be used in mise to install tools.

The code for this is inside of the mise repository at [`./src/backend/vfox.rs`](https://github.com/jdx/mise/blob/main/src/backend/vfox.rs).
The code for this is inside the mise repository at [`./src/backend/vfox.rs`](https://github.com/jdx/mise/blob/main/src/backend/vfox.rs).

## Dependencies

Expand All @@ -13,14 +12,6 @@ No dependencies are required for vfox. Vfox lua code is read via a lua interpret

The following installs the latest version of cmake and sets it as the active version on PATH:

```sh
$ mise use -g vfox:cmake
$ cmake --version
cmake version 3.21.3
```

Alternatively, you can specify the GitHub repo:

```sh
$ mise use -g vfox:version-fox/vfox-cmake
$ cmake --version
Expand All @@ -31,7 +22,7 @@ The version will be set in `~/.config/mise/config.toml` with the following forma

```toml
[tools]
"vfox:cmake" = "latest"
"vfox:version-fox/vfox-cmake" = "latest"
```

## Default plugin backend
Expand Down
5 changes: 2 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ and `mise deactivate` to work without wrapping them in `eval "$(mise shell)"`.

## Windows support?

Very basic support for windows is currently available, however because Windows can't support asdf
plugins, they must use core and vfox only—which means only a handful of tools are available on
Windows.
Very basic support for windows is currently available, however because Windows can't support the asdf
backend, windows can use core, aqua, or vfox backends though.

As of this writing, env var management and task execution are not yet supported on Windows.

Expand Down
10 changes: 5 additions & 5 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ editLink: false
| ----------- | --------------- |
| 1password-cli | [asdf:NeoHsu/asdf-1password-cli](https://github.com/NeoHsu/asdf-1password-cli) |
| aapt2 | [asdf:ronnnnn/asdf-aapt2](https://github.com/ronnnnn/asdf-aapt2) |
| act | [ubi:nektos/act](https://github.com/nektos/act) [asdf:gr1m0h/asdf-act](https://github.com/gr1m0h/asdf-act) |
| action-validator | [ubi:mpalmer/action-validator](https://github.com/mpalmer/action-validator) [asdf:mpalmer/action-validator](https://github.com/mpalmer/action-validator) |
| act | [aqua:nektos/act](https://github.com/nektos/act) [ubi:nektos/act](https://github.com/nektos/act) [asdf:gr1m0h/asdf-act](https://github.com/gr1m0h/asdf-act) |
| action-validator | [aqua:mpalmer/action-validator](https://github.com/mpalmer/action-validator) [ubi:mpalmer/action-validator](https://github.com/mpalmer/action-validator) [asdf:mpalmer/action-validator](https://github.com/mpalmer/action-validator) |
| actionlint | [ubi:rhysd/actionlint](https://github.com/rhysd/actionlint) [asdf:crazy-matt/asdf-actionlint](https://github.com/crazy-matt/asdf-actionlint) |
| adr-tools | [asdf:https://gitlab.com/td7x/asdf/adr-tools](https://gitlab.com/td7x/asdf/adr-tools) |
| ag | [asdf:koketani/asdf-ag](https://github.com/koketani/asdf-ag) |
| age | [asdf:threkk/asdf-age](https://github.com/threkk/asdf-age) |
| age | [aqua:FiloSottile/age](https://github.com/FiloSottile/age) [asdf:threkk/asdf-age](https://github.com/threkk/asdf-age) |
| age-plugin-yubikey | [asdf:joke/asdf-age-plugin-yubikey](https://github.com/joke/asdf-age-plugin-yubikey) |
| agebox | [ubi:slok/agebox](https://github.com/slok/agebox) [asdf:slok/asdf-agebox](https://github.com/slok/asdf-agebox) |
| air | [asdf:pdemagny/asdf-air](https://github.com/pdemagny/asdf-air) |
Expand Down Expand Up @@ -179,7 +179,7 @@ editLink: false
| dhall | [asdf:aaaaninja/asdf-dhall](https://github.com/aaaaninja/asdf-dhall) |
| difftastic | [ubi:wilfred/difftastic](https://github.com/wilfred/difftastic) [asdf:volf52/asdf-difftastic](https://github.com/volf52/asdf-difftastic) |
| digdag | [asdf:jtakakura/asdf-digdag](https://github.com/jtakakura/asdf-digdag) |
| direnv | [asdf:asdf-community/asdf-direnv](https://github.com/asdf-community/asdf-direnv) |
| direnv | [aqua:direnv/direnv](https://github.com/direnv/direnv) [asdf:asdf-community/asdf-direnv](https://github.com/asdf-community/asdf-direnv) |
| dive | [ubi:wagoodman/dive](https://github.com/wagoodman/dive) [asdf:looztra/asdf-dive](https://github.com/looztra/asdf-dive) |
| djinni | [asdf:cross-language-cpp/asdf-djinni](https://github.com/cross-language-cpp/asdf-djinni) |
| dmd | [asdf:sylph01/asdf-dmd](https://github.com/sylph01/asdf-dmd) |
Expand Down Expand Up @@ -612,7 +612,7 @@ editLink: false
| revive | [asdf:bjw-s/asdf-revive](https://github.com/bjw-s/asdf-revive) |
| richgo | [asdf:paxosglobal/asdf-richgo](https://github.com/paxosglobal/asdf-richgo) |
| riff | [asdf:abinet/asdf-riff](https://github.com/abinet/asdf-riff) |
| ripgrep | [ubi:BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) [asdf:https://gitlab.com/wt0f/asdf-ripgrep](https://gitlab.com/wt0f/asdf-ripgrep) |
| ripgrep | [ubi:BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) [aqua:BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) [asdf:https://gitlab.com/wt0f/asdf-ripgrep](https://gitlab.com/wt0f/asdf-ripgrep) |
| rke | [asdf:particledecay/asdf-rke](https://github.com/particledecay/asdf-rke) |
| rlwrap | [asdf:asdf-community/asdf-rlwrap](https://github.com/asdf-community/asdf-rlwrap) |
| rome | [asdf:kichiemon/asdf-rome](https://github.com/kichiemon/asdf-rome) |
Expand Down
6 changes: 6 additions & 0 deletions e2e/backend/test_aqua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

export MISE_EXPERIMENTAL=1

assert_contains "mise x aqua:BurntSushi/[email protected] -- rg --version" "ripgrep 14.0.0"
assert "mise x [email protected] -- age --version" "v1.2.0"
10 changes: 5 additions & 5 deletions registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
[tools]
1password-cli = ["asdf:NeoHsu/asdf-1password-cli"]
aapt2 = ["asdf:ronnnnn/asdf-aapt2"]
act = ["ubi:nektos/act", "asdf:gr1m0h/asdf-act"]
action-validator = ["ubi:mpalmer/action-validator", "asdf:mpalmer/action-validator"]
act = ["aqua:nektos/act", "ubi:nektos/act", "asdf:gr1m0h/asdf-act"]
action-validator = ["aqua:mpalmer/action-validator", "ubi:mpalmer/action-validator", "asdf:mpalmer/action-validator"]
actionlint = ["ubi:rhysd/actionlint", "asdf:crazy-matt/asdf-actionlint"]
adr-tools = ["asdf:https://gitlab.com/td7x/asdf/adr-tools"]
ag = ["asdf:koketani/asdf-ag"]
age = ["asdf:threkk/asdf-age"]
age = ["aqua:FiloSottile/age", "asdf:threkk/asdf-age"]
age-plugin-yubikey = ["asdf:joke/asdf-age-plugin-yubikey"]
agebox = ["ubi:slok/agebox", "asdf:slok/asdf-agebox"]
air = ["asdf:pdemagny/asdf-air"]
Expand Down Expand Up @@ -178,7 +178,7 @@ devspace = ["asdf:NeoHsu/asdf-devspace"]
dhall = ["asdf:aaaaninja/asdf-dhall"]
difftastic = ["ubi:wilfred/difftastic[exe=difft]", "asdf:volf52/asdf-difftastic"]
digdag = ["asdf:jtakakura/asdf-digdag"]
direnv = ["asdf:asdf-community/asdf-direnv"]
direnv = ["aqua:direnv/direnv", "asdf:asdf-community/asdf-direnv"]
dive = ["ubi:wagoodman/dive", "asdf:looztra/asdf-dive"]
djinni = ["asdf:cross-language-cpp/asdf-djinni"]
dmd = ["asdf:sylph01/asdf-dmd"]
Expand Down Expand Up @@ -610,7 +610,7 @@ restish = ["ubi:danielgtaylor/restish", "go:github.com/danielgtaylor/restish"]
revive = ["asdf:bjw-s/asdf-revive"]
richgo = ["asdf:paxosglobal/asdf-richgo"]
riff = ["asdf:abinet/asdf-riff"]
ripgrep = ["ubi:BurntSushi/ripgrep[exe=rg]", "asdf:https://gitlab.com/wt0f/asdf-ripgrep"]
ripgrep = ["ubi:BurntSushi/ripgrep[exe=rg]", "aqua:BurntSushi/ripgrep", "asdf:https://gitlab.com/wt0f/asdf-ripgrep"]
rke = ["asdf:particledecay/asdf-rke"]
rlwrap = ["asdf:asdf-community/asdf-rlwrap"]
rome = ["asdf:kichiemon/asdf-rome"]
Expand Down
5 changes: 5 additions & 0 deletions schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
"description": "should mise keep install files after installation even if the installation fails",
"type": "boolean"
},
"aqua_registry_url": {
"default": "https://github.com/aquaproj/aqua-registry",
"description": "URL to fetch aqua registry from.",
"type": "string"
},
"asdf": {
"description": "use asdf as a default plugin backend",
"deprecated": "Use disable_backends instead.",
Expand Down
3 changes: 3 additions & 0 deletions scripts/render-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ for (const match of stdout.split("\n")) {
return `[${match[1]}:${match[2]}](https://pkg.go.dev/${match[2]})`;
} else if (match[1] === "ubi") {
return `[${match[1]}:${match[2]}](https://github.com/${match[2]})`;
} else if (match[1] === "aqua") {
// TODO: handle non-github repos
return `[${match[1]}:${match[2]}](https://github.com/${match[2]})`;
} else {
throw new Error(`Unknown registry: ${full}`);
}
Expand Down
6 changes: 6 additions & 0 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ env = "MISE_ALWAYS_KEEP_INSTALL"
type = "Bool"
description = "should mise keep install files after installation even if the installation fails"

[aqua_registry_url]
env = "MISE_AQUA_REGISTRY_URL"
type = "Url"
default = "https://github.com/aquaproj/aqua-registry"
description = "URL to fetch aqua registry from."

[asdf]
env = "MISE_ASDF"
type = "Bool"
Expand Down
Loading

0 comments on commit 0bcdf72

Please sign in to comment.