-
Notifications
You must be signed in to change notification settings - Fork 325
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
Comments
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? Line 34 in 663170b
|
we can probably remove the shims directory in that will load every activated tool so we shouldn't need shims at that point |
Thanks! Removing the shims directory from However, then
|
Also, I found that Lines 33 to 50 in 4ac34da
|
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. |
we might need some code path that we use to execute external commands inside of mise that essentially does If we did that for all the ToolRequest/ToolSet code that should resolve this issue |
Thank you for the detailed explanation. I also think directly calling the external commands would be great. |
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 Lines 35 to 49 in 90bb910
|
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.
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. |
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
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? For example, if it doesn't restore the shims, |
yeah we could take the shim directory out of that |
Describe the bug
shim, for example,
node --version
, hangs if npm backend tools inmise.toml
are missing andnode
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.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
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
Full trace
mise/src/shims.rs
Lines 23 to 33 in 663170b
mise/src/shims.rs
Lines 46 to 48 in 663170b
mise/src/toolset/builder.rs
Lines 33 to 41 in 663170b
mise/src/toolset/mod.rs
Lines 102 to 109 in 663170b
mise/src/toolset/tool_version_list.rs
Lines 25 to 29 in 663170b
mise/src/toolset/tool_request.rs
Lines 187 to 188 in 663170b
mise/src/toolset/tool_version.rs
Lines 36 to 49 in 663170b
mise/src/toolset/tool_version.rs
Lines 138 to 201 in 663170b
mise/src/backend/mod.rs
Lines 279 to 280 in 663170b
mise/src/backend/mod.rs
Lines 189 to 193 in 663170b
mise/src/backend/npm.rs
Lines 34 to 42 in 663170b
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
node
inmise.toml
.mise install node
.node --version
hangs becausenpm:@biomejs/biome
is missing.Expected behavior
node --version
exits successfully.mise doctor
outputAdditional 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`
Might be related to this issue #2254
The text was updated successfully, but these errors were encountered: