Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007710OCamltools (ocaml{lex,yacc,dep,debug,...})public2018-01-15 04:322018-02-11 14:55
Assigned To 
PlatformOSOS Version
Product Version4.06.0 
Target Version4.07.0+dev/beta2/rc1/rc2Fixed in Version4.07.0+dev/beta2/rc1/rc2 
Summary0007710: ocamldep -sort returns success despite cyclic files warning
DescriptionIf 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 Reproducea.mli:
  type bill = { a : int }
  val foo : B.baz -> int

  type bar = { a : int; b : int }
  val baz : bar -> A.bill -> int

1. Place the above into files in the same directory
2. Run ocamldep -sort a.mli b.mli
3. Notice the "Warning: cycle in dependencies. End of list is not sorted."
4. Notice echo $? is 0
Additional InformationRelevant code: [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
xleroy (administrator)
2018-01-22 10:16

I agree with your analysis. Fix in progress at [^]
xleroy (administrator)
2018-02-11 14:55

Fix merged in trunk.

- Issue History
Date Modified Username Field Change
2018-01-15 04:32 baileyparker New Issue
2018-01-22 10:16 xleroy Note Added: 0018841
2018-01-22 10:16 xleroy Status new => confirmed
2018-01-22 10:16 xleroy Target Version => 4.07.0+dev/beta2/rc1/rc2
2018-02-11 14:55 xleroy Note Added: 0018868
2018-02-11 14:55 xleroy Status confirmed => resolved
2018-02-11 14:55 xleroy Resolution open => fixed
2018-02-11 14:55 xleroy Fixed in Version => 4.07.0+dev/beta2/rc1/rc2

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker