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

All backends should include their dependencies on PATH #2260

Open
bhollis opened this issue Jun 6, 2024 · 3 comments
Open

All backends should include their dependencies on PATH #2260

bhollis opened this issue Jun 6, 2024 · 3 comments

Comments

@bhollis
Copy link

bhollis commented Jun 6, 2024

The Go backend includes dependency_env, which means that it should include any version of Go that's managed by mise on PATH when it runs commands: https://github.com/jdx/mise/blob/main/src/backend/go.rs#L77

Other backends don't do this. e.g. npm: https://github.com/jdx/mise/blob/main/src/backend/npm.rs#L71-L72. This means that the npm backend can't install unless npm is already on PATH.

All of the backends already declare dependencies (e.g. https://github.com/jdx/mise/blob/main/src/backend/pipx.rs#L33-L35) in order to install them before running the backend, so it makes sense that they should all make use of them while running the backend.

@jdx
Copy link
Owner

jdx commented Jun 8, 2024

mise does do this, but experimental backends are still a work in progress so there are gaps

@liskin
Copy link

liskin commented Sep 15, 2024

I believe these two fixes merged recently are related to the issue:

Unfortunately, mise still won't install cargo-binstall in time for it to be used for cargo:… tools because it's not declared as a dependency in

fn get_dependencies(&self, _tvr: &ToolRequest) -> eyre::Result<Vec<BackendArg>> {
Ok(vec!["cargo".into(), "rust".into()])
}

@liskin
Copy link

liskin commented Sep 15, 2024

Actually, doesn't seem to work for pipx/uv either, despite the dependencies being declared

mise/src/backend/pipx.rs

Lines 33 to 35 in bc4fae3

fn get_dependencies(&self, _tvr: &ToolRequest) -> eyre::Result<Vec<BackendArg>> {
Ok(vec!["pipx".into(), "uv".into()])
}

$ mise uninstall pipx:timezonefinder
$ mise uninstall ubi:astral-sh/uv
$ MISE_VERBOSE=1 mise install
[DEBUG] ARGS: mise install
[DEBUG] Config {
    Config Files: [
        "~/.mise.toml",
        "~/.config/mise/config.toml",
    ],
}
[DEBUG] ToolRequestSet.build(132.668µs): ToolRequestSet: cargo:ast-grep@0.27.1 cargo:cargo-audit@0.20.1 cargo:cargo-cache@0.8.3 cargo:cargo-edit@0.12.3 cargo:cargo-watch@8.5.2 cargo:ripgrep_all@0.10.6 cargo:tokio-console@0.1.12 cargo:watchexec-cli@2.1.2 ubi:YodaEmbedding/frece@v1.0.6 ubi:cargo-bins/cargo-binstall@v1.10.5 usage@0.3.1 ubi:astral-sh/uv@0.4.10 pipx:timezonefinder@6.5.2

[DEBUG] install_versions: ubi:astral-sh/uv@0.4.10 pipx:timezonefinder@6.5.2
[DEBUG] $ ubi --in /home/tomi/.local/share/mise/installs/ubi-astral-sh-uv/0.4.10/bin --project astral-sh/uv --tag 0.4.10
[DEBUG] $ uv tool install timezonefinder==6.5.2
mise ubi:astral-sh/uv@0.4.10 ✓ installed
Error: 
   0: failed to execute command: uv tool install timezonefinder==6.5.2
   1: No such file or directory (os error 2)

Location:
   src/cmd.rs:253

Version:
   2024.9.3 linux-x64 (e0d1317 2024-09-12)

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

I had to manually mise reshim and invoke mise install for the second time for it to pick up uv.

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