Make "path already scanned" message deterministic (#820)
When a symlink loop is detected, the following message is printed: > Path X has already been scanned. Cannot scan it again through symlink Y However, the actual symlink that is displayed depends on the order in with `readdir` outputs the contents (which depends on FS internals). This sorts the directory list so that the message is deterministic. It can be tested by adding for example a `List.rev` call after `Path.readdir`: the affected version will return a different version in the `github764` test. Signed-off-by: Etienne Millon <etienne@cryptosense.com>
This commit is contained in:
parent
171c22614d
commit
29f711985d
|
@ -199,6 +199,11 @@ let load ?(extra_ignored_subtrees=Path.Set.empty) path =
|
||||||
Left fn)
|
Left fn)
|
||||||
in
|
in
|
||||||
let files = String.Set.of_list files in
|
let files = String.Set.of_list files in
|
||||||
|
let sub_dirs =
|
||||||
|
List.sort
|
||||||
|
~compare:(fun (a, _, _) (b, _, _) -> String.compare a b)
|
||||||
|
sub_dirs
|
||||||
|
in
|
||||||
let project =
|
let project =
|
||||||
match Dune_project.load ~dir:path ~files with
|
match Dune_project.load ~dir:path ~files with
|
||||||
| Some _ as x -> x
|
| Some _ as x -> x
|
||||||
|
|
Loading…
Reference in New Issue