Skip to content

fix: Don't fail on symlinks to folders - #10426

Closed
Leonidas-from-XIV wants to merge 1 commit into
ocaml:mainfrom
Leonidas-from-XIV:symlink-fail
Closed

Leonidas-from-XIV wants to merge 1 commit into
ocaml:mainfrom
Leonidas-from-XIV:symlink-fail

Conversation

@Leonidas-from-XIV

@Leonidas-from-XIV Leonidas-from-XIV commented Apr 16, 2024 •

Copy link
Copy Markdown
Member

Trying to figure out why it the code was forbidding symlinks to folders, but in my tests nothing breaks so if there is a reason for this restriction it is unclear.

Fixes #9873 and the reproduction cases of #9276 and #9874 but is essentially a duplicate of #9937.

@Leonidas-from-XIV
Leonidas-from-XIV marked this pull request as ready for review July 8, 2025 13:55
@Leonidas-from-XIV

Copy link
Copy Markdown
Member Author

@Sudha247 reminded me of this PR so out of curiosity I rebased it and it still seems to just work, so I'm marking it as ready to review. Maybe the review will reveal what the idea behind disallowing directories originally was.

@Alizter

Alizter commented Jul 8, 2025

Copy link
Copy Markdown
Collaborator

Things that I would check:

  1. What happens to symlinks to absolute directories? They probably aren't portable.
  2. What happens if a directory target contains a broken symlink?
  3. What happens to symlinks to places outside of the workspace.

@Sudha247

Sudha247 commented Jul 9, 2025

Copy link
Copy Markdown
Member

What happens to symlinks to absolute directories? They probably aren't portable.

My first reaction to this is, it's probably okay..? If I have a local project that I'm building with dune and have added an absolute path on my local system as a symlink, it might break in a different scenario, but I'd still expect it to work on the current setup. It'd be good to have a test for this, though.

What happens to symlinks to places outside of the workspace.

Same thoughts as above.

What happens if a directory target contains a broken symlink?

Good point, will be good to check.

@Alizter

Alizter commented Aug 21, 2025

Copy link
Copy Markdown
Collaborator

More questions here:
4. What happens when a directory target contains a symlink to somewhere outside of a directory target.

This is probably the reason for the restriction today.

@Leonidas-from-XIV

Copy link
Copy Markdown
Member Author

Closing with the same reason as #12613:

After some discussion about this it seems supporting directory symlinks inside directory targets might need a little bit more thinking and design than we can spare at the moment.

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.

Error with directory symlink: Unexpected file kind "S_DIR"

3 participants