Skip to content

subtle component caching issue when there is a symlink in the path of the repo #2801

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

Closed
maralorn opened this issue Mar 26, 2022 · 5 comments
Closed
Labels
component: ghcide component: hie-bios type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@maralorn
Copy link
Contributor

maralorn commented Mar 26, 2022

Your environment

Which OS do you use: Nixos
Which LSP client (editor/plugin) do you use: VSCodium/coc-nvim
Describe your project (alternative: link to the project): various, e.g. https://github.com/maralorn/nix-output-monitor

Steps to reproduce

My ~/git folder is a symlink (onto another filesystem).

I run haskell-language-server -d in ~/git/nix-output-monitor I get this log: https://termbin.com/pkk4
When I copy the project to ~/nix-output-monitor I get the expected behavior.
When I manually resolve the symlink and run hls in /disk/persist/git/nix-output-monitor I get the expected behavior.

Expected behaviour

hls should load the project normally, which means loading the library component once, when it encounters a file from the library.

Actual behaviour

hls loads the component/cradle new for every file in the library. Crucially files first get listed in
2022-03-26 12:51:30.50850162 [ThreadId 113] DEBUG hls: Known files updated:
but then shortly after a new cradle get’s created for a supposedly known file:

2022-03-26 12:51:30.60907107 [ThreadId 399] INFO hls:	Consulting the cradle for "lib/NOM/State/Sorting.hs"
2022-03-26 12:51:30.60915896 [ThreadId 399] WARNING hls:	No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for lib/NOM/State/Sorting.hs.
 Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2022-03-26 12:51:30.611110962 [ThreadId 399] DEBUG hls:	Output from setting up the cradle Cradle {cradleRootDir = "/disk/persist/maralorn/git/nix-output-monitor", cradleOptsProg = CradleAction: Cabal}

Include debug information

  1. I tried different hls versions I think I am seeing this with hls 1.4 and 1.6 e.g.
  2. I tried with different projects, they all have the issue.
  3. I tried a variety of different positions in my filesystem, the issue happened whenever I "cded" into the directory via a symlink.
  4. I tried with ghc 8.10 and ghc 9.0.
@maralorn maralorn added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Mar 26, 2022
@maralorn
Copy link
Contributor Author

I tried to falsify my assumptions, and sure enough I could. I’ll update the issue accordingly.

@maralorn maralorn changed the title subtle component caching issues probably related with file system boundaries subtle component caching issue when there is a symlink in the path of the repo Mar 26, 2022
@maralorn
Copy link
Contributor Author

I am starting to doubt my sanity here. I think the issue I am describing exists somehow, though the actual symptom, i.e. the need to regularly restart the language-server I can‘t reproduce anymore …

I have edited the issue accordingly.

@fendor
Copy link
Collaborator

fendor commented Mar 26, 2022

Maybe this PR is related if the issue is truly related to symlinks: #2359

@michaelpj
Copy link
Collaborator

@maralorn do you still see this?

@maralorn
Copy link
Contributor Author

Oh, phew. I have no clue. I can say that I have developed fine one the directory in question for the last year, so no need to chase ghosts here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide component: hie-bios type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants