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

shim hangs if npm backend tools are missing and node is managed by mise #2682

Closed
risu729 opened this issue Sep 29, 2024 · 11 comments · Fixed by #2736 or #2745
Closed

shim hangs if npm backend tools are missing and node is managed by mise #2682

risu729 opened this issue Sep 29, 2024 · 11 comments · Fixed by #2736 or #2745
Labels

Comments

@risu729
Copy link
Contributor

risu729 commented Sep 29, 2024

Describe the bug
shim, for example, node --version, hangs if npm backend tools in mise.toml are missing and node is managed by mise.
This issue only occurs while using shims, in my case, GitHub Actions.

The shim command hangs because an infinite loop is caused while resolving the shims. It continues until the memory is run out.
Sometimes, rayon errors like this are also printed repeatedly because of the infinite loop.

The application panicked (crashed).
Message:  The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
Location: /cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.1/src/registry.rs:168
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Looking through the trace, the infinite loop is caused by this npm view call.

mise/src/backend/npm.rs

Lines 34 to 42 in 663170b

fn _list_remote_versions(&self) -> eyre::Result<Vec<String>> {
self.remote_version_cache
.get_or_try_init(|| {
let raw = cmd!("npm", "view", self.name(), "versions", "--json").read()?;
let versions: Vec<String> = serde_json::from_str(&raw)?;
Ok(versions)
})
.cloned()
}

While building the Toolset to handle the shim, remote versions are listed if the tools are not installed. This behavior cannot be avoided with any environment variables or settings.

mise/src/shims.rs

Lines 46 to 50 in 663170b

fn which_shim(bin_name: &str) -> Result<PathBuf> {
let config = Config::try_get()?;
let mut ts = ToolsetBuilder::new().build(&config)?;
if let Some((p, tv)) = ts.which(bin_name) {
if let Some(bin) = p.which(&tv, bin_name)? {

Full trace

mise/src/shims.rs

Lines 23 to 33 in 663170b

pub fn handle_shim() -> Result<()> {
// TODO: instead, check if bin is in shims dir
let bin_name = *env::MISE_BIN_NAME;
if regex!(r"^(mise|rtx)(\-.*)?(\.exe)?$").is_match(bin_name) || cfg!(test) {
return Ok(());
}
logger::init();
let args = env::ARGS.read().unwrap();
trace!("shim[{bin_name}] args: {}", args.join(" "));
let mut args: Vec<OsString> = args.iter().map(OsString::from).collect();
args[0] = which_shim(&env::MISE_BIN_NAME)?.into();

mise/src/shims.rs

Lines 46 to 48 in 663170b

fn which_shim(bin_name: &str) -> Result<PathBuf> {
let config = Config::try_get()?;
let mut ts = ToolsetBuilder::new().build(&config)?;

pub fn build(self, config: &Config) -> Result<Toolset> {
let mut toolset = Toolset {
..Default::default()
};
self.load_config_files(config, &mut toolset)?;
self.load_runtime_env(&mut toolset, env::vars().collect())?;
self.load_runtime_args(&mut toolset)?;
let start_ms = std::time::Instant::now();
if let Err(err) = toolset.resolve() {

mise/src/toolset/mod.rs

Lines 102 to 109 in 663170b

pub fn resolve(&mut self) -> eyre::Result<()> {
self.list_missing_plugins();
let errors = self
.versions
.iter_mut()
.collect::<Vec<_>>()
.par_iter_mut()
.map(|(_, v)| v.resolve(false))

pub fn resolve(&mut self, latest_versions: bool) -> eyre::Result<()> {
self.versions.clear();
let plugin = backend::get(&self.backend);
for tvr in &mut self.requests {
match tvr.resolve(plugin.as_ref(), latest_versions) {

pub fn resolve(&self, plugin: &dyn Backend, latest_versions: bool) -> Result<ToolVersion> {
ToolVersion::resolve(plugin, self.clone(), latest_versions)

pub fn resolve(
backend: &dyn Backend,
request: ToolRequest,
latest_versions: bool,
) -> Result<Self> {
if let Some(plugin) = backend.plugin() {
if !plugin.is_installed() {
let tv = Self::new(backend, request.clone(), request.version());
return Ok(tv);
}
}
let tv = match request.clone() {
ToolRequest::Version { version: v, .. } => {
Self::resolve_version(backend, request, latest_versions, &v)?

fn resolve_version(
backend: &dyn Backend,
request: ToolRequest,
latest_versions: bool,
v: &str,
) -> Result<ToolVersion> {
let config = Config::get();
let v = config.resolve_alias(backend, v)?;
match v.split_once(':') {
Some((ref_type @ ("ref" | "tag" | "branch" | "rev"), r)) => {
return Ok(Self::resolve_ref(
backend,
r.to_string(),
ref_type.to_string(),
request.options(),
));
}
Some(("path", p)) => {
return Self::resolve_path(backend, PathBuf::from(p));
}
Some(("prefix", p)) => {
return Self::resolve_prefix(backend, request, p);
}
Some((part, v)) if part.starts_with("sub-") => {
let sub = part.split_once('-').unwrap().1;
return Self::resolve_sub(backend, request, latest_versions, sub, v);
}
_ => (),
}
let build = |v| Ok(Self::new(backend, request.clone(), v));
if let Some(plugin) = backend.plugin() {
if !plugin.is_installed() {
return build(v);
}
}
let existing = build(v.clone())?;
if backend.is_version_installed(&existing, true) {
// if the version is already installed, no need to fetch all the remote versions
return Ok(existing);
}
if v == "latest" {
if !latest_versions {
if let Some(v) = backend.latest_installed_version(None)? {
return build(v);
}
}
if let Some(v) = backend.latest_version(None)? {
return build(v);
}
}
if !latest_versions {
let matches = backend.list_installed_versions_matching(&v)?;
if matches.contains(&v) {
return build(v);
}
if let Some(v) = matches.last() {
return build(v.clone());
}
}
let matches = backend.list_versions_matching(&v)?;

mise/src/backend/mod.rs

Lines 279 to 280 in 663170b

fn list_versions_matching(&self, query: &str) -> eyre::Result<Vec<String>> {
let versions = self.list_remote_versions()?;

mise/src/backend/mod.rs

Lines 189 to 193 in 663170b

fn list_remote_versions(&self) -> eyre::Result<Vec<String>> {
self.ensure_dependencies_installed()?;
trace!("Listing remote versions for {}", self.fa().to_string());
let versions = self
._list_remote_versions()?

mise/src/backend/npm.rs

Lines 34 to 42 in 663170b

fn _list_remote_versions(&self) -> eyre::Result<Vec<String>> {
self.remote_version_cache
.get_or_try_init(|| {
let raw = cmd!("npm", "view", self.name(), "versions", "--json").read()?;
let versions: Vec<String> = serde_json::from_str(&raw)?;
Ok(versions)
})
.cloned()
}

For now, I could only resolve this issue by installing all the missing tools. Also, some other commands like mise doctor also hang because of the same cause.
Excluding node from mise avoids the recursive call of mise shims, but I want to manage it with mise.

To Reproduce

  1. Set up mise with shims.
  2. Specify npm backend tools and node in mise.toml.
[tools]
node = "22.9.0"
"npm:@biomejs/biome" = "1.9.2"
  1. Run mise install node.
  2. node --version hangs because npm:@biomejs/biome is missing.

Expected behavior
node --version exits successfully.

mise doctor output

toolset:
  [email protected]  (missing)

env_vars:
  MISE_LOG_LEVEL=trace
  MISE_YES=1
  MISE_TRUSTED_CONFIG_PATHS=~/work/mise-inf-loop-repro/mise-inf-loop-repro

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cache_prune_age = "30d"
  cargo_binstall = true
  ci = true
  color = true
  debug = true
  disable_default_shorthands = false
  disable_hints = []
  disable_tools = []
  experimental = false
  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 = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  log_level = "trace"
  not_found_auto_install = true
  paranoid = false
  pipx_uvx = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  python_venv_auto_create = false
  quiet = false
  raw = false
  trace = true
  trusted_config_paths = ["~/work/mise-inf-loop-repro/mise-inf-loop-repro"]
  use_versions_host = true
  verbose = true
  vfox = false
  yes = true

  [node]

  [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

Additional context
Minimal reproduction: https://github.com/risu729/mise-inf-loop-repro
GitHub Actions workflows logs: https://github.com/risu729/mise-inf-loop-repro/actions/runs/11089131905/job/30809864689

Logs of `node --version` with `MISE_LOG_LEVEL=trace`
2024-09-29T02:58:44.3557968Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[node] args: node --version
2024-09-29T02:58:44.3559195Z [TRACE] (1) mise::config: [src/config/mod.rs:70] Settings: Settings {
2024-09-29T02:58:44.3560120Z     activate_aggressive: false,
2024-09-29T02:58:44.3560744Z     all_compile: false,
2024-09-29T02:58:44.3561381Z     always_keep_download: false,
2024-09-29T02:58:44.3562010Z     always_keep_install: false,
2024-09-29T02:58:44.3562628Z     asdf: true,
2024-09-29T02:58:44.3563153Z     asdf_compat: false,
2024-09-29T02:58:44.3563820Z     cache_prune_age: "30d",
2024-09-29T02:58:44.3564470Z     cargo_binstall: true,
2024-09-29T02:58:44.3565043Z     cd: None,
2024-09-29T02:58:44.3565546Z     ci: true,
2024-09-29T02:58:44.3566089Z     color: true,
2024-09-29T02:58:44.3566616Z     debug: true,
2024-09-29T02:58:44.3567383Z     disable_default_shorthands: false,
2024-09-29T02:58:44.3568097Z     disable_hints: {},
2024-09-29T02:58:44.3568654Z     disable_tools: {},
2024-09-29T02:58:44.3569214Z     env_file: None,
2024-09-29T02:58:44.3569761Z     experimental: false,
2024-09-29T02:58:44.3570586Z     go_default_packages_file: "~/.default-go-packages",
2024-09-29T02:58:44.3571827Z     go_download_mirror: "https://dl.google.com/go",
2024-09-29T02:58:44.3572689Z     go_repo: "https://github.com/golang/go",
2024-09-29T02:58:44.3573451Z     go_set_gobin: None,
2024-09-29T02:58:44.3574014Z     go_set_gopath: false,
2024-09-29T02:58:44.3574653Z     go_set_goroot: true,
2024-09-29T02:58:44.3575264Z     go_skip_checksum: false,
2024-09-29T02:58:44.3575844Z     http_timeout: 30,
2024-09-29T02:58:44.3576376Z     jobs: 4,
2024-09-29T02:58:44.3577088Z     legacy_version_file: true,
2024-09-29T02:58:44.3577766Z     legacy_version_file_disable_tools: {},
2024-09-29T02:58:44.3578522Z     libgit2: true,
2024-09-29T02:58:44.3579103Z     log_level: "trace",
2024-09-29T02:58:44.3579673Z     node: SettingsNode {
2024-09-29T02:58:44.3580276Z         compile: None,
2024-09-29T02:58:44.3580856Z         flavor: None,
2024-09-29T02:58:44.3581320Z         mirror_url: None,
2024-09-29T02:58:44.3581925Z     },
2024-09-29T02:58:44.3582427Z     not_found_auto_install: true,
2024-09-29T02:58:44.3583035Z     paranoid: false,
2024-09-29T02:58:44.3583527Z     pipx_uvx: false,
2024-09-29T02:58:44.3584076Z     plugin_autoupdate_last_check_duration: "7d",
2024-09-29T02:58:44.3584507Z     python_compile: None,
2024-09-29T02:58:44.3584970Z     python_default_packages_file: Some(
2024-09-29T02:58:44.3585532Z         "/home/runner/.default-python-packages",
2024-09-29T02:58:44.3585929Z     ),
2024-09-29T02:58:44.3586294Z     python_patch_url: None,
2024-09-29T02:58:44.3586674Z     python_patches_directory: None,
2024-09-29T02:58:44.3587613Z     python_precompiled_arch: None,
2024-09-29T02:58:44.3588126Z     python_precompiled_os: None,
2024-09-29T02:58:44.3588630Z     python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
2024-09-29T02:58:44.3589109Z     python_venv_auto_create: false,
2024-09-29T02:58:44.3589562Z     quiet: false,
2024-09-29T02:58:44.3589881Z     raw: false,
2024-09-29T02:58:44.3590173Z     ruby: SettingsRuby {
2024-09-29T02:58:44.3590599Z         apply_patches: None,
2024-09-29T02:58:44.3591090Z         default_packages_file: "~/.default-gems",
2024-09-29T02:58:44.3591515Z         ruby_build_opts: None,
2024-09-29T02:58:44.3592112Z         ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
2024-09-29T02:58:44.3592623Z         ruby_install: false,
2024-09-29T02:58:44.3592972Z         ruby_install_opts: None,
2024-09-29T02:58:44.3593801Z         ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
2024-09-29T02:58:44.3594410Z         verbose_install: None,
2024-09-29T02:58:44.3594777Z     },
2024-09-29T02:58:44.3595096Z     shorthands_file: None,
2024-09-29T02:58:44.3595484Z     status: SettingsStatus {
2024-09-29T02:58:44.3595910Z         missing_tools: "if_other_versions_installed",
2024-09-29T02:58:44.3596364Z         show_env: false,
2024-09-29T02:58:44.3596725Z         show_tools: false,
2024-09-29T02:58:44.3597333Z     },
2024-09-29T02:58:44.3597662Z     task_output: None,
2024-09-29T02:58:44.3598024Z     trace: true,
2024-09-29T02:58:44.3598409Z     trusted_config_paths: {
2024-09-29T02:58:44.3599009Z         "/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro",
2024-09-29T02:58:44.3599510Z     },
2024-09-29T02:58:44.3599804Z     use_versions_host: true,
2024-09-29T02:58:44.3600206Z     verbose: true,
2024-09-29T02:58:44.3600528Z     vfox: false,
2024-09-29T02:58:44.3600836Z     yes: true,
2024-09-29T02:58:44.3601163Z }
2024-09-29T02:58:44.3601707Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/node/.mise.backend.json
2024-09-29T02:58:44.3602589Z [TRACE] (1) mise::file: [src/file.rs:168] mkdir -p ~/.local/share/mise/.fake-asdf
2024-09-29T02:58:44.3603408Z [TRACE] (1) mise::file: [src/file.rs:143] write ~/.local/share/mise/.fake-asdf/asdf
2024-09-29T02:58:44.3604485Z [TRACE] (1) mise::config: [src/config/mod.rs:82] load: config_paths: ["/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml"]
2024-09-29T02:58:44.3605618Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3607264Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:90] parsing: ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3608464Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3609368Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:102] [tools]
2024-09-29T02:58:44.3610058Z node = "22.9.0"
2024-09-29T02:58:44.3610356Z "npm:@biomejs/biome" = "1.9.2"
2024-09-29T02:58:44.3610634Z 
2024-09-29T02:58:44.3610829Z [DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
2024-09-29T02:58:44.3611344Z     Config Files: [
2024-09-29T02:58:44.3611805Z         "~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml",
2024-09-29T02:58:44.3612311Z     ],
2024-09-29T02:58:44.3612639Z }
2024-09-29T02:58:44.3613185Z [TRACE] (4) mise::backend: [src/backend/mod.rs:326] Ensuring dependencies installed for npm:@biomejs/biome
2024-09-29T02:58:44.3614534Z [DEBUG] (4) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(40.845µs): ToolRequestSet: [email protected] npm:@biomejs/[email protected]
2024-09-29T02:58:44.3615396Z 
2024-09-29T02:58:44.3616010Z [TRACE] (4) mise::backend: [src/backend/mod.rs:192] Listing remote versions for npm:@biomejs/biome
2024-09-29T02:58:44.3617709Z [DEBUG] (4) mise::cmd: [src/cmd.rs:91] $ npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3619350Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3620579Z [TRACE] (1) mise::config: [src/config/mod.rs:70] Settings: Settings {
2024-09-29T02:58:44.3621478Z     activate_aggressive: false,
2024-09-29T02:58:44.3622186Z     all_compile: false,
2024-09-29T02:58:44.3622710Z     always_keep_download: false,
2024-09-29T02:58:44.3623359Z     always_keep_install: false,
2024-09-29T02:58:44.3624047Z     asdf: true,
2024-09-29T02:58:44.3624546Z     asdf_compat: false,
2024-09-29T02:58:44.3625107Z     cache_prune_age: "30d",
2024-09-29T02:58:44.3625559Z     cargo_binstall: true,
2024-09-29T02:58:44.3625890Z     cd: None,
2024-09-29T02:58:44.3626195Z     ci: true,
2024-09-29T02:58:44.3626546Z     color: true,
2024-09-29T02:58:44.3627108Z     debug: true,
2024-09-29T02:58:44.3627675Z     disable_default_shorthands: false,
2024-09-29T02:58:44.3628666Z     disable_hints: {},
2024-09-29T02:58:44.3629187Z     disable_tools: {},
2024-09-29T02:58:44.3629831Z     env_file: None,
2024-09-29T02:58:44.3630407Z     experimental: false,
2024-09-29T02:58:44.3631156Z     go_default_packages_file: "~/.default-go-packages",
2024-09-29T02:58:44.3632073Z     go_download_mirror: "https://dl.google.com/go",
2024-09-29T02:58:44.3632923Z     go_repo: "https://github.com/golang/go",
2024-09-29T02:58:44.3633623Z     go_set_gobin: None,
2024-09-29T02:58:44.3634309Z     go_set_gopath: false,
2024-09-29T02:58:44.3634930Z     go_set_goroot: true,
2024-09-29T02:58:44.3635458Z     go_skip_checksum: false,
2024-09-29T02:58:44.3636135Z     http_timeout: 30,
2024-09-29T02:58:44.3636685Z     jobs: 4,
2024-09-29T02:58:44.3637486Z     legacy_version_file: true,
2024-09-29T02:58:44.3638288Z     legacy_version_file_disable_tools: {},
2024-09-29T02:58:44.3638999Z     libgit2: true,
2024-09-29T02:58:44.3639466Z     log_level: "trace",
2024-09-29T02:58:44.3640118Z     node: SettingsNode {
2024-09-29T02:58:44.3640644Z         compile: None,
2024-09-29T02:58:44.3641177Z         flavor: None,
2024-09-29T02:58:44.3641802Z         mirror_url: None,
2024-09-29T02:58:44.3642313Z     },
2024-09-29T02:58:44.3642776Z     not_found_auto_install: true,
2024-09-29T02:58:44.3643255Z     paranoid: false,
2024-09-29T02:58:44.3643564Z     pipx_uvx: false,
2024-09-29T02:58:44.3643944Z     plugin_autoupdate_last_check_duration: "7d",
2024-09-29T02:58:44.3644454Z     python_compile: None,
2024-09-29T02:58:44.3644799Z     python_default_packages_file: Some(
2024-09-29T02:58:44.3645339Z         "/home/runner/.default-python-packages",
2024-09-29T02:58:44.3646084Z     ),
2024-09-29T02:58:44.3646351Z     python_patch_url: None,
2024-09-29T02:58:44.3646928Z     python_patches_directory: None,
2024-09-29T02:58:44.3647464Z     python_precompiled_arch: None,
2024-09-29T02:58:44.3647849Z     python_precompiled_os: None,
2024-09-29T02:58:44.3648353Z     python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
2024-09-29T02:58:44.3648915Z     python_venv_auto_create: false,
2024-09-29T02:58:44.3649267Z     quiet: false,
2024-09-29T02:58:44.3649600Z     raw: false,
2024-09-29T02:58:44.3649982Z     ruby: SettingsRuby {
2024-09-29T02:58:44.3650307Z         apply_patches: None,
2024-09-29T02:58:44.3650801Z         default_packages_file: "~/.default-gems",
2024-09-29T02:58:44.3651300Z         ruby_build_opts: None,
2024-09-29T02:58:44.3651823Z         ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
2024-09-29T02:58:44.3652335Z         ruby_install: false,
2024-09-29T02:58:44.3652755Z         ruby_install_opts: None,
2024-09-29T02:58:44.3653325Z         ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
2024-09-29T02:58:44.3653870Z         verbose_install: None,
2024-09-29T02:58:44.3654278Z     },
2024-09-29T02:58:44.3654559Z     shorthands_file: None,
2024-09-29T02:58:44.3654923Z     status: SettingsStatus {
2024-09-29T02:58:44.3655389Z         missing_tools: "if_other_versions_installed",
2024-09-29T02:58:44.3655823Z         show_env: false,
2024-09-29T02:58:44.3656171Z         show_tools: false,
2024-09-29T02:58:44.3656566Z     },
2024-09-29T02:58:44.3657044Z     task_output: None,
2024-09-29T02:58:44.3657416Z     trace: true,
2024-09-29T02:58:44.3657825Z     trusted_config_paths: {
2024-09-29T02:58:44.3658351Z         "/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro",
2024-09-29T02:58:44.3658848Z     },
2024-09-29T02:58:44.3659213Z     use_versions_host: true,
2024-09-29T02:58:44.3659535Z     verbose: true,
2024-09-29T02:58:44.3659851Z     vfox: false,
2024-09-29T02:58:44.3660225Z     yes: true,
2024-09-29T02:58:44.3660498Z }
2024-09-29T02:58:44.3661056Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/node/.mise.backend.json
2024-09-29T02:58:44.3662276Z [TRACE] (1) mise::config: [src/config/mod.rs:82] load: config_paths: ["/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml"]
2024-09-29T02:58:44.3663617Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3664836Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:90] parsing: ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3666079Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3667220Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:102] [tools]
2024-09-29T02:58:44.3667837Z node = "22.9.0"
2024-09-29T02:58:44.3668235Z "npm:@biomejs/biome" = "1.9.2"
2024-09-29T02:58:44.3668473Z 
2024-09-29T02:58:44.3668711Z [DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
2024-09-29T02:58:44.3669195Z     Config Files: [
2024-09-29T02:58:44.3669721Z         "~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml",
2024-09-29T02:58:44.3670236Z     ],
2024-09-29T02:58:44.3670518Z }
2024-09-29T02:58:44.3671529Z [TRACE] (3) mise::backend: [src/backend/mod.rs:326] Ensuring dependencies installed for npm:@biomejs/biome
2024-09-29T02:58:44.3674710Z [DEBUG] (3) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(40.385µs): ToolRequestSet: [email protected] npm:@biomejs/[email protected]
2024-09-29T02:58:44.3676052Z 
2024-09-29T02:58:44.3676947Z [TRACE] (3) mise::backend: [src/backend/mod.rs:192] Listing remote versions for npm:@biomejs/biome
2024-09-29T02:58:44.3678553Z [DEBUG] (3) mise::cmd: [src/cmd.rs:91] $ npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3680090Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3681657Z [TRACE] (1) mise::config: [src/config/mod.rs:70] Settings: Settings {
2024-09-29T02:58:44.3682643Z     activate_aggressive: false,
2024-09-29T02:58:44.3683274Z     all_compile: false,
2024-09-29T02:58:44.3683921Z     always_keep_download: false,
2024-09-29T02:58:44.3684664Z     always_keep_install: false,
2024-09-29T02:58:44.3685223Z     asdf: true,
2024-09-29T02:58:44.3685773Z     asdf_compat: false,
2024-09-29T02:58:44.3686409Z     cache_prune_age: "30d",
2024-09-29T02:58:44.3687253Z     cargo_binstall: true,
2024-09-29T02:58:44.3687846Z     cd: None,
2024-09-29T02:58:44.3688408Z     ci: true,
2024-09-29T02:58:44.3688894Z     color: true,
2024-09-29T02:58:44.3689456Z     debug: true,
2024-09-29T02:58:44.3690153Z     disable_default_shorthands: false,
2024-09-29T02:58:44.3690805Z     disable_hints: {},
2024-09-29T02:58:44.3691491Z     disable_tools: {},
2024-09-29T02:58:44.3692060Z     env_file: None,
2024-09-29T02:58:44.3692765Z     experimental: false,
2024-09-29T02:58:44.3693663Z     go_default_packages_file: "~/.default-go-packages",
2024-09-29T02:58:44.3694529Z     go_download_mirror: "https://dl.google.com/go",
2024-09-29T02:58:44.3695304Z     go_repo: "https://github.com/golang/go",
2024-09-29T02:58:44.3696074Z     go_set_gobin: None,
2024-09-29T02:58:44.3696634Z     go_set_gopath: false,
2024-09-29T02:58:44.3697341Z     go_set_goroot: true,
2024-09-29T02:58:44.3697990Z     go_skip_checksum: false,
2024-09-29T02:58:44.3698578Z     http_timeout: 30,
2024-09-29T02:58:44.3698995Z     jobs: 4,
2024-09-29T02:58:44.3699552Z     legacy_version_file: true,
2024-09-29T02:58:44.3699996Z     legacy_version_file_disable_tools: {},
2024-09-29T02:58:44.3700381Z     libgit2: true,
2024-09-29T02:58:44.3700759Z     log_level: "trace",
2024-09-29T02:58:44.3701128Z     node: SettingsNode {
2024-09-29T02:58:44.3701445Z         compile: None,
2024-09-29T02:58:44.3701842Z         flavor: None,
2024-09-29T02:58:44.3702197Z         mirror_url: None,
2024-09-29T02:58:44.3702507Z     },
2024-09-29T02:58:44.3702859Z     not_found_auto_install: true,
2024-09-29T02:58:44.3703261Z     paranoid: false,
2024-09-29T02:58:44.3703563Z     pipx_uvx: false,
2024-09-29T02:58:44.3704010Z     plugin_autoupdate_last_check_duration: "7d",
2024-09-29T02:58:44.3704481Z     python_compile: None,
2024-09-29T02:58:44.3704825Z     python_default_packages_file: Some(
2024-09-29T02:58:44.3705579Z         "/home/runner/.default-python-packages",
2024-09-29T02:58:44.3706029Z     ),
2024-09-29T02:58:44.3706299Z     python_patch_url: None,
2024-09-29T02:58:44.3706936Z     python_patches_directory: None,
2024-09-29T02:58:44.3707403Z     python_precompiled_arch: None,
2024-09-29T02:58:44.3707789Z     python_precompiled_os: None,
2024-09-29T02:58:44.3708383Z     python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
2024-09-29T02:58:44.3708903Z     python_venv_auto_create: false,
2024-09-29T02:58:44.3709260Z     quiet: false,
2024-09-29T02:58:44.3709654Z     raw: false,
2024-09-29T02:58:44.3709981Z     ruby: SettingsRuby {
2024-09-29T02:58:44.3710313Z         apply_patches: None,
2024-09-29T02:58:44.3710858Z         default_packages_file: "~/.default-gems",
2024-09-29T02:58:44.3711309Z         ruby_build_opts: None,
2024-09-29T02:58:44.3711829Z         ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
2024-09-29T02:58:44.3712391Z         ruby_install: false,
2024-09-29T02:58:44.3712769Z         ruby_install_opts: None,
2024-09-29T02:58:44.3713336Z         ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
2024-09-29T02:58:44.3713934Z         verbose_install: None,
2024-09-29T02:58:44.3714292Z     },
2024-09-29T02:58:44.3714572Z     shorthands_file: None,
2024-09-29T02:58:44.3714992Z     status: SettingsStatus {
2024-09-29T02:58:44.3715564Z         missing_tools: "if_other_versions_installed",
2024-09-29T02:58:44.3715994Z         show_env: false,
2024-09-29T02:58:44.3716390Z         show_tools: false,
2024-09-29T02:58:44.3717099Z     },
2024-09-29T02:58:44.3717382Z     task_output: None,
2024-09-29T02:58:44.3717955Z     trace: true,
2024-09-29T02:58:44.3718314Z     trusted_config_paths: {
2024-09-29T02:58:44.3718846Z         "/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro",
2024-09-29T02:58:44.3719402Z     },
2024-09-29T02:58:44.3719720Z     use_versions_host: true,
2024-09-29T02:58:44.3720049Z     verbose: true,
2024-09-29T02:58:44.3720418Z     vfox: false,
2024-09-29T02:58:44.3720756Z     yes: true,
2024-09-29T02:58:44.3721021Z }
2024-09-29T02:58:44.3721619Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/node/.mise.backend.json
2024-09-29T02:58:44.3722794Z [TRACE] (1) mise::config: [src/config/mod.rs:82] load: config_paths: ["/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml"]
2024-09-29T02:58:44.3723877Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3725165Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:90] parsing: ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3726347Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3727405Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:102] [tools]
2024-09-29T02:58:44.3728065Z node = "22.9.0"
2024-09-29T02:58:44.3728404Z "npm:@biomejs/biome" = "1.9.2"
2024-09-29T02:58:44.3728631Z 
2024-09-29T02:58:44.3728863Z [DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
2024-09-29T02:58:44.3729354Z     Config Files: [
2024-09-29T02:58:44.3729855Z         "~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml",
2024-09-29T02:58:44.3730359Z     ],
2024-09-29T02:58:44.3730648Z }
2024-09-29T02:58:44.3731218Z [TRACE] (3) mise::backend: [src/backend/mod.rs:326] Ensuring dependencies installed for npm:@biomejs/biome
2024-09-29T02:58:44.3733183Z [DEBUG] (3) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(32.48µs): ToolRequestSet: [email protected] npm:@biomejs/[email protected]
2024-09-29T02:58:44.3734600Z 
2024-09-29T02:58:44.3735295Z [TRACE] (3) mise::backend: [src/backend/mod.rs:192] Listing remote versions for npm:@biomejs/biome
2024-09-29T02:58:44.3736632Z [DEBUG] (3) mise::cmd: [src/cmd.rs:91] $ npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3737976Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3739136Z [TRACE] (1) mise::config: [src/config/mod.rs:70] Settings: Settings {
2024-09-29T02:58:44.3740053Z     activate_aggressive: false,
2024-09-29T02:58:44.3740415Z     all_compile: false,
2024-09-29T02:58:44.3740841Z     always_keep_download: false,
2024-09-29T02:58:44.3741249Z     always_keep_install: false,
2024-09-29T02:58:44.3741828Z     asdf: true,
2024-09-29T02:58:44.3742341Z     asdf_compat: false,
2024-09-29T02:58:44.3742924Z     cache_prune_age: "30d",
2024-09-29T02:58:44.3743526Z     cargo_binstall: true,
2024-09-29T02:58:44.3744088Z     cd: None,
2024-09-29T02:58:44.3744581Z     ci: true,
2024-09-29T02:58:44.3745073Z     color: true,
2024-09-29T02:58:44.3745565Z     debug: true,
2024-09-29T02:58:44.3746173Z     disable_default_shorthands: false,
2024-09-29T02:58:44.3747097Z     disable_hints: {},
2024-09-29T02:58:44.3747625Z     disable_tools: {},
2024-09-29T02:58:44.3747962Z     env_file: None,
2024-09-29T02:58:44.3748328Z     experimental: false,
2024-09-29T02:58:44.3748856Z     go_default_packages_file: "~/.default-go-packages",
2024-09-29T02:58:44.3749399Z     go_download_mirror: "https://dl.google.com/go",
2024-09-29T02:58:44.3749910Z     go_repo: "https://github.com/golang/go",
2024-09-29T02:58:44.3750557Z     go_set_gobin: None,
2024-09-29T02:58:44.3751136Z     go_set_gopath: false,
2024-09-29T02:58:44.3751747Z     go_set_goroot: true,
2024-09-29T02:58:44.3752357Z     go_skip_checksum: false,
2024-09-29T02:58:44.3752937Z     http_timeout: 30,
2024-09-29T02:58:44.3753481Z     jobs: 4,
2024-09-29T02:58:44.3754014Z     legacy_version_file: true,
2024-09-29T02:58:44.3754866Z     legacy_version_file_disable_tools: {},
2024-09-29T02:58:44.3755806Z     libgit2: true,
2024-09-29T02:58:44.3756358Z     log_level: "trace",
2024-09-29T02:58:44.3757136Z     node: SettingsNode {
2024-09-29T02:58:44.3757853Z         compile: None,
2024-09-29T02:58:44.3758424Z         flavor: None,
2024-09-29T02:58:44.3758944Z         mirror_url: None,
2024-09-29T02:58:44.3759615Z     },
2024-09-29T02:58:44.3760104Z     not_found_auto_install: true,
2024-09-29T02:58:44.3760697Z     paranoid: false,
2024-09-29T02:58:44.3761335Z     pipx_uvx: false,
2024-09-29T02:58:44.3761951Z     plugin_autoupdate_last_check_duration: "7d",
2024-09-29T02:58:44.3762627Z     python_compile: None,
2024-09-29T02:58:44.3763336Z     python_default_packages_file: Some(
2024-09-29T02:58:44.3764200Z         "/home/runner/.default-python-packages",
2024-09-29T02:58:44.3764861Z     ),
2024-09-29T02:58:44.3765467Z     python_patch_url: None,
2024-09-29T02:58:44.3766075Z     python_patches_directory: None,
2024-09-29T02:58:44.3766727Z     python_precompiled_arch: None,
2024-09-29T02:58:44.3767655Z     python_precompiled_os: None,
2024-09-29T02:58:44.3768492Z     python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
2024-09-29T02:58:44.3769272Z     python_venv_auto_create: false,
2024-09-29T02:58:44.3770014Z     quiet: false,
2024-09-29T02:58:44.3770553Z     raw: false,
2024-09-29T02:58:44.3771021Z     ruby: SettingsRuby {
2024-09-29T02:58:44.3771669Z         apply_patches: None,
2024-09-29T02:58:44.3772445Z         default_packages_file: "~/.default-gems",
2024-09-29T02:58:44.3773126Z         ruby_build_opts: None,
2024-09-29T02:58:44.3774068Z         ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
2024-09-29T02:58:44.3774930Z         ruby_install: false,
2024-09-29T02:58:44.3775478Z         ruby_install_opts: None,
2024-09-29T02:58:44.3776525Z         ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
2024-09-29T02:58:44.3777605Z         verbose_install: None,
2024-09-29T02:58:44.3778532Z     },
2024-09-29T02:58:44.3779076Z     shorthands_file: None,
2024-09-29T02:58:44.3779741Z     status: SettingsStatus {
2024-09-29T02:58:44.3780396Z         missing_tools: "if_other_versions_installed",
2024-09-29T02:58:44.3781249Z         show_env: false,
2024-09-29T02:58:44.3781813Z         show_tools: false,
2024-09-29T02:58:44.3782309Z     },
2024-09-29T02:58:44.3783060Z     task_output: None,
2024-09-29T02:58:44.3783597Z     trace: true,
2024-09-29T02:58:44.3784055Z     trusted_config_paths: {
2024-09-29T02:58:44.3785059Z         "/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro",
2024-09-29T02:58:44.3785914Z     },
2024-09-29T02:58:44.3786341Z     use_versions_host: true,
2024-09-29T02:58:44.3787455Z     verbose: true,
2024-09-29T02:58:44.3787982Z     vfox: false,
2024-09-29T02:58:44.3788458Z     yes: true,
2024-09-29T02:58:44.3789001Z }
2024-09-29T02:58:44.3789897Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/node/.mise.backend.json
2024-09-29T02:58:44.3791982Z [TRACE] (1) mise::config: [src/config/mod.rs:82] load: config_paths: ["/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml"]
2024-09-29T02:58:44.3794181Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3796460Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:90] parsing: ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3798756Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3800364Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:102] [tools]
2024-09-29T02:58:44.3801434Z node = "22.9.0"
2024-09-29T02:58:44.3801990Z "npm:@biomejs/biome" = "1.9.2"
2024-09-29T02:58:44.3802450Z 
2024-09-29T02:58:44.3802773Z [DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
2024-09-29T02:58:44.3803583Z     Config Files: [
2024-09-29T02:58:44.3804831Z         "~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml",
2024-09-29T02:58:44.3805713Z     ],
2024-09-29T02:58:44.3806141Z }
2024-09-29T02:58:44.3807482Z [TRACE] (2) mise::backend: [src/backend/mod.rs:326] Ensuring dependencies installed for npm:@biomejs/biome
2024-09-29T02:58:44.3808988Z [DEBUG] (2) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(45.875µs): ToolRequestSet: [email protected] npm:@biomejs/[email protected]
2024-09-29T02:58:44.3809764Z 
2024-09-29T02:58:44.3810132Z [TRACE] (2) mise::backend: [src/backend/mod.rs:192] Listing remote versions for npm:@biomejs/biome
2024-09-29T02:58:44.3811058Z [DEBUG] (2) mise::cmd: [src/cmd.rs:91] $ npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3811960Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3812742Z [TRACE] (1) mise::config: [src/config/mod.rs:70] Settings: Settings {
2024-09-29T02:58:44.3813590Z     activate_aggressive: false,
2024-09-29T02:58:44.3814280Z     all_compile: false,
2024-09-29T02:58:44.3814866Z     always_keep_download: false,
2024-09-29T02:58:44.3815528Z     always_keep_install: false,
2024-09-29T02:58:44.3816152Z     asdf: true,
2024-09-29T02:58:44.3816655Z     asdf_compat: false,
2024-09-29T02:58:44.3817458Z     cache_prune_age: "30d",
2024-09-29T02:58:44.3818119Z     cargo_binstall: true,
2024-09-29T02:58:44.3818812Z     cd: None,
2024-09-29T02:58:44.3819348Z     ci: true,
2024-09-29T02:58:44.3819889Z     color: true,
2024-09-29T02:58:44.3820409Z     debug: true,
2024-09-29T02:58:44.3821012Z     disable_default_shorthands: false,
2024-09-29T02:58:44.3821701Z     disable_hints: {},
2024-09-29T02:58:44.3822276Z     disable_tools: {},
2024-09-29T02:58:44.3822869Z     env_file: None,
2024-09-29T02:58:44.3823418Z     experimental: false,
2024-09-29T02:58:44.3824231Z     go_default_packages_file: "~/.default-go-packages",
2024-09-29T02:58:44.3825162Z     go_download_mirror: "https://dl.google.com/go",
2024-09-29T02:58:44.3825991Z     go_repo: "https://github.com/golang/go",
2024-09-29T02:58:44.3826690Z     go_set_gobin: None,
2024-09-29T02:58:44.3827639Z     go_set_gopath: false,
2024-09-29T02:58:44.3828209Z     go_set_goroot: true,
2024-09-29T02:58:44.3828789Z     go_skip_checksum: false,
2024-09-29T02:58:44.3829406Z     http_timeout: 30,
2024-09-29T02:58:44.3829922Z     jobs: 4,
2024-09-29T02:58:44.3830645Z     legacy_version_file: true,
2024-09-29T02:58:44.3831340Z     legacy_version_file_disable_tools: {},
2024-09-29T02:58:44.3832013Z     libgit2: true,
2024-09-29T02:58:44.3832546Z     log_level: "trace",
2024-09-29T02:58:44.3833134Z     node: SettingsNode {
2024-09-29T02:58:44.3833682Z         compile: None,
2024-09-29T02:58:44.3834221Z         flavor: None,
2024-09-29T02:58:44.3834776Z         mirror_url: None,
2024-09-29T02:58:44.3835335Z     },
2024-09-29T02:58:44.3835801Z     not_found_auto_install: true,
2024-09-29T02:58:44.3836449Z     paranoid: false,
2024-09-29T02:58:44.3837162Z     pipx_uvx: false,
2024-09-29T02:58:44.3837775Z     plugin_autoupdate_last_check_duration: "7d",
2024-09-29T02:58:44.3838531Z     python_compile: None,
2024-09-29T02:58:44.3839156Z     python_default_packages_file: Some(
2024-09-29T02:58:44.3839989Z         "/home/runner/.default-python-packages",
2024-09-29T02:58:44.3840694Z     ),
2024-09-29T02:58:44.3841175Z     python_patch_url: None,
2024-09-29T02:58:44.3841783Z     python_patches_directory: None,
2024-09-29T02:58:44.3842532Z     python_precompiled_arch: None,
2024-09-29T02:58:44.3843246Z     python_precompiled_os: None,
2024-09-29T02:58:44.3844069Z     python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
2024-09-29T02:58:44.3844937Z     python_venv_auto_create: false,
2024-09-29T02:58:44.3845596Z     quiet: false,
2024-09-29T02:58:44.3846142Z     raw: false,
2024-09-29T02:58:44.3846692Z     ruby: SettingsRuby {
2024-09-29T02:58:44.3847422Z         apply_patches: None,
2024-09-29T02:58:44.3848192Z         default_packages_file: "~/.default-gems",
2024-09-29T02:58:44.3849235Z         ruby_build_opts: None,
2024-09-29T02:58:44.3850139Z         ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
2024-09-29T02:58:44.3851018Z         ruby_install: false,
2024-09-29T02:58:44.3851659Z         ruby_install_opts: None,
2024-09-29T02:58:44.3852636Z         ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
2024-09-29T02:58:44.3853598Z         verbose_install: None,
2024-09-29T02:58:44.3854253Z     },
2024-09-29T02:58:44.3854765Z     shorthands_file: None,
2024-09-29T02:58:44.3855506Z     status: SettingsStatus {
2024-09-29T02:58:44.3856213Z         missing_tools: "if_other_versions_installed",
2024-09-29T02:58:44.3857226Z         show_env: false,
2024-09-29T02:58:44.3857971Z         show_tools: false,
2024-09-29T02:58:44.3858524Z     },
2024-09-29T02:58:44.3859042Z     task_output: None,
2024-09-29T02:58:44.3859709Z     trace: true,
2024-09-29T02:58:44.3860184Z     trusted_config_paths: {
2024-09-29T02:58:44.3861112Z         "/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro",
2024-09-29T02:58:44.3862054Z     },
2024-09-29T02:58:44.3862489Z     use_versions_host: true,
2024-09-29T02:58:44.3863120Z     verbose: true,
2024-09-29T02:58:44.3863770Z     vfox: false,
2024-09-29T02:58:44.3864248Z     yes: true,
2024-09-29T02:58:44.3864746Z }
2024-09-29T02:58:44.3865580Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/node/.mise.backend.json
2024-09-29T02:58:44.3867926Z [TRACE] (1) mise::config: [src/config/mod.rs:82] load: config_paths: ["/home/runner/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml"]
2024-09-29T02:58:44.3869943Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3871293Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:90] parsing: ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3872457Z [TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml
2024-09-29T02:58:44.3873374Z [TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:102] [tools]
2024-09-29T02:58:44.3874046Z node = "22.9.0"
2024-09-29T02:58:44.3874345Z "npm:@biomejs/biome" = "1.9.2"
2024-09-29T02:58:44.3874624Z 
2024-09-29T02:58:44.3874824Z [DEBUG] (1) mise::config: [src/config/mod.rs:95] Config {
2024-09-29T02:58:44.3875504Z     Config Files: [
2024-09-29T02:58:44.3876052Z         "~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml",
2024-09-29T02:58:44.3876507Z     ],
2024-09-29T02:58:44.3877046Z }
2024-09-29T02:58:44.3877692Z [TRACE] (3) mise::backend: [src/backend/mod.rs:326] Ensuring dependencies installed for npm:@biomejs/biome
2024-09-29T02:58:44.3879031Z [DEBUG] (3) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(28.453µs): ToolRequestSet: [email protected] npm:@biomejs/[email protected]
2024-09-29T02:58:44.3879779Z 
2024-09-29T02:58:44.3880203Z [TRACE] (3) mise::backend: [src/backend/mod.rs:192] Listing remote versions for npm:@biomejs/biome
2024-09-29T02:58:44.3881199Z [DEBUG] (3) mise::cmd: [src/cmd.rs:91] $ npm view @biomejs/biome versions --json
2024-09-29T02:58:44.3882272Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view @biomejs/biome versions --json

Might be related to this issue #2254

@risu729 risu729 added the bug label Sep 29, 2024
@risu729
Copy link
Contributor Author

risu729 commented Sep 29, 2024

I tried to fix this but I didn't come up with a good idea. Is it possible to ignore missing tools if the shim is called recursively using environment variables like this?

env::set_var("__MISE_SHIM", "1");

@jdx
Copy link
Owner

jdx commented Sep 29, 2024

we can probably remove the shims directory in mise x (which is what shims call)

that will load every activated tool so we shouldn't need shims at that point

@risu729
Copy link
Contributor Author

risu729 commented Oct 1, 2024

Thanks! Removing the shims directory from $PATH and running mise x -- node --version worked.

However, then npm view falls back to the pre-installed npm, or fails to resolve the toolset if npm is not installed without mise.
It seems there are no problems with the failure because the error is handled properly but not sure.

[TRACE] (2) mise::backend: [src/backend/mod.rs:326] Ensuring dependencies installed for npm:@biomejs/biome
[DEBUG] (2) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(28.112µs): ToolRequestSet: [email protected] npm:@biomejs/[email protected]

[TRACE] (2) mise::backend: [src/backend/mod.rs:192] Listing remote versions for npm:@biomejs/biome
[DEBUG] (2) mise::cmd: [src/cmd.rs:91] $ npm view @biomejs/biome versions --json
[WARN] (1) mise::toolset::builder: [src/toolset/builder.rs:45] failed to resolve toolset: Failed to resolve npm:@biomejs/[email protected] from ~/work/mise-inf-loop-repro/mise-inf-loop-repro/mise.toml: No such file or directory (os error 2): error resolving versions
[DEBUG] (1) mise::toolset::builder: [src/toolset/builder.rs:48] Toolset (2.079859ms): [email protected], npm:@biomejs/[email protected]

@risu729
Copy link
Contributor Author

risu729 commented Oct 1, 2024

Also, I found that mise doctor, mise ls, and many other cli commands call ToolsetBuilder::build, and hang in the same way.

pub fn build(self, config: &Config) -> Result<Toolset> {
let mut toolset = Toolset {
..Default::default()
};
self.load_config_files(config, &mut toolset)?;
self.load_runtime_env(&mut toolset, env::vars().collect())?;
self.load_runtime_args(&mut toolset)?;
let start_ms = std::time::Instant::now();
if let Err(err) = toolset.resolve() {
if Error::is_argument_err(&err) {
return Err(err);
}
warn!("failed to resolve toolset: {err:#}");
}
debug!("Toolset ({:?}): {toolset}", start_ms.elapsed());
Ok(toolset)
}

@jdx
Copy link
Owner

jdx commented Oct 2, 2024

yikes, what a mess, hopefully I'll have some time to dig into this soon. My intention was to replace ToolVersionSet/ToolVersion (which has better support for non-asdf backends) with ToolSet/ToolRequest but I never completed that refactor.

@jdx
Copy link
Owner

jdx commented Oct 2, 2024

we might need some code path that we use to execute external commands inside of mise that essentially does mise x under the hood.

If we did that for all the ToolRequest/ToolSet code that should resolve this issue

@risu729
Copy link
Contributor Author

risu729 commented Oct 5, 2024

Thank you for the detailed explanation. I also think directly calling the external commands would be great.

@jdx jdx linked a pull request Oct 12, 2024 that will close this issue
@jdx jdx closed this as completed in #2736 Oct 12, 2024
@risu729
Copy link
Contributor Author

risu729 commented Oct 13, 2024

Thanks for fixing the issue! I was trying to fix it but couldn't...

I have a question, what is the point of restoring the shims in PATH in PathEnv?
It is called to add tools bins to PATH, so I think shims are unnecessary after them.
One guess is overriding the PATH in hook-env without shims will cause some problems, but I don't have any idea about specific issues.
I may fix the issue simply by removing this, but I'm unsure if it is really unnecessary.

mise/src/path_env.rs

Lines 35 to 49 in 90bb910

pub fn to_vec(&self) -> Vec<PathBuf> {
let mut paths = self
.pre
.iter()
.chain(self.mise.iter())
.map(|p| p.to_path_buf())
.collect_vec();
if self.seen_shims {
paths.push(dirs::SHIMS.to_path_buf())
}
paths
.into_iter()
.chain(self.post.iter().map(|p| p.to_path_buf()))
.collect()
}

@jdx
Copy link
Owner

jdx commented Oct 13, 2024

Thanks for fixing the issue! I was trying to fix it but couldn't...

did you verify this fixed the issue? I'm not sure if it is fully working yet or not, or if this maybe introduced a different problem but it doesn't loop anymore.

I have a question, what is the point of restoring the shims in PATH in PathEnv?

ah that's a potential problem actually, good call out. That is not adding the shims directory, only keeping it where it was.

The purpose of that code is to not put all of the mise tools at the beginning of PATH (unless the aggressive setting is used), but at the same point in PATH where the shims are. This could be a problem if someone wants to override shims with something else so we should fix this somehow.

@jdx jdx reopened this Oct 13, 2024
@risu729
Copy link
Contributor Author

risu729 commented Oct 13, 2024

did you verify this fixed the issue? I'm not sure if it is fully working yet or not, or if this maybe introduced a different problem but it doesn't loop anymore.

I tested it now in a clean environment (than my local), and confirmed it has been resolved for my case. https://github.com/risu729/mise-inf-loop-repro/actions/runs/11315018162/job/31465691704

The purpose of that code is to not put all of the mise tools at the beginning of PATH (unless the aggressive setting is used), but at the same point in PATH where the shims are. This could be a problem if someone wants to override shims with something else so we should fix this somehow.

Thank you for the explanation.

I apologize for my unclear question. My question was why is it restoring the shims, instead of just leaving shims removed?
I'm unsure why it restores the shims even the tools actual paths are prepended to PATH.

For example, if it doesn't restore the shims, node will fallback to the non-mise path or just fails with "no such file" when not installed. However, it restores the shims so node fallbacks to the shims and mise throws the error "invalid shim".

@jdx
Copy link
Owner

jdx commented Oct 13, 2024

yeah we could take the shim directory out of that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants