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
Reporterbaileyparker 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.06.0 
Target Version4.07.0+devFixed in Version4.07.0+dev 
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

b.mli:
  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: https://github.com/ocaml/ocaml/blob/8daa184d95d30e28ea7cae60d366b39d9a509c78/driver/makedepend.ml#L466-L467 [^]
TagsNo tags attached.
Attached Files

- Relationships

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

I agree with your analysis. Fix in progress at https://github.com/ocaml/ocaml/pull/1578 [^]
(0018868)
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
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker