ndmitchell / ghcid

Very low feature GHCi based IDE
Other
1.13k stars 114 forks source link

Fails to Start on WSL 2 #388

Open stephen-smith opened 3 months ago

stephen-smith commented 3 months ago
$ ghcid -v
%OS: linux
%ARCH: x86_64
%VERSION: 0.8.9
%ARGUMENTS: ["-v"]
ghcid: user error (Error: couldn't start native file manager: fdType: unsupported operation (unknown file type))
HasCallStack backtrace:
  collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:92:13 in ghc-internal:GHC.Internal.Exception
  toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/IO.hs:260:11 in ghc-internal:GHC.Internal.IO
  throwIO, called at libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs:195:43 in ghc-internal:GHC.Internal.Control.Exception.Base

$ ghcid -V
Auto reloading GHCi daemon v0.8.9
$ which ghcid
/home/bss/.cabal/bin/ghcid
$ cabal --version
cabal-install version 3.12.1.0
compiled using version 3.12.1.0 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.10.1
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal
$ uname -a
Linux MW-LT-0068 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Just reinstalled today. Yesterday ghc-9.2.8/ghcid-0.8.8-e-ghcid-e53e7fac37f3705ed1023817b33dd41f77c667fb855f6d040e0a0e2498ef3cf5 was working, but I cleaned that up as I was removing older GHC versions.

stephen-smith commented 3 months ago

Using the --poll option seems to make it work, so I guess this is a bug in notifiers on WSL 2?

$ ghcid --poll
Loading cabal repl --repl-options=-fno-code --repl-options=-fno-break-on-exception --repl-options=-fno-break-on-error --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j ...                                                   
Resolving dependencies...
Build profile: -w ghc-9.6.6 -O0                                                                                        
In order, the following will be built (use -v for more details):
...
stephen-smith commented 3 months ago

Here's the throw (in fsnotify): createManager

Would it be possible and "correct" to have ghcid catch this failure and "fall back" to 0.1s polling?

stephen-smith commented 3 months ago

Same version, but on ghc-9.6.6 seems to work fine. So I'd guess there's some problem in hinotify with ghc 9.10 ?

$ ghcid -V
Auto reloading GHCi daemon v0.8.9
$ cabal --version
cabal-install version 3.12.1.0
compiled using version 3.12.1.0 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.6
stephen-smith commented 3 months ago

I opened https://github.com/kolmodin/hinotify/issues/38 to track it there, too. Not sure if this issue should remain open.