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

Aliases in local .mise.toml not getting interpreted? #3324

Closed
egnor opened this issue Dec 2, 2024 · 2 comments · Fixed by #3395
Closed

Aliases in local .mise.toml not getting interpreted? #3324

egnor opened this issue Dec 2, 2024 · 2 comments · Fixed by #3395
Labels

Comments

@egnor
Copy link

egnor commented Dec 2, 2024

From #323 (comment)

% cat .mise.toml
[tools]
python = "3.10"
python_with_my_package = {version = "3.10", default_packages="pyserial"}

[alias]
python_with_my_package = "core:python"

% mise install
mise ERROR python_with_my_package not found in mise tool registry
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

% mise doctor
version: 2024.11.37 linux-x64 (7ac5ab3 2024-11-30)
activated: yes
shims_on_path: no

build_info:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Sat, 30 Nov 2024 01:03:00 +0000
  Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15)
  Profile: release

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

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

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

backends:
  aqua
  asdf
  cargo
  core
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  arduino-cli  https://github.com/egnor/asdf-arduino-cli.git#66bf3b6
  poetry       https://github.com/mise-plugins/mise-poetry.git#431c335
mise WARN  failed to resolve toolset: [~/misetest/.mise.toml] mypython@3.10: mypython not found in mise tool registry

toolset:
  core:node@22.4.0
  core:python@3.10.15

env_vars:
  MISE_SHELL=zsh

settings:
  python_compile  false ~/.config/mise/config.toml

No problems found
@egnor egnor added the bug label Dec 2, 2024
@syhol
Copy link
Contributor

syhol commented Dec 2, 2024

To narrow down the problem a bit

  • I've recreated it with node - to eliminate it from being python related
  • I've recreated it without tool options - to eliminate it from being tool options related
  • I've recreated it in mise.toml - to eliminate it from .mise.toml related
[tools]
node = "22"
asdfnode = "21"

[alias]
asdfnode = "asdf:asdf-vm/asdf-nodejs"

☝️ Works fine

[tools]
node = "22"
corenode = "21"

[alias]
corenode = "core:node"

☝️ Fails with the error you shared:

Code/sandbox/misehooksRUST_BACKTRACE=1 mise install --verbose
DEBUG ARGS: /Users/syhol/.local/bin/mise install --verbose
DEBUG config: ~/Code/sandbox/misehooks/mise.toml
DEBUG config: ~/.config/mise/config.toml
Error:
   0: corenode not found in mise tool registry

Location:
   src/cli/args/backend_arg.rs:102

Version:
   2024.11.36 macos-arm64 (0461143 2024-11-29)

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮
   4: <core::iter::adapters::GenericShunt<I,R> as core::iter::traits::iterator::Iterator>::next::he6b108251fb7032b
      at <unknown source file>:<unknown line>
   5: mise::toolset::get_leaf_dependencies::h33c218efee2eaeb7
      at <unknown source file>:<unknown line>
   6: mise::toolset::Toolset::install_all_versions::h16a9e1858e65109b
      at <unknown source file>:<unknown line>
   7: mise::cli::install::Install::run::h99c4860cffbcf266
      at <unknown source file>:<unknown line>
   8: mise::cli::Commands::run::h9a316d4675798204
      at <unknown source file>:<unknown line>
   9: mise::cli::Cli::run::haef65d2bd6297280
      at <unknown source file>:<unknown line>
  10: mise::main::hd38f6487b30d89e0
      at <unknown source file>:<unknown line>
  11: std::sys::backtrace::__rust_begin_short_backtrace::hd81f169989ba05d7
      at <unknown source file>:<unknown line>
  12: _main<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

So it seems like there's a problem using core backends in aliases.

@jdx
Copy link
Owner

jdx commented Dec 2, 2024

I thought we had a test for this but it's actually testing the inverse https://github.com/jdx/mise/blob/main/e2e/config/test_config_alias#L12

jdx added a commit that referenced this issue Dec 7, 2024
@jdx jdx closed this as completed in #3395 Dec 7, 2024
@jdx jdx closed this as completed in af1bee0 Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants