Windows Support #66
Replies: 11 comments 15 replies
-
We would also need to implement the shell code for powershell. I assume this is possible but I don't know for sure. EDIT: to set expectations: windows support isn't something I'm likely to accomplish. I don't use windows or have much interest in the platform. If someone wants to figure out how to do this I'd be more than happy to work with them and accept a PR though. Discord is always open if you want to chat too. |
Beta Was this translation helpful? Give feedback.
-
Have you considered leveraging the MSYS2 ecosystem for this? I've used MSYS2-based shell on Windows for 2+ years and I'm generally quite happy with the outcomes. Although using it as a main shell had some pitfalls we could hide it inside rtx as the plugins don't get executed directly by a user. |
Beta Was this translation helpful? Give feedback.
-
I'm adding my own vision here since I'm also starting my own asdf-clone (I'm new to rust here, so some patterns might be a bit weird) project before finding out about this project and try not to re-invent any wheel here. I was looking into a more extensible ecosystem and not limited to just shell or power shell. My idea and attempt at it would be using Lua as a plugin's main language and having a set of standardized APIs around it to make it easy to work with. The only requirement for a plugin is to have an entry point to its lua file. Now for backward compatibility, if a plugin doesn't contain an entry file, we shipped rtx with a default entry point and have it use this script instead (this would make existing asdf's plugins compatible with rtx). With these Lua plugins, one could leverage the API available to check and perform a corresponding action based on it. So the said default script could look something like this (just to give a brief idea, not an actual implementation) local M = {}
local exec = function ()
if api.platform() == 'win' then
return 'bash'
else
return 'pwsh'
end
end
-- this could take optional arguments to differentiate between list and list all script
M.list = function ()
-- this is to make it backward compatible with existing asdf's plugins
api.spawn(exec(), 'bin/list-all')
end
M.download = function ()
api.spawn(exec(), 'bin/download')
-- or use shipped API to do it
api.download('https://example.com/to/download/path', api.fs.temp())
end
M.install = function ()
api.spawn(exec(), 'bin/install')
end
M.latest = function ()
api.spawn(exec(), 'bin/latest-stable')
end
-- ... on and on...
return M The (non-exhaustive) list of APIs I had in mind was something like this...
|
Beta Was this translation helpful? Give feedback.
-
https://github.com/sagiegurari/cargo-make appears to compile bash scripts into a portable scripting engine called duckscript, which works on Windows. Not sure about the scope of the compilation, though. |
Beta Was this translation helpful? Give feedback.
-
I've never used it, but apparently the cygwin project is capable of executing shell scripts on windows. Could have a build script for windows that tries to execute cygwin and if it fails, error out and display a message telling the user to install it first. Would need to do some experimenting with it using some actual asdf scripts to make sure it works reasonably well. |
Beta Was this translation helpful? Give feedback.
-
There's WSL (version 2 is better) now on windows and it works quite well now. Why don't use it ? You can use a lot of Linux distros |
Beta Was this translation helpful? Give feedback.
-
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview |
Beta Was this translation helpful? Give feedback.
-
How about using git-scm's Git Bash as a pre-requisite? |
Beta Was this translation helpful? Give feedback.
-
What is the main blocker for this? After reading through I'm not sure to grasp it sorry. |
Beta Was this translation helpful? Give feedback.
-
I mentioned this in #1933 but supporting vfox (which promises good windows compatibility in general) might be a good way to for us to solve the problem of running bash code by using vfox plugins instead of asdf. That isn't everything we need for windows compatibility but it's the biggest chunk of effort for sure. If anyone wants to contribute to help make mise-on-windows a reality I would consider starting with supporting vfox as a backend first, then trying to get the CLI to execute on windows. |
Beta Was this translation helpful? Give feedback.
-
very basic windows support is now available for tools. So far python and node seem to work, as well as a handful of vfox plugins. vfox plugins which use the html module do not work yet though—as well as probably several other bugs. Don't expect it to work well, but I was able to get very simple commands to run at least. |
Beta Was this translation helpful? Give feedback.
-
asdf comprises 2 main parts:
asdf
CLIThe
asdf
CLI, being written in bash, does not support running on windows (outside of WSL).rtx
, however, being written in rust, would.Most asdf plugins are also written in bash, and rtx leans on the asdf ecosystem for plugins.
To address the plugin issue, I propose:
EDIT FROM @jdx
this work has begun and the major prerequisite can be discussed here: #2051
Beta Was this translation helpful? Give feedback.
All reactions