jessedoyle / duktape.cr

Evaluate JavaScript from Crystal!
MIT License
137 stars 17 forks source link

Windows support #75

Open devnote-dev opened 1 year ago

devnote-dev commented 1 year ago

This PR adds bindings for Duktape to Crystal on Windows, this requires changing the use of Make to a more compatible solution: I've gone with Just which is well-made and used heavily within other ecosystems like *nix. This should also work with shards install on Windows (verified locally) but there are a couple of edge-cases.

z64 commented 1 year ago

Especially being a 1.x shard, I don't agree with removing the Makefile - this will probably break the majority of people's builds using Duktape to no longer be able to install it without intervening to install Just in order to build this shard.

Ideally, we would use nothing that we can't assume people don't already have - make is basically guarenteed on Linux, on Windows I see most libraries (in other languages besides Crystal) simply using a batch file - which would be great.

If we want to keep both Makefile for *nix and Justfile for windows, that is fine by me, I personally don't have any stake in Windows - but we shouldn't break Linux builds.

devnote-dev commented 1 year ago

That's fair, I hadn't considered that. At the same time, this would make the install process longer because of https://github.com/crystal-lang/shards/issues/468. I guess that's not really this shard's problem though, so I'll add the Makefiles back.

jessedoyle commented 1 year ago

Hi @devnote-dev! First off, I just want to say that this is amazing - thanks so much for this work!

Second, I want to apologize for the radio silence. I've been on vacation the past few weeks and am just getting caught up on everything.

Haven't had great chance to review this yet, so please give me a few weeks to get this work reviewed. Rest assured, I'd love to merge any PRs that add support for Windows.

I agree with @z64 around the use of make for *nix platforms - it's the de facto build mechanism for these these platforms.

I'll give this a review over the next few weeks. Thanks again!