jdx / mise

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

Unable to install some software using Ubi backend #2931

Open rhysm94 opened 1 week ago

rhysm94 commented 1 week ago

Describe the bug I'm trying to install Sourcery using the Ubi backend instead of the asdf plugin, as this means pulling it directly from the source, avoiding potential supply chain attacks.

When attempting to install Sourcery at a specific version using mise use ubi:krzysztofzablocki/Sourcery@2.0.1, I then try to use Sourcery like so: mise x -- sourcery --version to check it's installed, and I get the error:

mise ERROR "sourcery" couldn't exec process: No such file or directory
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

To Reproduce

Run mise use ubi:krzysztofzablocki/Sourcery@2.0.1 in a project, and attempt to use any Sourcery commands.

Expected behavior I expected that using the Ubi tool, I would be able to install Sourcery locally, directly from the source repository instead of via an asdf plugin. I expected that I'd be able to run commands like mise x -- sourcery --version to get back 2.0.1 as the result after installing it.

mise doctor output

version: 2024.11.1 macos-arm64 (2024-11-05)
activated: no
shims_on_path: yes

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Tue, 5 Nov 2024 02:00:00 +0000
  Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (arm64-apple-darwin24.0)

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

config_files:
  ~/Developer/my-mise-plugins/.mise.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  tuist  https://github.com/asdf-community/asdf-tuist.git#44c87b2

toolset:
  ubi:krzysztofzablocki/Sourcery@2.0.1

env_vars:
  (none)

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cache_prune_age = "30d"
  ci = false
  color = true
  debug = false
  disable_backends = []
  disable_default_registry = false
  disable_hints = []
  disable_tools = []
  experimental = false
  fetch_remote_versions_cache = "1h"
  fetch_remote_versions_timeout = "10s"
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = "30s"
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  lockfile = false
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  pin = false
  plugin_autoupdate_last_check_duration = "7d"
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  yes = false

  [cargo]
  binstall = true

  [node]

  [pipx]
  uvx = false

  [python]
  default_packages_file = "~/.default-python-packages"
  pyenv_repo = "https://github.com/pyenv/pyenv.git"
  venv_auto_create = false
  venv_stdlib = false

  [ruby]
  default_packages_file = "~/.default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false
No warnings found
No problems found

Additional context I've also tried this with SwiftFormat and had the same result.

I've opened the ~/.local/share/mise/installs directory and found one called ubi-krzysztofzablocki-sourcery. This has one actual directory called 2.0.1 inside it, which contains a directory called bin which is completely empty. When using `mise use tuist@

This is the full output from running the initial command with MISE_VERBOSE=1:

rhysmorgan@Rhyss-MacBook-Pro my-mise-plugins % MISE_VERBOSE=1 mise use ubi:krzysztofzablocki/Sourcery@2.0.1
DEBUG ARGS: mise use ubi:krzysztofzablocki/Sourcery@2.0.1
DEBUG config: ~/Developer/my-mise-plugins/.mise.toml
DEBUG install_versions: ubi:krzysztofzablocki/Sourcery@2.0.1
DEBUG GET https://api.github.com/repos/krzysztofzablocki/Sourcery/releases
DEBUG starting new connection: https://api.github.com/
DEBUG GET https://api.github.com/repos/krzysztofzablocki/Sourcery/releases 200 OK
INFO  mise ubi:krzysztofzablocki/Sourcery@2.0.1 installing
DEBUG GET https://api.github.com/repos/krzysztofzablocki/Sourcery/releases/tags/2.0.1
DEBUG starting new connection: https://api.github.com/
DEBUG GET https://api.github.com/repos/krzysztofzablocki/Sourcery/releases/tags/2.0.1 200 OK
DEBUG Parsed --project krzysztofzablocki/Sourcery = krzysztofzablocki / Sourcery
DEBUG exe name = Sourcery
DEBUG install path = /Users/rhysmorgan/.local/share/mise/installs/ubi-krzysztofzablocki-sourcery/2.0.1/bin/Sourcery
DEBUG adding GitHub token to GitHub requests
DEBUG starting new connection: https://api.github.com/
DEBUG filtering out assets that do not have a valid extension
DEBUG there is only one asset to pick
DEBUG picked asset named Sourcery-2.0.1.zip
DEBUG downloading asset from https://api.github.com/repos/krzysztofzablocki/Sourcery/releases/assets/94488917
DEBUG starting new connection: https://api.github.com/
DEBUG redirecting 'https://api.github.com/repos/krzysztofzablocki/Sourcery/releases/assets/94488917' to 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/76171100/e4995693-1552-44fd-897c-4a4e70687e80?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241105%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241105T142909Z&X-Amz-Expires=300&X-Amz-Signature=009e858f7cae74ce80648c00324608925c0453ef2508cfc44ef9bb1f85b0a878&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3DSourcery-2.0.1.zip&response-content-type=application%2Foctet-stream'
DEBUG starting new connection: https://objects.githubusercontent.com/
DEBUG archive path is /var/folders/ss/42150kg562zfgvvj5p7zvclw0000gn/T/.tmpchdy9n/Sourcery-2.0.1.zip
DEBUG extracting binary from zip file
DEBUG could not find any entries named Sourcery
INFO  mise ubi:krzysztofzablocki/Sourcery@2.0.1 ✓ installed
mise ~/Developer/my-mise-plugins/.mise.toml tools: ubi:krzysztofzablocki/Sourcery@2.0.1
jdx commented 1 week ago

have you verified this isn't an issue with ubi?

rhysm94 commented 1 week ago

have you verified this isn't an issue with ubi?

Hey, thanks for replying! Sorry, I should have done, but I hadn't initially checked. I did look at it afterwards, and this ubi command seems to install things correctly.

./ubi --verbose -p krzysztofzablocki/Sourcery -t 2.0.1 -e sourcery

When I run ./sourcery --version I get back 2.0.1 as expected.

I've just updated my .mise.toml file to include this instead and things now seem to work:

"ubi:krzysztofzablocki/Sourcery" = { version = "2.0.1", exe = "sourcery" }

I'm not really sure what I've tried differently here, maybe I accidentally put quotes around things before? Either way, that seems to work! Sorry again!

Just for future reference, is there a way to define an exe name to look for with a mise use command?