rescript-labs / decco

Bucklescript PPX which generates JSON (de)serializers for user-defined types
MIT License
226 stars 27 forks source link

Windows support #20

Closed ryb73 closed 3 years ago

mrmurphy commented 4 years ago

We could get windows support one of two ways:

Does this seem like a good first issue?

ryb73 commented 4 years ago

Yeah, it'd be nice for the ppx to work the same for Windows users as it does for Mac and Linux. I've been wanting to get my Windows machine working so I can look at this but haven't gotten around to it. It'd be great to have someone work on it!

Re: github actions vs travis: I haven't looked closely at github actions yet; does it provide similar functionality to travis? If I remember correctly Travis does support Windows but I was having trouble getting it working, which is why I only included Mac and Linux. I'd be interested in exploring GitHub Actions though.

TheSpyder commented 4 years ago

What would be needed to contribute this? I'm starting to evaluate decco for a project but we run CI tests on Windows which means we need to be able to compile on Windows. I might be able to allocate some time to fixing this.

Would you prefer Travis for windows or github actions (which yes are similar to Travis)?

TheSpyder commented 4 years ago

I made some attempt to build on windows, initial failures were solved by using a newer version of OCaml. In the end I couldn't get past a mingw requirement. Even if I can get that working, it will really only be useful for validating the executable works. This isn't something I would know how to set up on travis or github actions.

Other projects I know that build with esy and offer windows builds all use azure pipelines, which are free for open source, so that's where I will focus my efforts: https://github.com/esy-ocaml/esy-ci-scripts

TheSpyder commented 4 years ago

SUCCESS! It took a lot of wrangling, but I have a passing build with binaries for linux, mac and windows: https://thespyder.visualstudio.com/Decco%20Builds/_build/results?buildId=29&view=artifacts&type=publishedArtifacts

The individual binaries are published by their respective builds, and then they are all brought together in the npm-package artifact. That could be downloaded as a zip and published as-is (in fact I just published it to my company's internal registry while I wait for help with what to do next).

As a part of this I built a ppx.cmd file to make it work with the --as-ppx command line on windows, and I have tested it on mac / windows / linux. https://github.com/TheSpyder/decco

ryb73 commented 4 years ago

That's awesome, thanks @TheSpyder! Would you be able to do a pull request? What are the missing links we need to figure out in order to incorporate it?

TheSpyder commented 4 years ago

There are a few things missing:

TheSpyder commented 3 years ago

Now that Travis has windows support, could you try enabling that and see if it works? I can then just PR my runtime scripts to make decco function on windows.

TheSpyder commented 3 years ago

I didn't realise pull requests are run on travis - I can just do that myself and see if it works.