-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Voodoo fixes following the change in layout #1241
Conversation
The 'ensure pages' commit has fixed some errors reported in one of the test cases, though there are still some errors present. I think there are still some references in there that look valid that aren't yet resolving though. |
I have a more generic question: what are the reasons for using many lib marker files instead of using a single file to track the lib markers? e.g. something like:
|
Because each package is built separately, so there will have to be at least as many files as there are packages. Since we're trying to locate directories, I thought I might as well have a marker in each directory - at least we know it's definitely there in the filesystem then! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
src/odoc/resolver.ml
Outdated
| None -> directories | ||
| Some pkg -> ( | ||
try List.assoc pkg page_roots :: directories | ||
with _ -> directories) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to catch only Not_found
exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, the Not_found
exception cannot be raised: There must be a directory associated to current_package
it is checked before.
I think either remove the catch and add a comment, or keep the "current_package_dir
" when computing the current_package
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/odoc/resolver.ml
Outdated
let directories = | ||
match current_package with | ||
| None -> directories | ||
| Some pkg -> ( | ||
try List.assoc pkg page_roots :: directories | ||
with _ -> directories) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change for drivers... If I understand correctly:
- Any
-L _:<path>
also adds<path>
to the search path - A
-P pkg:<path>
adds<path>
to the search path whenpkg
is the current package
I think this should be added to the odoc manpage and the driver doc page, now that it is merged!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the behaviour I intended. What I wasn't sure about was whether this is the right mechanism to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable... Not adding anything to the search path would be another reasonable approach (that would give more work, but more freedom, to the driver).
Suggested by @panglesd in review of ocaml#1241
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
0de0b41
to
88a7715
Compare
Suggested by @panglesd in review of ocaml#1241
37aa45d
to
d13d655
Compare
Only use the explicit libraries and packages used for linking to drive the include paths, even for compile.
Suggested by @panglesd in review of ocaml#1241
Plus better use of Astring.String.fields
d13d655
to
10dc123
Compare
Combined with the splitting of the compile/link phases so we can link to more than just the dependencies of your package. This is a building block to allow links in the documentation of package A to go to package B that isn't a direct dependency - or even to package C that depends on package A!