Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg: rev_store can't handle symlinks #9328

Closed
Alizter opened this issue Nov 30, 2023 · 3 comments · Fixed by #9352
Closed

pkg: rev_store can't handle symlinks #9328

Alizter opened this issue Nov 30, 2023 · 3 comments · Fixed by #9352

Comments

@Alizter
Copy link
Collaborator

Alizter commented Nov 30, 2023

Some opam repositories such as dune-universe/opam-overlays contain symlinks. This causes the rev_store to fail since the parser cannot understand the output of git-ls. Dune raises

Error: exception Not_found
Raised at Dune_re__Core.exec in file "vendor/re/src/core.ml", line 937,
  characters 20-35
Called from Dune_pkg__Rev_store.File.parse.(fun) in file
  "src/dune_pkg/rev_store.ml", line 227, characters 14-29

in this case which under inspection gives the following line from git-ls as problematic:

160000 commit 0f8ea69ad66f745bd52ecae7189b72f8b6d50da8       -	test/rwo.t/book

Presumably this is due to the fact that book is a symlink in that repo and therefore changes the output of git-ls.

In this particular case the symlink occurs outside of packages/ so the case could be made to ignore it, however it seems sensible after discussing with @Leonidas-from-XIV that symlinks could be supported in the files/ directory of packages. Therefore the rev_store should be modified to handle them correctly.

To reproduce my error above, use the following dune-workspace file:

(lang dune 3.11)

(repository
 (name opam-overlays)
 (source "git+https://github.com/dune-universe/opam-overlays.git"))

(context
 (default
  (name default)
  (repositories opam-overlays)))
@Leonidas-from-XIV
Copy link
Collaborator

In particular, this seems to be the case because it is a broken symlink, 0f8ea69ad66f745bd52ecae7189b72f8b6d50da8 doesn't point anywhere. I assume ignoring these should be fine, since there's no data that can be retrieved from this.

Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 1, 2023
@Leonidas-from-XIV
Copy link
Collaborator

Turns out it is not a symlink, it is a commit object which… I don't know how this happened there. I wonder how to create those, since it seems very strange that a tree contains something else than a file.

Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 1, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 4, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 4, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 5, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 5, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 6, 2023
Leonidas-from-XIV added a commit that referenced this issue Dec 6, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 6, 2023
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 6, 2023
@Leonidas-from-XIV
Copy link
Collaborator

Leonidas-from-XIV commented Dec 7, 2023

So given this turned out not to be about symlinks but commit objects and it is fixed now, I'll close this as done.

Edit: Looks like I forgot to merge, but that's done now so the issue is completed.

Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this issue Dec 7, 2023
Leonidas-from-XIV added a commit that referenced this issue Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants