Skip to content
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

Merged
merged 12 commits into from
Nov 14, 2024

Conversation

jonludlam
Copy link
Member

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!

@jonludlam jonludlam added the no changelog This pull request does not need a changelog entry label Nov 8, 2024
@jonludlam
Copy link
Member Author

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.

src/driver/voodoo.ml Outdated Show resolved Hide resolved
src/driver/odoc_driver.ml Show resolved Hide resolved
src/driver/voodoo.mli Outdated Show resolved Hide resolved
src/driver/odoc_units_of.ml Outdated Show resolved Hide resolved
src/driver/voodoo.ml Show resolved Hide resolved
@gpetiot
Copy link
Collaborator

gpetiot commented Nov 11, 2024

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:

- A:
  - pkg-paths:
    - xx
    - xx
  - lib-paths:
    - xx
    - xx
- B:
...

@jonludlam
Copy link
Member Author

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!

Copy link
Collaborator

@panglesd panglesd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

src/driver/library_names.ml Outdated Show resolved Hide resolved
src/driver/odoc_driver.ml Outdated Show resolved Hide resolved
src/driver/odoc_driver.ml Outdated Show resolved Hide resolved
src/driver/odoc_driver.ml Outdated Show resolved Hide resolved
| None -> directories
| Some pkg -> (
try List.assoc pkg page_roots :: directories
with _ -> directories)
Copy link
Collaborator

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.

Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In pulling this particular thread a bit more unravelled than I'd expected. @panglesd could you please check carefully commit fa215e0 to check I've not made any silly assumptions?

Comment on lines 582 to 587
let directories =
match current_package with
| None -> directories
| Some pkg -> (
try List.assoc pkg page_roots :: directories
with _ -> directories)
Copy link
Collaborator

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 when pkg is the current package

I think this should be added to the odoc manpage and the driver doc page, now that it is merged!

Copy link
Member Author

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?

Copy link
Collaborator

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).

jonludlam added a commit to jonludlam/odoc that referenced this pull request Nov 12, 2024
Copy link
Collaborator

@panglesd panglesd left a 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!

src/odoc/resolver.mli Outdated Show resolved Hide resolved
jonludlam added a commit that referenced this pull request Nov 13, 2024
jonludlam added a commit to jonludlam/odoc that referenced this pull request Nov 13, 2024
@jonludlam jonludlam merged commit dd9bb23 into ocaml:master Nov 14, 2024
14 checks passed
jonludlam added a commit that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This pull request does not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants