-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependencies are not the same when source code rendering is enabled or not. The `--has-src` flag specifies which behaviour to adopt. The logic to lookup the cmt is factorized between `compile` and `compile-deps`. Signed-off-by: Paul-Elliot <peada@free.fr> Co-authored-by: Jules Aguillon <jules@j3s.fr>
- Loading branch information
Showing
9 changed files
with
72 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
val a : int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let a = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Source code rendering needs the same compilation order as cmts. | ||
|
||
As a consequence, the dependencies should be taken from the cmt, when source | ||
code rendering is enabled. This must be specified using the --has-src flag for | ||
compile-deps | ||
|
||
$ ocamlc -c b.ml -bin-annot | ||
$ ocamlc -c a.mli -I . -bin-annot | ||
$ ocamlc -c a.ml -I . -bin-annot | ||
|
||
[a.cmti] does not depend on B, while its implementation [a.cmt] depends on B. | ||
|
||
$ odoc compile-deps a.cmti | ||
CamlinternalFormatBasics 8f8f634558798ee408df3c50a5539b15 | ||
Stdlib 6d7bf11af14ea68354925f3a37387930 | ||
A 21e6137bd9b3aaa3c66960387b5f32c0 | ||
$ odoc compile-deps a.cmt | ||
Stdlib 6d7bf11af14ea68354925f3a37387930 | ||
CamlinternalFormatBasics 8f8f634558798ee408df3c50a5539b15 | ||
B 903ddd9b7c0fa4ee6d34b4af6358d1e1 | ||
A 21e6137bd9b3aaa3c66960387b5f32c0 | ||
|
||
Must contain B: | ||
$ odoc compile-deps --has-src a.cmti | ||
Stdlib 6d7bf11af14ea68354925f3a37387930 | ||
CamlinternalFormatBasics 8f8f634558798ee408df3c50a5539b15 | ||
B 903ddd9b7c0fa4ee6d34b4af6358d1e1 | ||
A 21e6137bd9b3aaa3c66960387b5f32c0 |