test: document ocamldep behavior with transparent alias chains#14178
Merged
art-w merged 1 commit intoocaml:mainfrom Apr 17, 2026
Merged
test: document ocamldep behavior with transparent alias chains#14178art-w merged 1 commit intoocaml:mainfrom
art-w merged 1 commit intoocaml:mainfrom
Conversation
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>
Collaborator
Author
Collaborator
Author
|
@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? |
Member
|
Nope. I just granted you merge rights. |
Collaborator
Author
Ah ha! That explains it. Thank you for your trust. I guess I must wait for a review, here... |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Document the interaction between
ocamldepand transparent module aliasesacross libraries.
When a module uses a transparent alias chain (e.g.,
Libb.Bridge.M.L.vwhere
Bridgealiases intoLibcwhich aliases intoLibd),ocamldeponly reports the direct library reference (
Libb). However, the compilerfollows the alias chain at compile time and reads
.cmifiles from alltransitive libraries.
This property is critical for the correctness of any future per-module
inter-library dependency optimization (#4572): filtering deps based solely
on
ocamldepoutput would miss transitive libraries reached throughaliases, causing "inconsistent assumptions over interface" errors on
rebuilds.
per-module-lib-deps/transparent-alias-chain.t