-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: watch mode when PATH contains CWD
On MacOS, PATH=.:PWD would add build paths to the list of directories being watched. Fsevents only reports absolute paths, so we need to try and convert them to build/source/external paths. On Linux, watching . would produce relative (source paths), so this issue wouldn't occur. Signed-off-by: Rudi Grinberg <[email protected]>
- Loading branch information
Showing
10 changed files
with
60 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module OS = struct | ||
type t = | ||
| Darwin | ||
| Other | ||
|
||
let equal = Poly.equal | ||
|
||
external is_darwin : unit -> bool = "stdune_is_darwin" | ||
|
||
let to_dyn = function | ||
| Darwin -> Dyn.variant "Darwin" [] | ||
| Other -> Dyn.variant "Other" [] | ||
|
||
let value = if is_darwin () then Darwin else Other | ||
end | ||
|
||
let assert_os what = | ||
if not (OS.equal OS.value what) then | ||
Code_error.raise "unexpected os" [ ("os", OS.(to_dyn value)) ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module OS : sig | ||
type t = | ||
| Darwin | ||
| Other | ||
|
||
val value : t | ||
end | ||
|
||
val assert_os : OS.t -> unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <caml/memory.h> | ||
#include <caml/mlvalues.h> | ||
|
||
CAMLprim value stdune_is_darwin(value v_unit) { | ||
CAMLparam1(v_unit); | ||
#if defined(__APPLE__) | ||
CAMLreturn(Val_true); | ||
#else | ||
CAMLreturn(Val_false); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters