-
Notifications
You must be signed in to change notification settings - Fork 52
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
Update to support running on Windows #1617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chhackett, I look forward to playing Swarm on Windows. 🚀
Could you please also update the CI file and add Windows to the test matrix?
swarm.cabal
Outdated
if os(windows) | ||
build-depends: vty-windows >= 0.1.0.3 && < 1.0 | ||
else | ||
build-depends: vty-unix >= 0.1.0.0 && < 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use only vty-crossplatform? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason for the explicit dependency on unix/windows libraries is because the ColorMode setting is not part of the default configuration anymore, but down in the unix/windows settings.
That is an unfortunate consequence of the design choice we made in how to split up the unix/windows implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now that I'm thinking about this, I wonder if we made a mistake by putting ColorMode in the UnixSettings/WindowsSettings data types. It is something that we could potentially add to the VtyUserConfig
since both implementations support it.
That would make one less reason for users to need to have an explicit dependency on the unix/windows plugins.
@jtdaugherty - what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking back at the change history, this was an oversight. I moved the color mode detection code to vty-unix
, but there was a lot going on with the split-up of Config
that the color mode setting got moved in the shuffle. Since the ColorMode
type lives in vty
, it makes sense to me to put that in the Vty user config as well, even if the backend packages still do their own detection. I think the caveat would be that backends might need to ignore or override the setting if it's unsuitable, but that was already true before Vty 6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into the implementation and see what this would involve.
I'd be happy to do that, but I'm not sure what change I should make to the CI file (assuming you mean cabal.haskell-ci). And I don't know where to find the test matrix. Sorry, I'm new to contributing to github projects. |
@xsebek Unfortunately, as far as I can tell, there is no Windows version. Am I missing something? |
@chhackett I believe you would want to define new job for windows(as done here) with it's own steps and compiler matrix for windows. This line here specifies the runner OS. Unfortunately you can't reuse much of the setup code in the linux runner, since it's linux specific, but you can use it as a reference on what needs to be done on windows runner. That said, it's a hard task, if you aren't familiar with github workflows and windows, albeit an interesting one and will definitely add something to your toolbox. |
@p3rsik @xsebek And just to be clear, I'm not promising I'll ever get around to doing this. I contributed this PR in the spirit of being helpful. But I want to stay focused on improving the experience of using vty/brick on Windows, at least for now. |
@chhackett No worries! We really appreciate the contribution, and your work on vty + brick. One of the rest of us can definitely take on the task of setting up the CI for Windows. |
Incidentally, the |
I forgot it was so linux specific, we can look into it separately - let's just add an Issue for Windows CI. |
So it sounds like there may be changes coming which would allow us to depend only on |
@byorgey I plan on looking into it more tonight. I started working on a patch earlier today, but it turns out that it's awkward to have a setting in |
@jtdaugherty OK, thanks, no rush. We'll go ahead and merge this, but I'll add an issue to remind us to possibly update in the future. Conceptually, I'd love to eventually be able to depend only on |
Understood, and I definitely don't see depending on specific platform packages as a good thing, either, if you're going for cross-platform support. So I will aim for something that removes that requirement. |
Added support for running on Windows, in command line or Powershell terminals.
Currently terminal emulators such as mintty, ConEmu, alacritty, etc are not supported.
Addresses issues #1607 and #53.