akash-akya / vix

Elixir extension for libvips
MIT License
172 stars 20 forks source link

Add support for Windows #79

Open akash-akya opened 1 year ago

akash-akya commented 1 year ago

https://elixirforum.com/t/nmake-fatal-error-u1052-file-makefile-win-not-found-vix-image/52208

akash-akya commented 1 year ago

Could be addressed together with support for pre-compiled binaries: https://github.com/akash-akya/vix/issues/77#issuecomment-1307024371

akash-akya commented 1 year ago

TODO

aiwaiwa commented 1 year ago

Seeing @release_tag "8.14.1.rc3" that is used for downloads from sharp-libvips doesn't look like available. The latest there is v8.14.0-rc1. That could lead to no pre-built downloaded at all, I'm only theorizing.

akash-akya commented 1 year ago

I am not directly using the sharp-libvips binaries, I have a separate fork since the upstream does not work as is.

Fork repo we are using is this - https://github.com/akash-akya/sharp-libvips/releases/tag/v8.14.1.rc3

Also there 2 things here:

So even if there is prebuilt libvips, we still need a way to compile NIF, currently our makefile only works for UNIX like systems.

aiwaiwa commented 1 year ago

Oh got it. Misread the links! I've tried to see how argon2_elixir builds because it does build on a Windows machine, provided the mix deps.compile is initiated from Developer Command Prompt, and it apparently requires a Makefile.win which has a little different syntax than Makefile and somehow uses nmake.

akash-akya commented 1 year ago

That's correct. I just have to create a Makefile for windows for nif to work. Unlike other nif, here we have lot of dependencies involved, so just want to test it properly before releasing.

aiwaiwa commented 1 year ago

You are great! I can help with testing for sure! Although bringing a VirtualBox Windows might be much easier to deal with.

So far my setup was simply to get vs_BuildTools.exe and [x] Desktop Development With C++ Workflow

mrdotb commented 1 year ago

Hello,

I make an attempt to compile Vix on windows.

I pulled the last windows release from the sharp-libvips fork and stick it in c_src for now.

The Makefile.win on my fork.

This makefile.win give this result The missing pieces now it's to port the code that's unix like to windows. The pipe, fcntl and read, write, close have different API on windows.

I don't have much experience in C and no experience at all in porting unix code to windows.

If someone want to dig in you can start with that :)

akash-akya commented 1 year ago

Hi @mrdotb, That's great news! Creating Makefile is the correct first step. I have to take a closer look, but thanks for the trying it out and sharing! Been bit busy with current job, hopefully I'll get some time next month to do this.

ramyma commented 11 months ago

Any updates on this issue? Is there a way to use Vix on Windows without using WSL?

akash-akya commented 11 months ago

Hey @ramyma,

Unfortunately there is no progress. I do want to provide support for windows but blocker for me is that I don't have a windows system at hand to experiment and test. The mac laptop I have does not have enough space left to run windows inside VM.

I'll try to make room and run windows vm in sometime but not sure about the timeline.

Thanks

ramyma commented 11 months ago

Thanks @akash-akya, I hope it's not too hard to get around; I'm trying to distribute an application on Windows, and I hit a wall due to this issue.

Please let me know if I can help you out somehow.

I appreciate your effort :pray:

ramyma commented 8 months ago

@akash-akya Is there a chance we can get native Windows support?

akash-akya commented 7 months ago

Hey @ramyma, sorry for the late response.

As for the Windows support, unfortunately my situation is still same as https://github.com/akash-akya/vix/issues/79#issuecomment-1874921575. Even if I add support now, maintaining it will take some constant effort without device at hand. Especially so because libvips has a lot of libraries which gets updated frequently.

That said, I'll see if I can get a working version first, later we'll see about maintaining it.

ramyma commented 7 months ago

Thanks, appreciated!