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

Add more information to ocamlobjinfo output #3622

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lukemaurer
Copy link
Contributor

Recommended to review commit-by-commit.

There are a couple of useful bits of data missing from ocamlobjinfo output, which may be of interest if one's build rules are using it to compute dependency information:

  • When an alias of an instance name is declared (with -no-alias-deps on), only the head appears in the interface imports of the module, even though resolving the alias will require loading all parts of the instance name.
  • Implementation imports are missing instance arguments altogether.

This PR addresses both issues.

If the user writes

    module Foo = Bar(Param)(Arg) [@jane.non_erasable.instances]

under `-no-alias-deps`, then we add `Bar` to the list of interface imports (with
no CRC), but not `Param` or `Arg`. This doesn't really reflect what's going on:
resolving that alias will require loading all three of `bar.cmi`, `param.cmi`,
and `arg.cmi`. As a result, `ocamlobjinfo` is giving incomplete information
about dependencies.
We've been printing the `Import_info.name`s of implementation imports, but this
leaves off the arguments of any instances that are imported (often leading to
multiple rows with the same name but different CRCs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant