Skip to content

test: document ocamldep behavior with transparent alias chains#14178

Merged
art-w merged 1 commit intoocaml:mainfrom
robinbb:test-transparent-alias-deps
Apr 17, 2026
Merged

test: document ocamldep behavior with transparent alias chains#14178
art-w merged 1 commit intoocaml:mainfrom
robinbb:test-transparent-alias-deps

Conversation

@robinbb
Copy link
Copy Markdown
Collaborator

@robinbb robinbb commented Apr 13, 2026

Summary

Document the interaction between ocamldep and transparent module aliases
across libraries.

When a module uses a transparent alias chain (e.g., Libb.Bridge.M.L.v
where Bridge aliases into Libc which aliases into Libd), ocamldep
only reports the direct library reference (Libb). However, the compiler
follows the alias chain at compile time and reads .cmi files from all
transitive libraries.

This property is critical for the correctness of any future per-module
inter-library dependency optimization (#4572): filtering deps based solely
on ocamldep output would miss transitive libraries reached through
aliases, causing "inconsistent assumptions over interface" errors on
rebuilds.

  • New cram test per-module-lib-deps/transparent-alias-chain.t

Transparent module aliases (e.g., `module M = OtherLib.Foo`) create
cross-library .cmi reads that ocamldep does not report. This test
documents the discrepancy: ocamldep only sees the direct library
reference, but the compiler follows alias chains and reads .cmi files
from transitive libraries at compile time.

This property is critical for any future per-module inter-library
dependency optimization (ocaml#4572).

Signed-off-by: Robin Bate Boerop <me@robinbb.com>
@robinbb robinbb requested a review from art-w April 13, 2026 20:10
@robinbb
Copy link
Copy Markdown
Collaborator Author

robinbb commented Apr 13, 2026

@art-w Does this capture the meaning of what you were explaining in the comments of #14116?

@robinbb
Copy link
Copy Markdown
Collaborator Author

robinbb commented Apr 14, 2026

@rgrinberg I am surprised that GitHub is giving me the opportunity to merge this PR without a passing (or any) review. Is that the correct state of affairs for someone with my credentials (triage creds)? Or, is the repo misconfigured?

@rgrinberg
Copy link
Copy Markdown
Member

Nope. I just granted you merge rights.

@robinbb
Copy link
Copy Markdown
Collaborator Author

robinbb commented Apr 14, 2026

Nope. I just granted you merge rights.

Ah ha! That explains it. Thank you for your trust. I guess I must wait for a review, here...

@robinbb
Copy link
Copy Markdown
Collaborator Author

robinbb commented Apr 15, 2026

@art-w Does this capture the meaning of what you were explaining in the comments of #14116?

... and even if it does not quite do so, may I merge it with your approval?

Copy link
Copy Markdown
Collaborator

@art-w art-w left a comment

Choose a reason for hiding this comment

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

Thanks!

@art-w art-w merged commit 88994d9 into ocaml:main Apr 17, 2026
30 checks passed
@robinbb robinbb deleted the test-transparent-alias-deps branch April 17, 2026 16:25
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.

3 participants