You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error with directory symlink: Unexpected file kind "S_DIR" #9873
I have been experiencing this failure on the dune preview (version cd00c2a) when it tries to compile ocamlbuild 0.16.1, which includes a symlink in one of the codebases example folders.
@ElectreAAS will be picking this up. She will connect with @Leonidas-from-XIV first to determine whether he has come part way to the solution.
Update: @Leonidas-from-XIV noted that his PR is here #10426 ! It is passing tests and has no merge conflicts. There are some questions to be addressed there.
I encountered this when trying to build the OxCaml fork of odoc-parser, a part of odoc. I was trying to build this with dune pkg and 5.2.0+ox compiler.
File "dune.lock/odoc-parser.pkg", line 15, characters 3-82:
15 | git+https://github.com/oxcaml/odoc.git#97e1daecb432d33a7137d525f7a554f203073a95)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Error trying to read targets after a rule was run:
- url/ebca61d809da743073794a02009c3602/dir/test/generators/html/fonts: Unexpected file kind "S_DIR" (directory)
Looking at the odoc repository, it does have a few symlinks:
But, curiously, the symlink issue doesn't appear with the mainline compiler. odoc and friends build okay when building with dune pkg and stock OCaml compiler. I'm going to remove the symlinks and try to build with OxCaml.
Coming back to the original issue #9873, it only seems to occur with pathological examples. I have yet to see a package where a directory symlink is a critical part of the build and dune does not offer a sound work-around. Many packages that appear in practice can therefore be patched in our pkg overlays, as we have done for ocamlbuild.
If the need arises in the future that a commonly used package needs this feature, then it would be enough motivation to rethink the solution here.
For this reason, and because the fix is apparently not as straightforward as one may think, we have deprioritized work in this issue and removed it form the MSP.
This is indeed partially solved by #13792.
The original reported issue was building ocamlbuild as a package dependency (this is now fixed), however the reproduction in #9874 is slightly different: it shows that we have the exact same problem when building a local package with dune rules that contains a directory symlink, and that is not fixed.
The way to fix that would be to properly support directory symlinks in the dune engine, which is waaaay more complicated than what I'm doing in #13792, and importantly here, not needed to build ocamlbuild as a package.
I am hence closing this issue as partially fixed (in the case of dune pkg), and partially not planned (in the case of directory symlinks in the rest of dune)
Activity
test: repro case for ocaml#9873 (directory symlink)
emillon commentedon Jan 31, 2024
Repro in #9874.
test: repro case for #9873 (directory symlink) (#9874)
fix: allow symlink dirs in Cached_digest.refresh
ncitron commentedon Feb 27, 2025
I have been experiencing this failure on the dune preview (version cd00c2a) when it tries to compile ocamlbuild 0.16.1, which includes a symlink in one of the codebases example folders.
Any advice for how to resolve?
ncitron commentedon Feb 27, 2025
Following up here: I was able to resolve this by downgrading ocamlbuild to version 0.15.0, so maybe this issue is better addressed by them.
shonfeder commentedon Aug 8, 2025
It seems to be that this prevents having
fstaras a dependency in projects managed bydune pkg:giltho commentedon Aug 20, 2025
Hello, I also hit this when trying to install a pinned version of https://github.com/AeneasVerif/charon (funnily enough, not unrelated to fstar). It's also because there is a symlinked folder somewhere.
shonfeder commentedon Sep 3, 2025
@ElectreAAS will be picking this up. She will connect with @Leonidas-from-XIV first to determine whether he has come part way to the solution.
Update: @Leonidas-from-XIV noted that his PR is here #10426 ! It is passing tests and has no merge conflicts. There are some questions to be addressed there.
1 remaining item
Sudha247 commentedon Nov 19, 2025
I encountered this when trying to build the OxCaml fork of
odoc-parser, a part of odoc. I was trying to build this withdune pkgand5.2.0+oxcompiler.Looking at the odoc repository, it does have a few symlinks:
But, curiously, the symlink issue doesn't appear with the mainline compiler.
odocand friends build okay when building with dune pkg and stock OCaml compiler. I'm going to remove the symlinks and try to build with OxCaml.shonfeder commentedon Nov 25, 2025
In #12613, @Alizter notes:
For this reason, and because the fix is apparently not as straightforward as one may think, we have deprioritized work in this issue and removed it form the MSP.
But I am still of the opinion it should be fixed.
[pkg] Resolve directory symlinks in fetched targets (#13792)
shonfeder commentedon May 6, 2026
IIUC, #13792 should have largely addressed this. But if there are outstanding issues, could you update here with details @ElectreAAS?
ElectreAAS commentedon May 7, 2026
This is indeed partially solved by #13792.
The original reported issue was building
ocamlbuildas a package dependency (this is now fixed), however the reproduction in #9874 is slightly different: it shows that we have the exact same problem when building a local package with dune rules that contains a directory symlink, and that is not fixed.The way to fix that would be to properly support directory symlinks in the dune engine, which is waaaay more complicated than what I'm doing in #13792, and importantly here, not needed to build
ocamlbuildas a package.I am hence closing this issue as partially fixed (in the case of dune pkg), and partially not planned (in the case of directory symlinks in the rest of dune)