panglesd / slipshow

An engine for displaying slips, the next-gen version of slides
MIT License
637 stars 10 forks source link

Unix.EOPNOTSUPP on arm64 #56

Open Guiraud opened 1 month ago

Guiraud commented 1 month ago

Hi on my Mac OS M2 pro (Silicon) :

slipshow -o file.html file.md --watch
compile: internal error, uncaught exception:
         Unix.Unix_error(Unix.EOPNOTSUPP, "inotify_init", "")

Here's some more info :

file $(which slipshow)
/Users/mguiraud/.local/bin/slipshow: Mach-O 64-bit executable arm64

And my mac :

Capture d’écran 2024-06-02 à 16 36 06

Seems some issue on the arm64 version of slipshow :

slipshow --version
%%VERSION%%

I used slipshow-macos-arm64.tar
decompile it and copied slipshow in the /usr/bin.

What am I missing ?

panglesd commented 1 month ago

Thanks for trying slipshow and sorry for the issue! My lack of knowledge of MacOS is guilty here...

Apparently, inotify (the utility that I use to watch changes on the source file) is a Linux only utility. Which is why it does not work on Mac... I should have used the fswatch library, which is cross platform.

One workaround (until I fix this) is to use fswatch (the binary). From what I understand, the syntax would be in your case:

$ fswatch --event Updated file.md | xargs -n 1 slipshow

(the --event is here to prevent some infinite loop where the call of slipshow file.md is caught by fswatch to trigger a new slipshow file.md...)

However, that is a workaround for the --watch argument, not the --serve. So you will have to reload file in the browser to see the changes, or find a workaround for --serve as well... Maybe the live-reload js library?

nilsbecker commented 3 weeks ago

thanks for the workaround. i found i had to tweak it slightly to make it more robust. i use this bash function now

slipwatch() {
    # a workaround for the missing watch functionality
    fswatch --print0 --event Updated "$1"  | xargs -0 -n 1 slipshow
}