charlesetc / feather

A shell library for OCaml
MIT License
77 stars 8 forks source link

Basic support for native Windows #23

Closed jonahbeckford closed 7 months ago

jonahbeckford commented 3 years ago

The first commit allows the following on native Windows:

#require "feather";;
open Feather;;
process "ps.exe" [] |> collect stdout;; 

Notice that ps.exe is required for Windows executables (on my system ps.exe comes from MSYS2; theoretically all your examples should work on MSYS2).


The second commit is to add the `.exe`` suffix to all executables on Windows if it doesn't have .exe already.


The let () = Caml.at_exit terminate_child_processes requires that pgrep is available to feather. That means native Windows users must have MSYS2. I've added pgrep to the next release of Diskuv OCaml which I recently announced; that way native Windows users can use feather out of the box.

Thanks for the nice tool!

charlesetc commented 3 years ago

Hey! Thanks for the PR and sorry for the delay. I'm glad you like Feather!

I think my main problem with supporting windows is that I don't have access to a windows machine or know how to set up one for testing on Github or if they support such a thing for free. Do you have any insights there? I'll review these specific changes if we can resolve that issue, though fair warning I don't have a lot of time to put into Feather nowadays.

Thanks again!

BTW diskuv looks really cool :)

jonahbeckford commented 3 years ago

No problem; no urgency: For now I've been building on top of bos but would like to switch to the more full-featured feather when it can be supported correctly.

Testing on Windows + GitHub? I just announced on https://discuss.ocaml.org/t/ann-windows-friendly-ocaml-4-12-distribution-2nd-preview-release-0-2-0/8488/6 that a first version of a Vagrant script was available for macOS and Linux users. For example https://github.com/diskuv/diskuv-ocaml-ghmirror/actions/runs/1506768800 is a GitHub Action running on macOS that builds everything from scratch. Just as important, as long as you have VirtualBox + Vagrant you can spin up a running Windows VM with the full correctly-licensed Windows UI + OCaml.

I'll package that up (in a month or so; I need good documentation) and make a standalone distribution + announcement. Would you be interested in trying that when it is ready? Would you need anything else? Thanks!

charlesetc commented 7 months ago

I'm sorry to have let this stagnate — I think it's best given my lack of access and understanding of windows to keep Feather unix-only for now and then people can pin your fork as necessary. Happy to revisit if there's interest in the future. Thanks for bringing it up and getting a working solution :)