moonrepo / proto

A pluggable multi-language version manager.
https://moonrepo.dev/proto
MIT License
699 stars 34 forks source link

`proto use` fails with an odd error when `git` is missing #628

Open rotu opened 1 month ago

rotu commented 1 month ago

What version?

0.41.3

Which command?

proto use

What happened?

I installed proto on a recently re-installed machine. Git is not yet installed.

proto use crashes with a confusing error that doesn't explain the reason I expect the error message to mention the failing command git.

The output of proto use:

$ proto use
  node ━━━━━━━━━━━━━━━━━━━━ | Installing Node.js 22.9.0
   npm ━━━━━━━━━━━━━━━━━━━━ | Installing npm 10.9.0
  pnpm ━━━━━━━━━━━━━━━━━━━━ | Installing pnpm latest                                                                    Error:   × Main thread panicked.
  ├─▶ at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-
  │   1.40.0\src\runtime\time\entry.rs:568:9
  ╰─▶ A Tokio 1.x context was found, but it is being shutdown.
  help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.

Note the "help" text which suggests setting RUST_BACKTRACE=1 (I wonder if there's a way to mention setting the --log=trace or PROTO_LOG=trace in addition or instead?)

Trace logs?

[DEBUG 2024-10-06 18:12:37.420] proto  Running proto v0.41.3  bin="C:\\Users\\dan\\.proto\\bin\\proto.exe" args=["--log=trace", "use"] pid=1412
[TRACE 18:12:37.421] starbase::app  Running startup phase
[DEBUG 18:12:37.424] proto_core::proto  Creating proto environment, detecting store  store="C:\\Users\\dan\\.proto" home="C:\\Users\\dan"
[TRACE 18:12:37.424] starbase::app  Running analyze phase
[DEBUG 18:12:37.425] proto::systems  Loading configuration in upwards mode  working_dir="C:\\Users\\dan\\.proto"
[DEBUG 18:12:37.425] proto_core::proto_config  Loading .prototools  file="C:\\Users\\dan\\.proto\\.prototools"
[TRACE 18:12:37.425] starbase_utils::fs  Reading file  file="C:\\Users\\dan\\.proto\\.prototools"
[TRACE 18:12:37.426] schematic::config::loader  Loading partial configuration  config="ProtoConfig"
[TRACE 18:12:37.426] schematic::config::loader  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 18:12:37.427] schematic::config::loader  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 18:12:37.427] proto_core::proto_config  Loading .prototools  file="C:\\Users\\dan\\.proto\\.prototools"
[TRACE 18:12:37.428] starbase_utils::fs  Opening file  file="C:\\Users\\dan\\.proto\\.prototools"
[TRACE 18:12:37.428] starbase_utils::fs_lock  Locking file  file="C:\\Users\\dan\\.proto\\.prototools"
[TRACE 18:12:37.428] starbase_utils::fs_lock  Unlocking file  file="C:\\Users\\dan\\.proto\\.prototools"
[TRACE 18:12:37.429] schematic::config::loader  Loading partial configuration  config="ProtoConfig"
[TRACE 18:12:37.429] schematic::config::loader  Creating layer from source  config="ProtoConfig" source="<code>"
[TRACE 18:12:37.430] schematic::config::loader  Merging partial layers into a final result  config="ProtoConfig"
[DEBUG 18:12:37.430] proto_core::proto_config  Merging loaded configs without global
[DEBUG 18:12:37.430] proto_core::proto_config  Merged 1 configs
[TRACE 18:12:37.430] starbase::app  Running execute phase
[DEBUG 18:12:37.431] proto::commands::install  Loading all tools
[TRACE 18:12:37.431] starbase_utils::net  Checking for an internet connection  timeout=750
[DEBUG 18:12:37.431] proto_core::tool_loader  Finding a configured plugin  tool="internal-schema"
[TRACE 18:12:37.431] starbase_utils::net::offline  Resolving 1.1.1.1:53
[DEBUG 18:12:37.432] proto_core::proto_config  Merging loaded configs with global
[DEBUG 18:12:37.432] proto_core::proto_config  Merged 2 configs
[DEBUG 18:12:37.432] proto_core::tool_loader  Using a built-in plugin  plugin="https://github.com/moonrepo/tools/releases/download/schema_tool-v0.15.0/schema_tool.wasm"
[TRACE 18:12:37.433] warpgate::loader  Creating plugin loader  cache_dir="C:\\Users\\dan\\.proto\\plugins"
[TRACE 18:12:37.433] warpgate::loader  Loading plugin internal-schema  id="internal-schema" locator="https://github.com/moonrepo/tools/releases/download/schema_tool-v0.15.0/schema_tool.wasm"
[TRACE 18:12:37.434] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\internal-schema-3d513fa42b2af231aabb30d98ce37f264630c0f72a637fe9c1c1625330b0cc1c.wasm"
[TRACE 18:12:37.434] warpgate::loader  Plugin already downloaded and cached  id="internal-schema" path="C:\\Users\\dan\\.proto\\plugins\\internal-schema-3d513fa42b2af231aabb30d98ce37f264630c0f72a637fe9c1c1625330b0cc1c.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin yarn  id="yarn" locator="https://github.com/moonrepo/tools/releases/download/node_depman_tool-v0.13.1/node_depman_tool.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin bun  id="bun" locator="https://github.com/moonrepo/tools/releases/download/bun_tool-v0.13.0/bun_tool.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin deno  id="deno" locator="https://github.com/moonrepo/tools/releases/download/deno_tool-v0.12.0/deno_tool.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin pnpm  id="pnpm" locator="https://github.com/moonrepo/tools/releases/download/node_depman_tool-v0.13.1/node_depman_tool.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin npm  id="npm" locator="https://github.com/moonrepo/tools/releases/download/node_depman_tool-v0.13.1/node_depman_tool.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin node  id="node" locator="https://github.com/moonrepo/tools/releases/download/node_tool-v0.12.2/node_tool.wasm"
[TRACE 18:12:37.436] warpgate::loader  Loading plugin python  id="python" locator="https://github.com/moonrepo/tools/releases/download/python_tool-v0.11.0/python_tool.wasm"
[TRACE 18:12:37.438] starbase_utils::net  Online!
[TRACE 18:12:37.440] starbase_utils::fs  Reading file  file="C:\\Users\\dan\\.proto\\temp\\.last-version-check"
[TRACE 18:12:37.441] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\yarn-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[TRACE 18:12:37.441] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\bun-4b79ec6cdd21539c566e496b71ed6962349b8bd7c84d114f758b9277aedbcd81.wasm"
[TRACE 18:12:37.441] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\deno-0c576e3fa327e68fc1896e3eb15866c63f35d549fc5fc64ca1f22c271c1c2a9b.wasm"
[TRACE 18:12:37.441] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\npm-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[TRACE 18:12:37.441] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\pnpm-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[TRACE 18:12:37.442] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\python-d9edd08733791589cdb1a72ccb39494f6af46ce8f1c36a959635db26b2d1782b.wasm"
[TRACE 18:12:37.442] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\node-2c6c77c45d1bdb8f047e79502196bb8fd995504ce5c4c03a9d26b1f7c8b15d59.wasm"
[TRACE 18:12:37.442] warpgate::loader  Plugin already downloaded and cached  id="yarn" path="C:\\Users\\dan\\.proto\\plugins\\yarn-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[TRACE 18:12:37.443] warpgate::loader  Plugin already downloaded and cached  id="bun" path="C:\\Users\\dan\\.proto\\plugins\\bun-4b79ec6cdd21539c566e496b71ed6962349b8bd7c84d114f758b9277aedbcd81.wasm"
[TRACE 18:12:37.443] warpgate::loader  Plugin already downloaded and cached  id="deno" path="C:\\Users\\dan\\.proto\\plugins\\deno-0c576e3fa327e68fc1896e3eb15866c63f35d549fc5fc64ca1f22c271c1c2a9b.wasm"
[TRACE 18:12:37.443] warpgate::loader  Plugin already downloaded and cached  id="npm" path="C:\\Users\\dan\\.proto\\plugins\\npm-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[TRACE 18:12:37.443] warpgate::loader  Loading plugin rust  id="rust" locator="https://github.com/moonrepo/tools/releases/download/rust_tool-v0.11.0/rust_tool.wasm"
[TRACE 18:12:37.443] warpgate::loader  Plugin already downloaded and cached  id="pnpm" path="C:\\Users\\dan\\.proto\\plugins\\pnpm-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[TRACE 18:12:37.444] warpgate::loader  Plugin already downloaded and cached  id="python" path="C:\\Users\\dan\\.proto\\plugins\\python-d9edd08733791589cdb1a72ccb39494f6af46ce8f1c36a959635db26b2d1782b.wasm"
[TRACE 18:12:37.444] warpgate::loader  Plugin already downloaded and cached  id="node" path="C:\\Users\\dan\\.proto\\plugins\\node-2c6c77c45d1bdb8f047e79502196bb8fd995504ce5c4c03a9d26b1f7c8b15d59.wasm"
[DEBUG 18:12:37.444] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\bun-4b79ec6cdd21539c566e496b71ed6962349b8bd7c84d114f758b9277aedbcd81.wasm"
[DEBUG 18:12:37.445] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\yarn-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[DEBUG 18:12:37.445] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\npm-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[DEBUG 18:12:37.445] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\deno-0c576e3fa327e68fc1896e3eb15866c63f35d549fc5fc64ca1f22c271c1c2a9b.wasm"
[DEBUG 18:12:37.446] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\pnpm-b9341305d212d01f814c24338dadc08498000fcc4a6b6e8e1e7b27fc5cd7478c.wasm"
[DEBUG 18:12:37.446] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\python-d9edd08733791589cdb1a72ccb39494f6af46ce8f1c36a959635db26b2d1782b.wasm"
[DEBUG 18:12:37.446] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\node-2c6c77c45d1bdb8f047e79502196bb8fd995504ce5c4c03a9d26b1f7c8b15d59.wasm"
[TRACE 18:12:37.447] warpgate::plugin  Storing plugin identifier  id="bun"
[TRACE 18:12:37.447] warpgate::plugin  Storing plugin identifier  id="yarn"
[TRACE 18:12:37.448] warpgate::plugin  Storing plugin identifier  id="deno"
[TRACE 18:12:37.448] warpgate::plugin  Storing plugin identifier  id="npm"
[TRACE 18:12:37.448] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\rust-040c7eeef51cbff67aad1bec847a49b15d6724dee002b9045f102180c0e72817.wasm"
[TRACE 18:12:37.449] warpgate::plugin  Storing plugin identifier  id="pnpm"
[TRACE 18:12:37.449] warpgate::plugin  Storing plugin identifier  id="python"
[TRACE 18:12:37.449] warpgate::plugin  Storing plugin identifier  id="node"
[TRACE 18:12:37.449] warpgate::plugin  Storing host environment  id="bun" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.449] warpgate::plugin  Storing host environment  id="yarn" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.450] warpgate::plugin  Storing host environment  id="deno" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.450] warpgate::loader  Plugin already downloaded and cached  id="rust" path="C:\\Users\\dan\\.proto\\plugins\\rust-040c7eeef51cbff67aad1bec847a49b15d6724dee002b9045f102180c0e72817.wasm"
[TRACE 18:12:37.450] warpgate::plugin  Storing host environment  id="npm" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.450] warpgate::plugin  Storing host environment  id="pnpm" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.451] warpgate::plugin  Storing host environment  id="python" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.451] warpgate::plugin  Storing host environment  id="node" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[DEBUG 18:12:37.452] proto_core::tool  Creating tool bun and instantiating plugin
[DEBUG 18:12:37.452] proto_core::tool  Creating tool yarn and instantiating plugin
[DEBUG 18:12:37.452] proto_core::tool  Creating tool deno and instantiating plugin
[DEBUG 18:12:37.452] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\rust-040c7eeef51cbff67aad1bec847a49b15d6724dee002b9045f102180c0e72817.wasm"
[DEBUG 18:12:37.453] proto_core::tool  Creating tool pnpm and instantiating plugin
[DEBUG 18:12:37.453] proto_core::tool  Creating tool npm and instantiating plugin
[DEBUG 18:12:37.454] warpgate::client  Creating HTTP client
[DEBUG 18:12:37.454] proto_core::tool  Creating tool python and instantiating plugin
[DEBUG 18:12:37.454] proto_core::tool  Creating tool node and instantiating plugin
[TRACE 18:12:37.455] warpgate::plugin  Storing plugin identifier  id="rust"
[TRACE 18:12:37.455] warpgate::plugin  Storing host environment  id="rust" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[DEBUG 18:12:37.456] proto_core::tool  Creating tool rust and instantiating plugin
[DEBUG 18:12:37.459] warpgate::client  Created HTTP client
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="rust"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="yarn"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="npm"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="bun"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="node"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="pnpm"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="deno"
[TRACE 18:12:37.460] warpgate::plugin  Creating plugin container  id="python"
[TRACE 18:12:37.484] warpgate::plugin  Created plugin container  id="bun" plugin="e38f73de-f9f9-464d-b38f-86e4bcdf4a69"
[TRACE 18:12:37.484] warpgate::plugin  Created plugin container  id="node" plugin="2c67be8d-b3da-4cb8-87c9-61e23310d451"
[TRACE 18:12:37.484] warpgate::plugin  Created plugin container  id="deno" plugin="54717592-c407-4187-a5f4-004b39e23150"
[TRACE 18:12:37.484] warpgate::plugin  Created plugin container  id="python" plugin="8db3fe24-d3ad-4a9c-87b2-05362fd14b1a"
[DEBUG 18:12:37.485] proto_core::tool  Created tool bun and its WASM runtime
[DEBUG 18:12:37.486] proto_core::tool  Created tool python and its WASM runtime
[TRACE 18:12:37.486] warpgate::plugin  Created plugin container  id="rust" plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c"
[DEBUG 18:12:37.486] proto_core::tool  Created tool node and its WASM runtime
[DEBUG 18:12:37.486] proto_core::tool  Created tool deno and its WASM runtime
[TRACE 18:12:37.487] warpgate::plugin  Calling guest function register_tool  id="bun" plugin="e38f73de-f9f9-464d-b38f-86e4bcdf4a69" input={"id":"bun"}
[TRACE 18:12:37.488] warpgate::plugin  Created plugin container  id="pnpm" plugin="1e2b9b5b-6df9-4979-9ce9-6caf23402361"
[DEBUG 18:12:37.489] proto_core::tool  Created tool rust and its WASM runtime
[TRACE 18:12:37.488] warpgate::plugin  Calling guest function register_tool  id="python" plugin="8db3fe24-d3ad-4a9c-87b2-05362fd14b1a" input={"id":"python"}
[TRACE 18:12:37.489] warpgate::plugin  Created plugin container  id="npm" plugin="6cf8629f-04d6-4296-a3da-aee51b74c01f"
[TRACE 18:12:37.489] warpgate::plugin  Created plugin container  id="yarn" plugin="21080f1a-6da9-486b-a10d-4859509ec689"
[TRACE 18:12:37.489] warpgate::plugin  Calling guest function register_tool  id="node" plugin="2c67be8d-b3da-4cb8-87c9-61e23310d451" input={"id":"node"}
[TRACE 18:12:37.489] warpgate::plugin  Calling guest function register_tool  id="deno" plugin="54717592-c407-4187-a5f4-004b39e23150" input={"id":"deno"}
[DEBUG 18:12:37.490] proto_core::tool  Created tool pnpm and its WASM runtime
[TRACE 18:12:37.490] warpgate::plugin  Called guest function register_tool  id="bun" plugin="e38f73de-f9f9-464d-b38f-86e4bcdf4a69" output={"config_schema":{"name":"BunPluginConfig","ty":{"type":"Struct","fields":{"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"inventory":{},"name":"Bun","plugin_version":"0.13.0","self_upgrade_commands":["upgrade"],"type":"Language"}
[TRACE 18:12:37.490] warpgate::loader  Loading plugin go  id="go" locator="https://github.com/moonrepo/tools/releases/download/go_tool-v0.13.0/go_tool.wasm"
[DEBUG 18:12:37.492] proto_core::tool  Created tool yarn and its WASM runtime
[DEBUG 18:12:37.492] proto_core::tool  Created tool npm and its WASM runtime
[TRACE 18:12:37.491] warpgate::plugin  Calling guest function register_tool  id="rust" plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c" input={"id":"rust"}
[TRACE 18:12:37.492] warpgate::plugin  Called guest function register_tool  id="python" plugin="8db3fe24-d3ad-4a9c-87b2-05362fd14b1a" output={"inventory":{},"name":"Python","plugin_version":"0.11.0","type":"Language"}
[TRACE 18:12:37.493] warpgate::plugin  Called guest function register_tool  id="node" plugin="2c67be8d-b3da-4cb8-87c9-61e23310d451" output={"config_schema":{"name":"NodePluginConfig","ty":{"type":"Struct","fields":{"bundled-npm":{"schema":{"ty":{"type":"Boolean"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false},"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"inventory":{},"name":"Node.js","plugin_version":"0.12.2","type":"Language"}
[TRACE 18:12:37.493] warpgate::plugin  Called guest function register_tool  id="deno" plugin="54717592-c407-4187-a5f4-004b39e23150" output={"config_schema":{"name":"DenoPluginConfig","ty":{"type":"Struct","fields":{"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"inventory":{},"name":"Deno","plugin_version":"0.12.0","self_upgrade_commands":["upgrade"],"type":"Language"}
[DEBUG 18:12:37.494] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\bun\\manifest.json"
[TRACE 18:12:37.494] warpgate::plugin  Calling guest function register_tool  id="pnpm" plugin="1e2b9b5b-6df9-4979-9ce9-6caf23402361" input={"id":"pnpm"}
[TRACE 18:12:37.495] warpgate::host  Calling host function get_env_var  plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c" name="RUSTUP_HOME"
[TRACE 18:12:37.495] warpgate::plugin  Calling guest function register_tool  id="yarn" plugin="21080f1a-6da9-486b-a10d-4859509ec689" input={"id":"yarn"}
[TRACE 18:12:37.495] warpgate::plugin  Calling guest function register_tool  id="npm" plugin="6cf8629f-04d6-4296-a3da-aee51b74c01f" input={"id":"npm"}
[DEBUG 18:12:37.496] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\python\\manifest.json"
[DEBUG 18:12:37.497] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\node\\manifest.json"
[TRACE 18:12:37.497] starbase_utils::fs  Opening file  file="C:\\Users\\dan\\.proto\\tools\\bun\\manifest.json"
[DEBUG 18:12:37.498] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\deno\\manifest.json"
[TRACE 18:12:37.498] starbase_utils::fs  Reading file metadata  file="C:\\Users\\dan\\.proto\\plugins\\go-f7e80cff695d64bd5aa1aab5c38ba0415543e1a65ff9f20db63496ff9b39c07b.wasm"
[TRACE 18:12:37.499] warpgate::host  Called host function get_env_var  plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c" value=""
[TRACE 18:12:37.497] warpgate::plugin  Called guest function register_tool  id="pnpm" plugin="1e2b9b5b-6df9-4979-9ce9-6caf23402361" output={"config_schema":{"name":"NodeDepmanPluginConfig","ty":{"type":"Struct","fields":{"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false},"shared-globals-dir":{"schema":{"ty":{"type":"Boolean"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"inventory":{},"name":"pnpm","plugin_version":"0.13.1","type":"DependencyManager"}
[TRACE 18:12:37.500] warpgate::plugin  Called guest function register_tool  id="yarn" plugin="21080f1a-6da9-486b-a10d-4859509ec689" output={"config_schema":{"name":"NodeDepmanPluginConfig","ty":{"type":"Struct","fields":{"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false},"shared-globals-dir":{"schema":{"ty":{"type":"Boolean"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"inventory":{},"name":"yarn","plugin_version":"0.13.1","type":"DependencyManager"}
[TRACE 18:12:37.500] starbase_utils::fs  Opening file  file="C:\\Users\\dan\\.proto\\tools\\node\\manifest.json"
[TRACE 18:12:37.501] starbase_utils::fs_lock  Locking file  file="C:\\Users\\dan\\.proto\\tools\\bun\\manifest.json"
[TRACE 18:12:37.500] warpgate::loader  Plugin already downloaded and cached  id="go" path="C:\\Users\\dan\\.proto\\plugins\\go-f7e80cff695d64bd5aa1aab5c38ba0415543e1a65ff9f20db63496ff9b39c07b.wasm"
[TRACE 18:12:37.501] starbase_utils::fs  Opening file  file="C:\\Users\\dan\\.proto\\tools\\deno\\manifest.json"
[TRACE 18:12:37.500] warpgate::plugin  Called guest function register_tool  id="npm" plugin="6cf8629f-04d6-4296-a3da-aee51b74c01f" output={"config_schema":{"name":"NodeDepmanPluginConfig","ty":{"type":"Struct","fields":{"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false},"shared-globals-dir":{"schema":{"ty":{"type":"Boolean"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"default_version":"bundled","inventory":{},"name":"npm","plugin_version":"0.13.1","type":"DependencyManager"}
[DEBUG 18:12:37.502] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\pnpm\\manifest.json"
[TRACE 18:12:37.502] warpgate::plugin  Called guest function register_tool  id="rust" plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c" output={"default_version":"stable","inventory":{"override_dir":{"path":"/userhome/.rustup/toolchains","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"},"version_suffix":"-x86_64-pc-windows-msvc"},"name":"Rust","plugin_version":"0.11.0","type":"Language"}
[DEBUG 18:12:37.503] proto_core::tool_loader  Loading WASM plugin  source="C:\\Users\\dan\\.proto\\plugins\\go-f7e80cff695d64bd5aa1aab5c38ba0415543e1a65ff9f20db63496ff9b39c07b.wasm"
[DEBUG 18:12:37.503] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\yarn\\manifest.json"
[TRACE 18:12:37.503] starbase_utils::fs_lock  Unlocking file  file="C:\\Users\\dan\\.proto\\tools\\bun\\manifest.json"
[TRACE 18:12:37.503] starbase_utils::fs_lock  Locking file  file="C:\\Users\\dan\\.proto\\tools\\deno\\manifest.json"
[TRACE 18:12:37.504] starbase_utils::fs_lock  Locking file  file="C:\\Users\\dan\\.proto\\tools\\node\\manifest.json"
[DEBUG 18:12:37.504] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\npm\\manifest.json"
[TRACE 18:12:37.505] starbase_utils::fs  Opening file  file="C:\\Users\\dan\\.proto\\tools\\pnpm\\manifest.json"
[DEBUG 18:12:37.505] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\rust\\manifest.json"
[TRACE 18:12:37.506] starbase_utils::fs_lock  Unlocking file  file="C:\\Users\\dan\\.proto\\tools\\deno\\manifest.json"
[TRACE 18:12:37.506] warpgate::plugin  Storing plugin identifier  id="go"
[TRACE 18:12:37.506] starbase_utils::fs_lock  Unlocking file  file="C:\\Users\\dan\\.proto\\tools\\node\\manifest.json"
[TRACE 18:12:37.507] starbase_utils::fs  Opening file  file="C:\\Users\\dan\\.proto\\tools\\npm\\manifest.json"
[TRACE 18:12:37.507] starbase_utils::fs_lock  Locking file  file="C:\\Users\\dan\\.proto\\tools\\pnpm\\manifest.json"
[DEBUG 18:12:37.507] proto_core::tool  Attempting to override inventory directory  tool="rust" override_virtual=WithReal { path: "/userhome/.rustup/toolchains", virtual_prefix: "/userhome", real_prefix: "C:\\Users\\dan" } override_real=Some("C:\\Users\\dan\\.rustup/toolchains")
[TRACE 18:12:37.508] warpgate::plugin  Storing host environment  id="go" env={"arch":"x64","libc":"unknown","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"}}
[TRACE 18:12:37.508] starbase_utils::fs_lock  Unlocking file  file="C:\\Users\\dan\\.proto\\tools\\pnpm\\manifest.json"
[TRACE 18:12:37.508] starbase_utils::fs_lock  Locking file  file="C:\\Users\\dan\\.proto\\tools\\npm\\manifest.json"
[DEBUG 18:12:37.509] proto_core::tool  Creating tool go and instantiating plugin
[TRACE 18:12:37.509] starbase_utils::fs_lock  Unlocking file  file="C:\\Users\\dan\\.proto\\tools\\npm\\manifest.json"
[TRACE 18:12:37.509] warpgate::plugin  Creating plugin container  id="go"
[TRACE 18:12:37.521] warpgate::plugin  Created plugin container  id="go" plugin="809b50df-9892-47da-906f-e4bc68bf49d1"
[DEBUG 18:12:37.521] proto_core::tool  Created tool go and its WASM runtime
[TRACE 18:12:37.522] warpgate::plugin  Calling guest function register_tool  id="go" plugin="809b50df-9892-47da-906f-e4bc68bf49d1" input={"id":"go"}
[TRACE 18:12:37.522] warpgate::plugin  Called guest function register_tool  id="go" plugin="809b50df-9892-47da-906f-e4bc68bf49d1" output={"config_schema":{"name":"GoPluginConfig","ty":{"type":"Struct","fields":{"dist-url":{"schema":{"ty":{"type":"String"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false},"gobin":{"schema":{"ty":{"type":"Boolean"}},"hidden":false,"nullable":false,"optional":true,"read_only":false,"write_only":false}},"partial":false}},"inventory":{},"name":"Go","plugin_version":"0.13.0","type":"Language"}
[DEBUG 18:12:37.523] proto_core::tool_manifest  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\go\\manifest.json"
[DEBUG 18:12:37.523] proto::commands::install  Detecting tool versions to install
[TRACE 18:12:37.524] warpgate::plugin  Calling guest function detect_version_files  id="yarn" plugin="21080f1a-6da9-486b-a10d-4859509ec689" input={}
[TRACE 18:12:37.524] warpgate::plugin  Called guest function detect_version_files  id="yarn" plugin="21080f1a-6da9-486b-a10d-4859509ec689" output={"files":["package.json"],"ignore":["node_modules"]}
[TRACE 18:12:37.525] proto_core::flow::resolve  Attempting to detect a version from directory  tool="yarn" dir="C:\\Users\\dan\\.proto"
[TRACE 18:12:37.525] warpgate::plugin  Calling guest function detect_version_files  id="rust" plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c" input={}
[TRACE 18:12:37.525] warpgate::plugin  Called guest function detect_version_files  id="rust" plugin="1aeb586b-acde-4c93-9295-0c604ddc3a2c" output={"files":["rust-toolchain.toml","rust-toolchain"]}
[TRACE 18:12:37.526] proto_core::flow::resolve  Attempting to detect a version from directory  tool="rust" dir="C:\\Users\\dan\\.proto"
[TRACE 18:12:37.526] warpgate::plugin  Calling guest function detect_version_files  id="go" plugin="809b50df-9892-47da-906f-e4bc68bf49d1" input={}
[TRACE 18:12:37.527] warpgate::plugin  Called guest function detect_version_files  id="go" plugin="809b50df-9892-47da-906f-e4bc68bf49d1" output={"files":["go.mod","go.work"]}
[TRACE 18:12:37.527] proto_core::flow::resolve  Attempting to detect a version from directory  tool="go" dir="C:\\Users\\dan\\.proto"
python ━━━━━━━━━━━━━━━━━━━━ |
  deno ━━━━━━━━━━━━━━━━━━━━ |
  pnpm ━━━━━━━━━━━━━━━━━━━━ |
python ━━━━━━━━━━━━━━━━━━━━ |
  deno ━━━━━━━━━━━━━━━━━━━━ | Installing Deno latest
python ━━━━━━━━━━━━━━━━━━━━ |
  deno ━━━━━━━━━━━━━━━━━━━━ | Installing Deno latest
  pnpm ━━━━━━━━━━━━━━━━━━━━ | Installing pnpm latest
python ━━━━━━━━━━━━━━━━━━━━ | Installing Python ~3.11
  deno ━━━━━━━━━━━━━━━━━━━━ | Installing Deno latest
  node ━━━━━━━━━━━━━━━━━━━━ |
  pnpm ━━━━━━━━━━━━━━━━━━━━ | Installing pnpm latest
python ━━━━━━━━━━━━━━━━━━━━ | Installing Python ~3.11
  deno ━━━━━━━━━━━━━━━━━━━━ | Installing Deno latest
  node ━━━━━━━━━━━━━━━━━━━━ | Installing Node.js 22.9.0
python ━━━━━━━━━━━━━━━━━━━━ | Installing Python ~3.11
   bun ━━━━━━━━━━━━━━━━━━━━ |
  deno ━━━━━━━━━━━━━━━━━━━━ | Installing Deno latest
  node ━━━━━━━━━━━━━━━━━━━━ | Installing Node.js 22.9.0
python ━━━━━━━━━━━━━━━━━━━━ | Installing Python ~3.11
   bun ━━━━━━━━━━━━━━━━━━━━ | Installing Bun latest
  deno ━━━━━━━━━━━━━━━━━━━━ | Installing Deno latest
  node ━━━━━━━━━━━━━━━━━━━━ | Installing Node.js 22.9.0
  pnpm ━━━━━━━━━━━━━━━━━━━━ | Installing pnpm latest
   npm ━━━━━━━━━━━━━━━━━━━━ | Installing npm 10.9.0
[DEBUG 18:12:37.571] proto_core::flow::resolve  Resolving a semantic version or alias  tool="node" initial_version="22.9.0"
[TRACE 18:12:37.571] warpgate::host  Calling host function send_request  plugin="6cf8629f-04d6-4296-a3da-aee51b74c01f" input={"url":"https://registry.npmjs.org/npm/"}
[TRACE 18:12:37.571] warpgate::plugin  Calling guest function load_versions  id="deno" plugin="54717592-c407-4187-a5f4-004b39e23150" input={"initial":"latest"}
[DEBUG 18:12:37.572] proto_core::flow::resolve  Loading available versions  tool="python"
[DEBUG 18:12:37.573] proto_core::flow::resolve  Loading available versions  tool="node"
[TRACE 18:12:37.573] warpgate::plugin  Calling guest function load_versions  id="pnpm" plugin="1e2b9b5b-6df9-4979-9ce9-6caf23402361" input={"initial":"latest"}
[DEBUG 18:12:37.574] extism::pdk  Loading Git tags from remote https://github.com/denoland/deno  plugin="54717592-c407-4187-a5f4-004b39e23150"
[DEBUG 18:12:37.574] proto_core::flow::resolve  Resolving a semantic version or alias  tool="bun" initial_version="latest"
[TRACE 18:12:37.574] warpgate::plugin  Calling guest function load_versions  id="python" plugin="8db3fe24-d3ad-4a9c-87b2-05362fd14b1a" input={"initial":"~3.11"}
[DEBUG 18:12:37.576] proto_core::flow::resolve  Loading available versions  tool="bun"
[TRACE 18:12:37.575] warpgate::host  Calling host function send_request  plugin="1e2b9b5b-6df9-4979-9ce9-6caf23402361" input={"url":"https://registry.npmjs.org/pnpm/"}
[TRACE 18:12:37.576] warpgate::host  Calling host function exec_command  plugin="54717592-c407-4187-a5f4-004b39e23150" input={"command":"git","args":["ls-remote","--tags","--sort","version:refname","https://github.com/denoland/deno"],"env":{},"set_executable":false,"stream":false,"working_dir":null}
[TRACE 18:12:37.575] warpgate::plugin  Calling guest function load_versions  id="node" plugin="2c67be8d-b3da-4cb8-87c9-61e23310d451" input={"initial":"22.9.0"}
[DEBUG 18:12:37.576] extism::pdk  Loading Git tags from remote https://github.com/python/cpython  plugin="8db3fe24-d3ad-4a9c-87b2-05362fd14b1a"
[TRACE 18:12:37.577] warpgate::plugin  Calling guest function load_versions  id="bun" plugin="e38f73de-f9f9-464d-b38f-86e4bcdf4a69" input={"initial":"latest"}
[TRACE 18:12:37.578] warpgate::host  Calling host function send_request  plugin="2c67be8d-b3da-4cb8-87c9-61e23310d451" input={"url":"https://nodejs.org/download/release/index.json"}
python ━━━━━━━━━━━━━━━━━━━━ | Installing Python ~3.11
   bun ━━━━━━━━━━━━━━━━━━━━ | Installing Bun latest
  node ━━━━━━━━━━━━━━━━━━━━ | Installing Node.js 22.9.0
  pnpm ━━━━━━━━━━━━━━━━━━━━ | Installing pnpm latest
   bun ━━━━━━━━━━━━━━━━━━━━ | Installing Bun latest
  node ━━━━━━━━━━━━━━━━━━━━ | Installing Node.js 22.9.0
  pnpm ━━━━━━━━━━━━━━━━━━━━ | Installing pnpm latest
   npm ━━━━━━━━━━━━━━━━━━━━ | Installing npm 10.9.0[TRACE 18:12:37.581] starbase::app  Running shutdown phase (because another phase failed)
Error:   × Main thread panicked.
  ├─▶ at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-
  │   1.40.0\src\runtime\time\entry.rs:568:9
  ╰─▶ A Tokio 1.x context was found, but it is being shutdown.
         0: 0x7ff7e39b6cca - <unresolved>
         1: 0x7ff7e39b6c1b - <unresolved>
         2: 0x7ff7e3dd89b0 - <unresolved>
         3: 0x7ff7e3dc160c - <unresolved>
         4: 0x7ff7e3dd3505 - <unresolved>
         5: 0x7ff7e3a43b09 - <unresolved>
         6: 0x7ff7e43fc255 - <unresolved>
         7: 0x7ff7e3dd7aec - <unresolved>
         8: 0x7ff7e44072cb - <unresolved>
         9: 0x7ff7e4407166 - <unresolved>
        10: 0x7ff7e4404c0f - <unresolved>
        11: 0x7ff7e4406d36 - <unresolved>
        12: 0x7ff7e493e904 - _jit_debug_register_code
        13: 0x7ff7e49847be - _jit_debug_register_code
        14: 0x7ff7e44407c8 - <unresolved>
        15: 0x7ff7e42bf228 - <unresolved>
        16: 0x7ff7e45201d6 - <unresolved>
        17: 0x7ff7e44fc679 - <unresolved>
        18: 0x7ff7e3ce26d3 - <unresolved>
        19: 0x7ff7e3c68054 - <unresolved>
        20: 0x24036b9592f - <unresolved>
        21: 0x24036a20965 - <unresolved>
        22: 0x24036b66145 - <unresolved>
        23: 0x24036b95021 - <unresolved>
        24: 0x7ff7e4891dc3 - _jit_debug_register_code
        25: 0x7ff7e3f6245a - <unresolved>
        26: 0x7ff7e3fc3702 - <unresolved>
        27: 0x7ff7e3fc16ca - <unresolved>
        28: 0x7ff7e3fbe551 - <unresolved>
        29: 0x7ff7e3e4eaec - <unresolved>
        30: 0x7ff7e3e4e385 - <unresolved>
        31: 0x7ff7e3e49acb - <unresolved>
        32: 0x7ff7e3e48f3a - <unresolved>
        33: 0x7ff7e404d111 - <unresolved>
        34: 0x7ff7e404cc3e - <unresolved>
        35: 0x7ff7e4055a9d - <unresolved>
        36: 0x7ff7e3f54f73 - <unresolved>
        37: 0x7ff7e44362dd - <unresolved>
        38: 0x7ff7e443543b - <unresolved>
        39: 0x7ff7e443a61c - <unresolved>
        40: 0x7ff7e442ee64 - <unresolved>
        41: 0x7ff7e442f846 - <unresolved>
        42: 0x7ff7e441598d - <unresolved>
        43: 0x7ffa2990dbe7 - BaseThreadInitThunk
        44: 0x7ffa2a8c5a4c - RtlUserThreadStart
  help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.

Operating system?

Windows

Architecture?

x64

milesj commented 1 month ago

We actually error when the command doesn't exist on the machine: https://github.com/moonrepo/proto/blob/master/crates/warpgate/src/host.rs#L165

So I'm not entirely sure git missing was the problem here.

rotu commented 1 month ago

I can see now that uninstalling git and trying again, I get the more comprehensible error:

Error: plugin::call_func::failed

× Command or script git does not exist. Unable to execute from plugin.

So I'm not sure what the original issue was either and I can't repeat it as such.

Maybe it had something to do with this. It looks like maybe we're qualifying pwsh by its full path and extension but not powershell: https://github.com/moonrepo/proto/blob/fbba5f20e540a86308ac8db6ba026d7501d3f940/crates/system-env/src/helpers.rs#L107-L108

milesj commented 1 month ago

Hrmm that's even more weird. Anytime I see the "A Tokio 1.x context was found, but it is being shutdown." error, I always assume Rust async just crashed in some weird way. I'm not even sure how to reproduce that.

rotu commented 1 month ago

I think it means that we're ending the program with some task is still in process.

Here's the relevant doc afaict. Hopefully, it makes more sense to you: https://docs.rs/tokio/latest/tokio/runtime/struct.Handle.html#method.block_on

Runs a future to completion on this Handle’s associated Runtime.

This runs the given future on the current thread, blocking until it is complete, and yielding its resolved result. Any tasks or timers which the future spawns internally will be executed on the runtime.

When this is used on a current_thread runtime, only the Runtime::block_on method can drive the IO and timer drivers, but the Handle::block_on method cannot drive them. This means that, when using this method on a current_thread runtime, anything that relies on IO or timers will not work unless there is another thread currently calling Runtime::block_on on the same runtime.

If the runtime has been shut down

If the Handle’s associated Runtime has been shut down (through Runtime::shutdown_background, Runtime::shutdown_timeout, or by dropping it) and Handle::block_on is used it might return an error or panic. Specifically IO resources will return an error and timers will panic. Runtime independent futures will run as normal.

Panics

This function panics if the provided future panics, if called within an asynchronous execution context, or if a timer future is executed on a runtime that has been shut down.

In particular, I don't understand how exec_command and send_request in warpgate host.rs and call in plugin.rs let the caller know that subprocess is complete (whether succeeded or failed) and it's safe to shut down now.

In terms of the logging above, I see a lot of "Calling host function" and not a lot of "Called host function". To make sense of the trace, (1) these should have some correlation ID unique to each call of exec_command so you can tell which end corresponds to which start (2) if the block ends with a premature return using ?, there's no way to know whether the task is still in flight.

Maybe some of the above is what #[instrument(name = "host_func_exec_command", skip_all)] is for and the issue template/troubleshooting tools should recommend using --dump or PROTO_DUMP? I wish I had gotten that output when I could reproduce the bug!

milesj commented 1 month ago

In particular, I don't understand how exec_command and send_request in warpgate host.rs and call in plugin.rs let the caller know that subprocess is complete (whether succeeded or failed) and it's safe to shut down now.

I agree, there's non-ideal layers here. However, extism (the plugin layer) is synchronous, so in this context, we don't need to wait for anything in the context of tokio/async. So if anything in extism errors, it just bubbles up.

The exception to this is send_request, which must spawn a blocking task in tokio, because reqwest requires tokio. This requirement is super annoying, but no other work around until extism supports async.

In terms of the logging above, I see a lot of "Calling host function" and not a lot of "Called host function". To make sense of the trace, (1) these should have some correlation ID unique to each call of exec_command so you can tell which end corresponds to which start (2) if the block ends with a premature return using ?, there's no way to know whether the task is still in flight.

Is the plugin field not enough data? That's already a UUID.

Maybe some of the above is what #[instrument(name = "host_func_exec_command", skip_all)] is for and the issue template/troubleshooting tools should recommend using --dump or PROTO_DUMP? I wish I had gotten that output when I could reproduce the bug!

These labels were in the logs before but it added sooo much noise that it became hard to read. So yeah, right now they are just in the dumps. I can maybe add an env var or something that toggles them on.

milesj commented 1 month ago

Added --log verbose in v0.41.5

davidwinter commented 1 month ago

I think I might have experienced similar, but with proto install which I understand replaces proto use. I got the same error, so I tried installing each tool individually instead, in the form proto install rust 1.78.0 etc (for each tool and version in my .prototools file. I had the odd failure of node not installing, for the same reason as #615 actually - where an HTTP request failed. Another due to my own plugin not supporting ARM on Linux (which I aim to resolve separately - but for now will comment out).

So I wonder is this error because proto install spawns off multiple async processes to install each tool, and if one tool fails to install for one of the above reasons, then we're seeing this error?

I'll do some more investigataion myself, but wanted to braindump my initial findings in case it helps.

milesj commented 1 month ago

So I wonder is this error because proto install spawns off multiple async processes to install each tool, and if one tool fails to install for one of the above reasons, then we're seeing this error?

Yeah. Anytime a command has to process multiple tools, either loading or executing something, it's always done in parallel, 1 tool per 1 thread.

I try to provide human-readable error messages everywhere I can, so if something seems cryptic, or a panic occurs, that's usually somewhere outside of proto, most likely in a 3rd party library or the WASM layer. These are a bit harder to track down, especially WASM.

rotu commented 1 month ago

I don't see anything like TaskTracker and CancellationToken in the proto code. Here's how the tokio docs recommend shutting down: https://tokio.rs/tokio/topics/shutdown

milesj commented 1 month ago

I use JoinSets, which are very similar: https://docs.rs/tokio/latest/tokio/task/struct.JoinSet.html

I'm not sure a cancellation token would even help here with the panic in the original post.

rotu commented 1 month ago

I use JoinSets, which are very similar: https://docs.rs/tokio/latest/tokio/task/struct.JoinSet.html

It even has a comparison to JoinSet! Gosh I'm jealous of the Rust ecosystem and its documentation!

I'm not sure a cancellation token would even help here with the panic in the original post.

I think I need a trace catching the panic red-handed :-/. My backtrace is unfortunately not very useful. I'm reinstalling proto with cargo install --git https://github.com/moonrepo/proto.git proto_cli --debug --root $HOME/.proto --force to hopefully catch a better backtrace next time!

davidwinter commented 1 month ago

So digging into potential failures when installing a tool. I'm currently testing this on Windows, and when trying to install all tools, I was getting the panic and failure, so again, I try and install each tool individually. I just received this:

proto install node 20.12.2
Installing Node.js
Downloading pre-built archive
Error: net::http
  × Failed to make HTTP request for https://nodejs.org/download/release/
  │ v20.12.2/node-v20.12.2-win-x64.zip.
  ├─▶ error decoding response body
  ├─▶ error reading a body from connection
  ╰─▶ stream error received: unexpected internal error encountered

It might be the case that this is a different error to when I tried to just run proto install - but is there a reason why I don't get friendly errors currently, and only the tokio panic? It would at least be helpful when running proto install to know which tool failed, but perhaps, continue installing the others anyway?

Will continue to add any extra information I find - and also happy to help in any way I can. Currently trying to get some self-hosted GitHub Action runners setup across all platforms (macOS, Windows and Linux/Ubuntu), and proto will make this so much easier 🙏 - I really appreciate this tool and all it offers!

milesj commented 1 month ago

Yeah at least for proto install, I can look into not failing the entire install if 1 tool fails.

davidwinter commented 1 month ago

FYI the underlying connection issue I was encountering was down to DNS within a Windows VM: https://github.com/moonrepo/proto/issues/615#issuecomment-2422395741

But aside from that, the improvements to the error messages you mentioned above would be a great addition.