#13669: use compilation unit name in dependency check for the native linker#13673
Merged
Octachron merged 3 commits intoocaml:trunkfrom Dec 17, 2024
Merged
#13669: use compilation unit name in dependency check for the native linker#13673Octachron merged 3 commits intoocaml:trunkfrom
Octachron merged 3 commits intoocaml:trunkfrom
Conversation
366224a to
30b33fe
Compare
lthls
approved these changes
Dec 13, 2024
Contributor
lthls
left a comment
There was a problem hiding this comment.
I think a comment in the test that we only support that for backwards compatibility reasons would be nice, apart from that everything looks fine.
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.
When checking dependency at link time, the native linker is currently using the full path for computing provided compilation unit in presence of packed modules. This creates a bug when compiling fragment of packed module separatedly
because the
a.cmxfile recorded that it was providingPack.AwhereasMainwas registering a dependency onAdirectly. Consequently, the linking check for dependency emits a mysterious errorin the scenario above. This scenario happens in
coccinellebuild system and me and @lthls agreed that it was better to not breakcoccinelleeven if don't really support this use case.In order to fix this issue, this PR homogenize the notion of provided and required units for the native linker by stating to the dependency checker that
a.cmxprovides the compilation unitArather than the pack submodulePack.A. Indeed, pack submodule cannot appear as dependency in other modules: pack siblings depends will depend directly on the non-qualified path, whereas external modules will depend only on the pack module itself.Another option would be to update the dependency side, but the changes felt too intrusive to me for 5.3 .