Skip to content

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

Closed
@maralorn

Description

@maralorn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions