fix(pkg): resolve symlinks from (install) action #13239
Merged
Alizter merged 2 commits intoocaml:mainfrom Jan 20, 2026
Merged
Conversation
rgrinberg
reviewed
Jan 8, 2026
cc94c92 to
c2de6fc
Compare
rgrinberg
reviewed
Jan 8, 2026
87f7705 to
4402331
Compare
f4b854f to
1ca083a
Compare
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
1ca083a to
3ff0617
Compare
Alizter
commented
Jan 19, 2026
Comment on lines
+3
to
+6
| CR-someday Alizter: This behavior is questionable. We convert the symlink to a | ||
| hardlink pointing to an external file, which ties the build output to external | ||
| content. If the external file changes, the target would be stale. Consider | ||
| whether we should leave such symlinks as-is, copy the file, or error instead. |
Collaborator
Author
There was a problem hiding this comment.
This won't affect the cache, since we reject all symlinks there, but I am still unsure if this is good to accpt. At the end of the day, it probably won't matter much.
rgrinberg
approved these changes
Jan 19, 2026
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.
The reloctable compiler, like the other OCaml compilers, has symlinks in it's installation layout. These need to be resolved before we declare them inside the directory target or else the reloctable compiler cannot be cached. This work is tracked in #13229.
In the second commit we introduce a general mechanism to comb through the targets of the install layout for a package and resolve these symlinks by replacing them with a hardlink, falling back to a copy if that is not possible.
We add quite a few tests to exercise the numerous edge cases that come up.