jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.13k stars 247 forks source link

uv backend fails when installed by mise #2518

Closed engeir closed 2 weeks ago

engeir commented 2 weeks ago

Describe the bug When using mise to install uv/uvx, I get an error when trying to further install via the pipx backend:

mise failed to execute command: uv tool install black==24.8.0
mise No such file or directory (os error 2)

Just like described here.

To Reproduce Install uv and for example black via mise:

# ~/.config/mise/config.toml
[env]
MISE_PIPX_UVX = 1
[tools]
uv = "latest"
"pipx:black" = "latest"

Installing uv manually and commenting out uv = "latest" will install black as expected.

NOTE: it seems the toml is also not correct as setting the env var to true causes a parsing error, but that is perhaps worth its own issue.

Expected behavior Both uv and black would be installed with no issue.

mise doctor output

version: 2024.8.14 linux-x64 (2ed1258 2024-08-27)
activated: yes
shims_on_path: no

build_info: 
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Tue, 27 Aug 2024 23:30:35 +0000
  Rust Version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)
  Profile: release

shell: 
  /bin/zsh
  zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

dirs: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.config/mise/config.toml

backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins: 
  cabal      https://github.com/sestrella/asdf-ghcup.git#a6407a2
  fd         https://gitlab.com/wt0f/asdf-fd.git#17d56e0
  fzf        https://github.com/kompiro/asdf-fzf.git#d19eb67
  jq         https://github.com/mise-plugins/asdf-jq.git#6d86d19
  neovim     https://github.com/richin13/asdf-neovim.git#d6118ad
  pandoc     https://github.com/Fbrisset/asdf-pandoc.git#3e93049
  poetry     https://github.com/rtx-plugins/rtx-poetry.git#431c335
  tinytex    https://github.com/Fbrisset/asdf-tinytex.git#fe6afd9
  usage      https://github.com/jdx/mise-usage.git#fe3888a
  uv         https://github.com/asdf-community/asdf-uv.git#f339c19
  watchexec  https://github.com/nyrst/asdf-watchexec.git#b667a08
  yarn       https://github.com/twuni/asdf-yarn.git#376c540

toolset: 
  cabal@3.12.1.0        
  pandoc@3.3            
  tinytex@2024.07.03    
  watchexec@2.1.2       
  go@1.23.0             
  node@22.7.0           
  usage@0.3.0           
  uv@0.3.5              
  npm:cwebp@3.1.0       
  ubi:Enter-tainer/typstyle@v0.11.32  
  ubi:Eoin-McMahon/blindfold@v1.0.6  
  ubi:Myriad-Dreamin/shiroa@v0.2.0-nightly4  
  ubi:ajeetdsouza/zoxide@v0.9.4  
  ubi:azzamsa/zman@v3.1.2  
  ubi:etcd-io/etcd@v3.5.15  
  ubi:filosottile/age@v1.2.0  
  ubi:goreleaser/goreleaser@v2.2.0  
  ubi:houseabsolute/precious@v0.7.3  
  ubi:ismaelgv/rnr@v0.4.2  
  ubi:junegunn/fzf@v0.54.3  
  ubi:mgdm/htmlq@v0.4.0  
  ubi:pvolok/mprocs@v0.7.1  
  ubi:pythops/bluetui@v0.5.1  
  ubi:sharkdp/bat@v0.24.0  
  ubi:typst/typst@v0.11.1  
  ubi:uutils/coreutils@0.0.27  
  ubi:quantumsheep/sshs@4.5.1  
  pipx:black@24.8.0     (missing)

env_vars: 
  MISE_SHELL=zsh
  MISE_PIPX_UVX=1

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = true
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gobin = true
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  pipx_uvx = true
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  vfox = false
  yes = true
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = true

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No warnings found
No problems found

Additional context Add any other context about the problem here. Consider running mise with --debug or --trace for extra debug info.

Output of mise i --debug:

[DEBUG] ARGS: mise i --debug
[DEBUG] Config {
    Config Files: [
        "~/.config/mise/config.toml",
    ],
}
[DEBUG] ToolRequestSet.build(683.626µs): ToolRequestSet: cabal@latest pandoc@latest tinytex@latest watchexec@latest go@latest node@latest usage@latest uv@latest npm:cwebp@latest ubi:Enter-tainer/typstyle@latest ubi:Eoin-McMahon/blindfold@latest ubi:Myriad-Dreamin/shiroa@latest ubi:ajeetdsouza/zoxide@latest ubi:azzamsa/zman@latest ubi:etcd-io/etcd@latest ubi:filosottile/age@latest ubi:goreleaser/goreleaser@latest ubi:houseabsolute/precious@latest ubi:ismaelgv/rnr@latest ubi:junegunn/fzf@latest ubi:mgdm/htmlq@latest ubi:pvolok/mprocs@latest ubi:pythops/bluetui@latest ubi:sharkdp/bat@latest ubi:typst/typst@latest ubi:uutils/coreutils@latest ubi:quantumsheep/sshs@latest pipx:black@latest

[DEBUG] install_versions: pipx:black@latest
[DEBUG] glob: "/home/een023/.config/mise/machine_specific.sh"
[DEBUG] $ /usr/bin/bash -c . /home/een023/.config/mise/machine_specific.sh
export -p

[DEBUG] $ uv tool install black==24.8.0
Error:
   0: failed to execute command: uv tool install black==24.8.0
   1: No such file or directory (os error 2)

Location:
   src/cmd.rs:253

Version:
   2024.8.14 linux-x64 (2ed1258 2024-08-27)

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
jdx commented 2 weeks ago

NOTE: it seems the toml is also not correct as setting the env var to true causes a parsing error, but that is perhaps worth its own issue.

you've used an integer for an env var but env vars are only ever strings. You also can't use env vars to set settings inside of mise.toml files I don't think. There isn't a need for that since you can use settings instead.

engeir commented 2 weeks ago

Okay, I see. However the bug I described does persist though, even if I use

# ~/.config/mise/config.toml
[settings]
pipx_uvx = true
experimental = true

[tools]
uv = "latest"

Now running mise use -g "pipx:black" results in the same execute command error as before.

M4RC3L05 commented 2 weeks ago

Same, here, if done with pipx all goes well, i download the pipx tool, and then the dependent tools (in my case pipx:sqlfluff/sqlfluff). But if i activate uvx pipx_uvx = true uv gets installed and tries to use pipx, if i retry the install it starts using uv tool but it errors out with No such file or directory (os error 2)

First run with uvx active:

[DEBUG] ARGS: mise install --verbose
[DEBUG] Config {
    Config Files: [
        "~/devs/music-follower/.mise.toml",
        "~/.config/mise/config.toml",
    ],
}
[DEBUG] ToolRequestSet.build(67.051µs): ToolRequestSet: usage@latest uv@latest sqlite@3.46.0 yamllint@latest deno@1.46 yamlfmt@latest pipx:sqlfluff/sqlfluff@latest

[DEBUG] install_versions: uv@latest pipx:sqlfluff/sqlfluff@latest
downloading
~/.local/share/mise/plugins/uv/bin/download
[DEBUG] $ ~/.local/share/mise/plugins/uv/bin/download 
[DEBUG] $ pipx install git+https://github.com/sqlfluff/sqlfluff.git@2.0.7
* Downloading uv release 0.3.5...
installing
~/.local/share/mise/plugins/uv/bin/install
[DEBUG] $ ~/.local/share/mise/plugins/uv/bin/install 
uv 0.3.5 installation was successful!
mise uv@0.3.5        ✓ installed
Error: 
   0: failed to execute command: pipx install git+https://github.com/sqlfluff/sqlfluff.git@2.0.7
   1: No such file or directory (os error 2)

Location:
   src/cmd.rs:253

Version:
   2024.8.14 linux-x64 (2ed1258 2024-08-27)

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

Second run with uvx active:

[DEBUG] ARGS: mise install --verbose
[DEBUG] Config {
    Config Files: [
        "~/devs/music-follower/.mise.toml",
        "~/.config/mise/config.toml",
    ],
}
[DEBUG] ToolRequestSet.build(60.75µs): ToolRequestSet: usage@latest uv@latest sqlite@3.46.0 yamllint@latest deno@1.46 yamlfmt@latest pipx:sqlfluff/sqlfluff@latest

[DEBUG] install_versions: uv@latest pipx:sqlfluff/sqlfluff@latest
[DEBUG] $ uv tool install git+https://github.com/sqlfluff/sqlfluff.git@2.0.7
Error: 
   0: failed to execute command: uv tool install git+https://github.com/sqlfluff/sqlfluff.git@2.0.7
   1: No such file or directory (os error 2)

Location:
   src/cmd.rs:253

Version:
   2024.8.14 linux-x64 (2ed1258 2024-08-27)

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

Also do not know if this is related with pipx/uvx, but i have sqlfluff tool @latest but is gets resolved to 2.2.0 which i think it is not correct, as the latest version is 3.1.1

jdx commented 2 weeks ago

because the patch has not yet been released

M4RC3L05 commented 2 weeks ago

Are you referring to https://github.com/jdx/mise/pull/2516? If so, does this also addresses the issue i am having with sqlfluff? or is this not related with mise?

jdx commented 2 weeks ago

no https://github.com/jdx/mise/commit/b608a736d94f3a97c4cd06226b194bef41b15d9d

I'm not sure why the version is out of date there