You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7710 Reporter: baileyparker Status: resolved (set by @xavierleroy on 2018-02-11T13:55:42Z) Resolution: fixed Priority: normal Severity: minor Version: 4.06.0 Target version: 4.07.0+dev/beta2/rc1/rc2 Fixed in version: 4.07.0+dev/beta2/rc1/rc2 Category: tools (ocaml{lex,yacc,dep,debug,...}) Monitored by:@nojb@dbuenzli
Bug description
If you try running ocamldep on mli files that cyclicly reference eachother, you receive a warning printed to stderr, but ocamldep still prints an ordering and returns 0.
Given that cyclically referencing files are illegal, it should at least return a non-zero status (and probably shouldn't print an order since it is impossible to order cyclically referential files). Currently, when used in a scripting context, you have to (fragilely) search stderr for "Warning: cycle in dependencies." to determine if the output list is actually valid (because if you just try to ocamlc -c *.mli in the returned order you will get an unhelped message that B is unbound--not that there were cyclic references).
Steps to reproduce
a.mli:
type bill = { a : int }
val foo : B.baz -> int
b.mli:
type bar = { a : int; b : int }
val baz : bar -> A.bill -> int
Place the above into files in the same directory
Run ocamldep -sort a.mli b.mli
Notice the "Warning: cycle in dependencies. End of list is not sorted."
Original bug ID: 7710
Reporter: baileyparker
Status: resolved (set by @xavierleroy on 2018-02-11T13:55:42Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.06.0
Target version: 4.07.0+dev/beta2/rc1/rc2
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @nojb @dbuenzli
Bug description
If you try running ocamldep on mli files that cyclicly reference eachother, you receive a warning printed to stderr, but ocamldep still prints an ordering and returns 0.
Given that cyclically referencing files are illegal, it should at least return a non-zero status (and probably shouldn't print an order since it is impossible to order cyclically referential files). Currently, when used in a scripting context, you have to (fragilely) search stderr for "Warning: cycle in dependencies." to determine if the output list is actually valid (because if you just try to
ocamlc -c *.mli
in the returned order you will get an unhelped message that B is unbound--not that there were cyclic references).Steps to reproduce
a.mli:
type bill = { a : int }
val foo : B.baz -> int
b.mli:
type bar = { a : int; b : int }
val baz : bar -> A.bill -> int
Additional information
Relevant code:
ocaml/driver/makedepend.ml
Lines 466 to 467 in 8daa184
The text was updated successfully, but these errors were encountered: