haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Error in files from https://gitlab.haskell.org/ghc/ghc.git

Open Aster89 opened this issue 6 months ago • 3 comments

Your environment

I use GHCup to manage anything Haskell-related that I personally install and use. Some Haskell packages are installed on my system via pacmna, but that's probably because they are dependencies to other packages like shellcheck. I make use of Cabal, not Stack, for configuring projects.

Which OS do you use? up-to-date ArchLinux

Which version of GHC do you use and how did you install it? 9.10.1 from ghcup 0.1.50.2

How is your project built (alternative: link to the project)?

I just did this, in an attempt to build ghc to experiment with it for contributing.

git clone https://gitlab.haskell.org/ghc/ghc.git
cd ghc/
git submodule update --init
./boot
./configure
./hadrian/build -j8
cd libraries/haskeline
cabal test # incidentally, this failed, not sure if it's relevant in any way

Which LSP client (editor/plugin) do you use? terminal Vim + YCM

Which version of HLS do you use and how did you install it? 2.10.0.0 from ghcup, etc.

Have you configured HLS in any way (especially: a hie.yaml file)?

What's wrong?

When I open a file, I get this error on the first line:

(GhcSession,NormalizedFilePath "/home/enrico/ghc/libraries/haskeline/System/Console/Haskeline/Vi.hs")/home/enrico/ghc/libraries/haskeline/hadrian/hie-bios: streamingProcess: execvpe: does not exist (No such file or directory)

It's possibly worth specifying that HLS just works fine in the in the repo I clone from https://github.com/haskell/haskeline

Debug information

Not sure what else I can provide. Please, let me know.

Aster89 avatar Jul 13 '25 13:07 Aster89

Hi, thank you for your bug report! I assume, building of GHC failed, since the order of commands is wrong, and consequentially, HLS can also not load GHC.

The order is:

git clone https://gitlab.haskell.org/ghc/ghc.git
cd ghc/
git submodule update --init
./boot
./configure
./hadrian/build -j8

Can you confirm the last command succeeds?

fendor avatar Jul 13 '25 14:07 fendor

I think I've just mixed up the lines when I copy and pasted. I'll fix in a moment.

Aster89 avatar Jul 13 '25 14:07 Aster89

I misunderstood the issue, I think your question is to load a file from the libraries directory.

I think the standard HLS setup for GHC doesn't support that. A workaround I can think of is to create a hie.yaml in the root of the package, e.g. libraries/haskeline with the contents

cradle:
  cabal:

fendor avatar Jul 13 '25 14:07 fendor