Skip to content

Commit

Permalink
improve "install fswatch" error for FreeBSD (ocaml#8555)
Browse files Browse the repository at this point in the history
On FreeBSD fswatch is packaged under fswatch-mon and fswatch is a
completely unrelated package. This might save some users some time.

We can also give hints for other platforms too, but I am unsure what the
best hints might be.

Signed-off-by: Ali Caglayan <[email protected]>
  • Loading branch information
Alizter authored Aug 31, 2023
1 parent 0ef41b6 commit 4f3bb25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dune_file_watcher/dune_file_watcher.ml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,13 @@ let fswatch_backend () =
in
match try_fswatch () with
| Some res -> res
| None -> User_error.raise [ Pp.text "Please install fswatch to enable watch mode." ]
| None ->
let hints =
match Platform.OS.value with
| FreeBSD -> [ Pp.text "pkg install fswatch-mon" ]
| _ -> []
in
User_error.raise ~hints [ Pp.text "Please install fswatch to enable watch mode." ]
;;

let select_watcher_backend () =
Expand Down

0 comments on commit 4f3bb25

Please sign in to comment.