Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

fix: Fix Windows globals lookup dirs. #7

Merged
merged 6 commits into from
Nov 22, 2023
Merged

Conversation

milesj
Copy link
Contributor

@milesj milesj commented Nov 21, 2023

@milesj
Copy link
Contributor Author

milesj commented Nov 22, 2023

@rotu I think this is the winner.

@milesj milesj merged commit f4eb9ad into master Nov 22, 2023
8 checks passed
@milesj milesj deleted the fix-windows-globals branch November 22, 2023 21:59
@rotu
Copy link

rotu commented Nov 22, 2023

Sweet! Can confirm this worked for me to install pdm. But `proto list-global I think is still looking at the old directory:

[TRACE 32:36.864] warpgate::plugin:list_global  Calling plugin function locate_executables  plugin="python" input={"context":{"tool_dir":{"path":"/proto/tools/python/latest","virtual_prefix":"/proto","real_prefix":"C:\\Users\\dan\\.proto"},"version":"latest"}}
[TRACE 32:36.865] warpgate::plugin:list_global  Called plugin function locate_executables  plugin="python" output={"globals_lookup_dirs":["$HOME/.local/bin"],"primary":{"exe_path":"install/bin/python3.exe","parent_exe_name":null},"secondary":{"pip":{"no_bin":true,"parent_exe_name":null,"shim_before_args":"-m pip"}}}
[DEBUG 32:36.865] proto_core::tool:list_global  Found a globals directory  tool="python" bin_dir="C:\\Users\\dan/.local/bin"
[DEBUG 32:36.866] proto::commands::list_global:list_global  Finding global packages  globals_dir="C:\\Users\\dan/.local/bin"
No global packages installed

@rotu
Copy link

rotu commented Nov 22, 2023

Actually not sure if it's pulling in the updated plugin right

@rotu
Copy link

rotu commented Nov 22, 2023

Yep. Here it is. Plugin version 0.3.0. Global directory ~\.proto\tools\python\3.12.0/install/Scripts on my PATH, but not seeing installed globals. This may be because list-global needs the same change to resolve the path ($PROTO_HOME\tools\python\latest/install/Scripts versus $PROTO_HOME\tools\python\3.12.0/install/Scripts)

proto list-global python --log trace
[DEBUG 2023-11-22 16:44:14] proto  Running proto v0.23.3  args=["C:\\Users\\dan\\.proto\\bin\\proto.exe", "list-global", "python", "--log", "trace"]
[TRACE 44:14.147] starbase::app  Running startup phase with 1 systems
[TRACE 44:14.148] starbase::app  Running analyze phase with 1 systems
[TRACE 44:14.148] starbase::app  Running execute phase with 2 systems
[DEBUG 44:14.152] proto_core::user_config:list_global  Loading config.toml  file="C:\\Users\\dan\\.proto\\config.toml"
[TRACE 44:14.152] starbase_utils::fs:list_global  Reading file  file="C:\\Users\\dan\\.proto\\config.toml"
[DEBUG 44:14.153] proto_core::tool_loader:list_global  Traversing upwards to find a configured plugin  tool="python"
[DEBUG 44:14.153] proto_core::tools_config:list_global  Loading .prototools  file="C:\\Users\\dan\\.prototools"
[TRACE 44:14.154] starbase_utils::fs:list_global  Reading file  file="C:\\Users\\dan\\.prototools"
[TRACE 44:14.164] warpgate::loader:list_global  Creating plugin loader  cache_dir="C:\\Users\\dan\\.proto\\plugins"
[TRACE 44:14.165] warpgate::loader:list_global  Loading plugin python  plugin="python"
[TRACE 44:14.166] warpgate::loader:list_global  Using source file  plugin="python" path="\\\\?\\C:\\Users\\dan\\Source\\proto-python\\target\\wasm32-wasi\\debug\\python_plugin.wasm"
[DEBUG 44:14.166] proto_core::tool_loader:list_global  Loading WASM plugin  source="\\\\?\\C:\\Users\\dan\\Source\\proto-python\\target\\wasm32-wasi\\debug\\python_plugin.wasm"
[TRACE 44:14.167] proto_core::tool_loader:list_global  Storing tool identifier  id="python"
[TRACE 44:14.167] proto_core::tool_loader:list_global  Storing user configuration  config={"auto_clean":true,"auto_install":true,"node_intercept_globals":true}
[TRACE 44:14.167] proto_core::tool_loader:list_global  Storing proto environment  env={"arch":"x64","os":"windows","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"C:\\Users\\dan"},"proto_dir":{"path":"/proto/","virtual_prefix":"/proto","real_prefix":"C:\\Users\\dan\\.proto"}}
[DEBUG 44:14.168] proto_core::tool:list_global  Creating tool python and instantiating plugin
[DEBUG 44:14.168] proto_core::tool_manifest:list_global:load  Loading manifest.json  file="C:\\Users\\dan\\.proto\\tools\\python\\manifest.json"
[TRACE 44:14.169] starbase_utils::fs:list_global:load  Opening file  file="C:\\Users\\dan\\.proto\\tools\\python\\manifest.json"
[TRACE 44:14.169] starbase_utils::fs_lock:list_global:load  Locking file  file="C:\\Users\\dan\\.proto\\tools\\python\\manifest.json"
[TRACE 44:14.170] starbase_utils::fs_lock:list_global:load  Unlocking file  file="C:\\Users\\dan\\.proto\\tools\\python\\manifest.json"
[DEBUG 44:14.774] proto_core::tool:list_global  Created tool python and its WASM runtime
[TRACE 44:14.775] warpgate::plugin:list_global  Calling plugin function register_tool  plugin="python" input={"id":"python"}
[TRACE 44:14.776] warpgate::plugin:list_global  Called plugin function register_tool  plugin="python" output={"inventory":{},"name":"Python","plugin_version":"0.3.0","type":"Language"}
[DEBUG 44:14.777] proto_core::tool:list_global  Locating globals bin directory for tool  tool="python"
[TRACE 44:14.777] warpgate::plugin:list_global  Calling plugin function locate_executables  plugin="python" input={"context":{"tool_dir":{"path":"/proto/tools/python/latest","virtual_prefix":"/proto","real_prefix":"C:\\Users\\dan\\.proto"},"version":"latest"}}
[TRACE 44:14.779] warpgate::plugin:list_global  Called plugin function locate_executables  plugin="python" output={"globals_lookup_dirs":["$TOOL_DIR/install/Scripts"],"primary":{"exe_path":"install/python.exe"},"secondary":{"pip":{"no_bin":true,"shim_before_args":"-m pip"}}}
[DEBUG 44:14.780] proto_core::tool:list_global  Found a globals directory  tool="python" bin_dir="C:\\Users\\dan\\.proto\\tools\\python\\latest/install/Scripts"
[DEBUG 44:14.780] proto::commands::list_global:list_global  Finding global packages  globals_dir="C:\\Users\\dan\\.proto\\tools\\python\\latest/install/Scripts"
No global packages installed

@milesj
Copy link
Contributor Author

milesj commented Nov 22, 2023

Yeah easy enough, will put in the next patch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants