Skip to content

Commit

Permalink
Check that deps are not in source
Browse files Browse the repository at this point in the history
  but in build or external.

Signed-off-by: François Bobot <[email protected]>
  • Loading branch information
bobot committed May 5, 2022
1 parent e15d00e commit 5d77345
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dune_util/value.ml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ let to_path ?error_loc t ~dir =
let to_path_in_build_or_external ?error_loc t ~dir =
match t with
| String s -> Path.relative_to_source_in_build_or_external ?error_loc ~dir s
| Dir p | Path p -> p
| Dir p | Path p ->
if Path.is_in_source_tree p then
Code_error.raise ?loc:error_loc
"to_path_in_build_or_external got a file in source directory"
[ ("path", Path.to_dyn p) ];
p

module L = struct
let to_dyn t = Dyn.List (List.map t ~f:to_dyn)
Expand Down

0 comments on commit 5d77345

Please sign in to comment.