Open arbitrary-dev opened 1 month ago
Hi, thank you for your bug report!
This seems to be a bug in cabal
, see https://github.com/haskell/cabal/issues/8875. That's quite unfortunate, I am not sure whether there is any actionable workaround for this issue.
Perhaps the workaround for HLS would be to allow for a setting to use relative paths when calling Cabal. Because as I see in https://github.com/haskell/cabal/issues/8875 and confirmed locally, using Cabal without specifying the absolute path works just fine. That way I can just initialize HLS while at the root of my project and be just fine. What do you think?
That workaround is slightly tricky, as we would need to figure out to which .cabal
file a filepath is most likely to be relative to.
Also, as I tested in https://github.com/haskell/cabal/issues/8875#issuecomment-2106267103, it is also broken if there are spaces in the hs-source-dir
, for which there is no workaround at all.
Your environment
Which OS do you use? Gentoo
Which version of GHC do you use and how did you install it? 9.8.2 compiled from sources
How is your project built?
Which LSP client (editor/plugin) do you use? neovim + lsp-configs
Which version of HLS do you use and how did you install it? 2.7.0.0 compiled from sources
Have you configured HLS in any way (especially: a
hie.yaml
file)? NopeSteps to reproduce
Put a sample project on a path with spaces, e.g:
/tmp/ab c/project
Expected behaviour
HLS successfully loads the project.
Actual behaviour