fsprojects / FsReveal

FsReveal parses markdown and F# script file and generates reveal.js slides.
http://fsprojects.github.io/FsReveal
258 stars 100 forks source link

Slide edits are not detected on Linux #95

Open fbehrens opened 8 years ago

fbehrens commented 8 years ago

on Ubuntu 14.04.4 Fsharp 4.0 Mono JIT compiler version 4.2.2 (Stable 4.2.2.30/996df3c Mon Feb 15 17:30:30 UTC 2016)

rmunn commented 8 years ago

I see this behavior too, on Linux Mint Debian Edition 2, with Mono 4.2.3 (Stable 4.2.3.4/832de4b Wed Mar 16 13:19:08 UTC 2016). I did see the WatchChanges task run correctly once, but every other time I ran it it failed to detect changes.

This appears to be connected to https://github.com/OmniSharp/generator-aspnet/issues/138. https://fsharp.github.io/FAKE/watch.html says to add MONO_MANAGED_WATCHER=false to your environment before running FAKE, and that worked for me. Either run export MONO_MANAGED_WATCHER=false and then run build.sh, or (my preference) run:

MONO_MANAGED_WATCHER=false ./build.sh

This will force Mono to use a different (and, I believe, less efficient) method to watch the file system (I think it polls rather than rely on the kernel's inotify subsystem). This is not ideal for production use, which is why I don't recommend using export to set this environment variable. Instead, use the MONO_MANAGED_WATCHER=false ./build.sh form (without export) to set it only while running ./build.sh and editing your FsReveal slides.

This workaround worked for me: when running with MONO_MANAGED_WATCHER=false, my slide changes were detected every time.