Closed josevalim closed 9 years ago
Hi, Jose!
Having fs
working without any additional packages or ports is a dream. The problem is that on linux you need to include dependency on inotifywait
packages. Obviously you can't include binary for all architectures. That's why we don't promote binaries to repositories, because anyway on Linux you should compile first to be sure it runs on your platform. The good thing is that Linux provides the inotify-tools
package. So the same thing should be on other platforms, like Windows.
All back-end drivers are implemented as erlang ports with erlang:open_port/2
. We do have support of Windows in latest PR from https://github.com/sergej-klimenko/fs/commit/4bbd5021d8de1ee64d0dbaee0fa3a6e755aa2efa
The only thing you need is to draft mix project file for fs
which I could include in fs
root directory.
Anyway you could draft your PR and I will comment on it further.
Exactly. Linux already has fantastic support, most distributions have inotify-tools as a package and installing is easy. On Mac, rebar covers the compilation quite well.
On Windows though, we would need to provide at least two Makefiles, one for cygwin and another for Visual Studio, do environment checks to be sure which Makefile to invoke and so on. I have been down that road and it is not pretty, so it is easier to ship with the precompiled version. For that, I have opened a pull request here: #4.
I will open up another pull request for Mix later. I will try to get rid of the other c-dependency though. :)
I leaved pre hooks, cos we need it in production CI.
I have been down that road and it is not pretty
You can show me, I can apply this to fs. Anyway if users want to build themselves they should be able. binary will still be provided.
Sure! If you are curious, for non-cygwin, you need to provide a Makefile.win and invoke it with nmake. Here is an example from the markdown project:
https://github.com/devinus/markdown/blob/master/Makefile.win
And here is how we invoke it:
Cool I will apply this to fs later, thanks.
First off, thanks for the great tool! @chrismccord has done some experiments to integrate
fs
with Phoenix live reload and now we have changes instantly propagating to the browser as soon as we save an asset or Elixir file to disk.That said, we are planning to move ahead and make this project a Phoenix dependency. Our biggest pain point though has been Windows support. There are a couple issues:
However, I realized the Windows executable is not a port and it does not rely on the Erlang runtime. So I wondered, why not ship the precompiled windows executable inside priv? The .exe file is only 15Kb and this seems to be a fairly low price to pay to ensure compatibility across the board. :)
If you agree, I will gladly to send a PR.
Thanks!