`ghcide version: 0.0.6 (GHC: 8.6.5) (PATH: /home/mayanks/.local/bin/ghcide) (GIT hash: 2f5d0d3e69abb5f321bf28b1049ae7a7fc9f619e)
Ghcide setup tester in /home/mayanks/work/transporter.
Report bugs at https://github.com/digital-asset/ghcide/issues
Step 1/6: Finding files to test in /home/mayanks/work/transporter
Found 7 files
Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle
Step 3/6, Cradle 1/1: Loading ./hie.yaml
Step 4/6, Cradle 1/1: Loading GHC Session
ghcide:
`
What OS are you using?
Manjaro i3
Any updates on this? Having the same issue.
@epeery what OS?
Arch Linux
One interesting thing to note is that when I add a cabal.project file to the root of the project the error changes to:
Step 4/6, Cradle 1/1: Loading GHC Session
ghcide: CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","","cabal: Unrecognised target syntax for ''.\n\n",""]
Seems to be also present on https://github.com/mpickering/haskell-ide-engine/issues/63
Could you check if LD_PRELOAD contains something and if it does run ghcide with LD_PRELOAD= ghcide ...
If that's not the case it is system glibc interfering with Nix glibc, something that https://github.com/NixOS/nixpkgs/pull/31263 wants to solve.
Running LD_PRELOAD=ghcide ghcide gives me the error:
ERROR: ld.so: object 'ghcide' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Seems like that thread you linked is likely the solution. Hopefully it gets merged soon :)
LD_PRELOAD= ghcide is the correct command - there's a space between equal sign and ghcide.
Ah got it. My bad. Thanks.
The LD_PRELOAD error goes away but the can't load .so/.DLL error persists.
I'm having a similar issue. The error I'm getting is:
ghcide version: 0.1.0 (GHC: 8.6.5) (PATH: /nix/store/xhg5lzac77x3y6ww54qjrvi3ygyjxzq9-ghcide-0.1.0-exe-ghcide/bin/ghcide)
Ghcide setup tester in /home/superfabio/projects/test.
Report bugs at https://github.com/digital-asset/ghcide/issues
Step 1/6: Finding files to test in /home/superfabio/projects/test
Found 4 files
Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle
Step 3/6, Cradle 1/1: Implicit cradle for /home/superfabio/projects/test
Cradle {cradleRootDir = "/home/superfabio/projects/test", cradleOptsProg = CradleAction: Stack}
Step 4/6, Cradle 1/1: Loading GHC Session
ghcide: <command line>: can't load .so/.DLL for: libgmp.so (libgmp.so: cannot open shared object file: No such file or directory)
I'm using Ubuntu 18.04.2 LTS via Windows Subsystem Linux
The package in mentioned is located at /usr/lib/x86_64-linux-gnu/ However, it seems GHC cannot find it.
Inside /etc/ld.so.conf.d I have two files: libc.conf x86_64-linux-gnu.conf. The latter contains the path to /usr/lib/x86_64-linux-gnu/. I also tried adding path to the former, no change. The GHC still cannot find libgmp.so.
Any ideas?
Could I ask if you're using vscode and if so, if it's installed with Nix? This applies to everyone.
@fabioluz could you run nix-store -qR /nix/store/xhg5lzac77x3y6ww54qjrvi3ygyjxzq9-ghcide-0.1.0-exe-ghcide
@domenkozar Yes, I'm using VSCode, it was not installed with Nix. Only ghcide was installed with Nix. Anyway, I get the same error if I run ghcide inside the project folder, so it should not be related to vscode, right?
The project was generated by Stack and it is was not installed with Nix. The project and ghcide have the same GHC version, which is 8.6.5.
The command you mentioned above showed a bunch of packages, more than 100.
/nix/store/6yaj6n8l925xxfbcd65gzqx3dz7idrnn-glibc-2.27
/nix/store/jxny7lfjvxwxli237wp3fl09wll0jlfh-gcc-7.4.0-lib
/nix/store/f0wi5c6j4zl8idrd6qw3bsis7cmdy7j7-gmp-6.1.2
...
Thanks! Can you also run echo $LD_LIBRARY_PATH?
Since this happens when loading GHC session, most likely glibc mismatch comes between ghc and ghcide. Maybe ghcide should just pin ghc since versions need to be matched anyway.
Could I ask if you're using vscode and if so, if it's installed with Nix? This applies to everyone.
No I鈥檓 using Neovim which I installed from the Arch package repos.
I'm happy to help debug this if someone allows me to https://tmate.io/ and use audio :)
Thanks! Can you also run
echo $LD_LIBRARY_PATH?
It does not show anything. Empty line.
I'm happy to help debug this if someone allows me to https://tmate.io/ and use audio :)
Sure! I can do it in around 4 hours from now. Let me know when we can do it.
I'm in CET, so anytime withing working hours will do :)
I just started seeing this on NixOS, too. @domenkozar's suggestion about a glibc mismatch seems likely as my cachix-installed ghcide is now saying,
Step 4/6, Cradle 1/1: Loading GHC Session
ghcide: <command line>: can't load .so/.DLL for: /nix/store/5ar4gjxiykc3vpn40whgsd0cgqxgfng7-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so (/nix/store/6yaj6n8l925xxfbcd65gzqx3dz7idrnn-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /nix/store/5ar4gjxiykc3vpn40whgsd0cgqxgfng7-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so))
ETA: If I switch my project's pinned nixpkgs to coincide with the one pinned by ghcide-nix, all is well.
Let me know how I can give you the session id for https://tmate.io/. Github has no direct messages 馃槃
@acowley can you investigate if $LD_LIBRARY_PATH is set somewhere?
I've updated https://github.com/cachix/ghcide-nix to be built with glibc-2.30, could everyone using it try again?
@domenkozar That seems to have fixed it for me. Thanks!
@domenkozar It is working for me as well. Thanks!
I still encountered some issues on Ubuntu 18.04 using nix.
Most of the files are fine except one of those with stuffs using QuasiQuotes and TemplateHaskell.
The log is as following:
[nix-shell:~/workdir/argus]$ ghcide
ghcide version: 0.1.0 (GHC: 8.6.5) (PATH: /nix/store/02wcifqr53wjs1m5vn670b1avfy071az-ghcide-0.1.0-exe-ghcide/bin/ghcide)
Ghcide setup tester in /home/shen/workdir/argus.
Report bugs at https://github.com/digital-asset/ghcide/issues
Step 1/6: Finding files to test in /home/shen/workdir/argus
Found 9 files
Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle
Step 3/6, Cradle 1/1: Implicit cradle for /home/shen/workdir/argus
Cradle {cradleRootDir = "/home/shen/workdir/argus", cradleOptsProg = CradleAction: Default}
Step 4/6, Cradle 1/1: Loading GHC Session
Step 5/6: Initializing the IDE
Step 6/6: Type checking the files
File: /home/shen/workdir/argus/src/Model.hs
Hidden: no
Range: 1:0-100001:0
Source: typecheck
Severity: DsError
Message:
Unexpected usage error
can't load .so/.DLL for: /nix/store/siks2gcfwx6qwh27m7c5r5lixcr621bd-glibc-2.27/lib/libpthread.so
(/nix/store/siks2gcfwx6qwh27m7c5r5lixcr621bd-glibc-2.27/lib/libpthread.so.0: undefined symbol:
__libc_vfork, version GLIBC_PRIVATE)
Files that failed:
* /home/shen/workdir/argus/src/Model.hs
Completed (8 files worked, 1 file failed)
[nix-shell:~/workdir/argus]$ nix-store -qR /nix/store/02wcifqr53wjs1m5vn670b1avfy071az-ghcide-0.1.0-exe-ghcide/bin/ghcide | grep glibc
/nix/store/sc7lh1dhvd7fg28d7dxwsqzfcinnr6j5-glibc-2.30
/nix/store/ad115wnlpndz5xkkvz19k2ihsb5cdqpz-glibc-2.30-bin
/nix/store/bq2ycrgyzi3zkq2mwb3j46a684smqxcr-glibc-2.30-dev
[nix-shell:~/workdir/argus]$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
Could you run nix-store -qR $(which ghc) | grep glibc
I had this same issue as well, and I've been following this thread. After updating ghcide this issue is gone, but another issue is back:
Step 4/6, Cradle 1/1: Loading GHC Session
> Resolving dependencies...
> Build profile: -w ghc-8.6.5 -O1
> In order, the following will be built (use -v for more details):
> - shopping-cart-0.1.0.0 (lib) (configuration changed)
> Configuring library for shopping-cart-0.1.0.0..
> Warning: The 'license-file' field refers to the file 'LICENSE' which does not
> exist.
> Preprocessing library for shopping-cart-0.1.0.0..
ghcide: <command line>: cannot satisfy -package-id aeson-1.4.6.0-Em7rwiOS5bO6ogTsCliW9g
(use -v for more information)
I can't seem to get around this cannot satisfy -package-id error. Any hints?
I'm running ghcide within a nix-shell because I'm on Ubuntu, and it doesn't work outside of a Nix shell.
Nevermind, I managed to fix it with these exports:
export NIX_GHC="$(which ghc)"
export NIX_GHCPKG="$(which ghc-pkg)"
export NIX_GHC_DOCDIR="$NIX_GHC/../../share/doc/ghc/html"
export NIX_GHC_LIBDIR="$(ghc --print-libdir)"
Got them from this issue: https://github.com/mpickering/hie-bios/issues/25
@domenkozar
Here is output of the commands. I guess it means my ghc is still using the old glibc.
[nix-shell:~/workdir/argus]$ nix-store -qR $(which ghc) | grep glibc
/nix/store/siks2gcfwx6qwh27m7c5r5lixcr621bd-glibc-2.27
/nix/store/ngf4xva3wvw1m0pb84v9h4jgl784lxkh-glibc-2.27-bin
/nix/store/yjdnj9pcjgb09xif4ngmf13vb8npklys-glibc-2.27-dev
[nix-shell:~/workdir/argus]$ nix-store -qR /nix/store/02wcifqr53wjs1m5vn670b1avfy071az-ghcide-0.1.0-exe-ghcide/bin/ghcide | grep glibc
/nix/store/sc7lh1dhvd7fg28d7dxwsqzfcinnr6j5-glibc-2.30
/nix/store/ad115wnlpndz5xkkvz19k2ihsb5cdqpz-glibc-2.30-bin
/nix/store/bq2ycrgyzi3zkq2mwb3j46a684smqxcr-glibc-2.30-dev
Maybe it's a question out of ghcide. How can I force my ghc to link with glibc-2.30 by default? I'm using the nixpkgs-unstable channel.
Seems like you're using outdated version of nixpkgs-unstable channel. nix-channel --update and reinstalling ghc should do it.
I realized that I have to actually run sudo /nix/var/nix/profiles/default/bin/nix-channel --update due to the use of nix-daemon/multi-user configuration of nix and problem solved. Thanks.
I managed to fix it with these exports:
export NIX_GHC
export NIX_GHCPK
export NIX_GHC_LIBDIR
export NIX_GLIBC_PRIVATE
None of the export stuff worked for me. What helped me with this issue was found here: https://github.com/digital-asset/ghcide/issues/538
ghcide is in nixpkgs now:
nix-repl> pkgs = import <nixpkgs> {}
nix-repl> pkgs.haskell.packages.ghc883.ghcide
芦derivation /nix/store/5kx45z9b8xvvbacq724ivpsq882m0g91-ghcide-0.1.0.drv禄
Since the issue is due to mismatched glibc versions one can avoid the issue by including ghcide in the shell.nix on a per project basis assuming you're using GHC provided by the shell.nix from nixpkgs and not haskell.nix.
@willbush how did you include ghcide in your shell.nix ? I have the following issue: https://github.com/haskell/haskell-ide-engine/issues/1781
@razvan-flavius-panda I did it in this repo. Specifically here.
That nix expression was based on a template I found here: https://github.com/jwiegley/hello There's a lot of ways to write shell.nix for Haskell projects and I'm definitely not sure what the best way to do it. However, I do prefer to pin nixpkgs to a specific version using niv.
Here are some links I've been collecting on the topic:
https://discourse.nixos.org/t/nix-haskell-development-2020/6170
also see:
https://www.reddit.com/r/haskell/comments/fp0g4n/nix_haskell_development_2020_howto/
The last one might be the most up-to-date. I've only skimmed it so far.
@domenkozar not sure if lastest version of ghcide could have fix this, or if we could do something in ghcide to fix it, so i will close this if nobody disagree