Driver: Read a config file to apply the right -P
and -L
.
#1194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes the driver follow a convention to know which packages/libraries to include in
-P
/-L
during linking, foropam
-installed libraries. (This convention is what I understood that we proposed in various dev meetings. However, I have a slightly different proposition, see at the end of the post).The file has to be at path
<opam_root>/doc/<pkgname>/odoc-config.sexp
.It has to be a valid sequence of whitespace-separated s-expression. Each s-expression must be of the form
'(libraries <atom list>)
or(packages <atom list>)
.The atoms present in each field correspond respectively to the
-L
and-P
to add to the linking of the pages and modules of the package. That is, atoms in'library
must be library names, while atoms inpackages
must be package names.I tried to add cram tests for the driver, but failed miserably. I thus included instructions on how to run tests.
I think specifying pages at a package level, and libraries at a library level, is confusing for the user and does not add much value.
I would propose to have a single
(deps <package list>)
stanza which adds:-P
for each package listed-L
for each library of each package listedThis is less "fine-grained" but less confusing I think. Let me know if there is some advantages to being able to specify dependencies at the library granularity!