Using Stack through WSL fails, even though running the failing command directly works fine
-
Bug description : I'm trying to configure my VS Code with Haskero to use the Haskell Stack I have under WSL, by changing the Stack path setting to
wsl stack
. This causes problems when Haskero wants to communicate with Stack, for reasons I can't figure out. I can without apparent problems manually run the command the extension claims reports a failure. -
Observed behaviour : I see the following message in the Output tab when I open a Haskell source file:
Initializing Haskero...
Spawning process 'stack' with command 'wsl stack ghci --with-ghc intero "--ghci-options=-ignore-dot-ghci -Wall" --no-build --no-load'
[Error - 3:40:14 PM] Server initialization failed.
Message: Request initialize failed with message: Failed to start process 'stack', Haskero must be used on stack projects only. Details: Error: spawn wsl stack ENOENT
Code: -32603
However, if I copy that command into a Powershell terminal window (at the root of the VS Code project), I can run it just fine:
> wsl stack ghci --with-ghc intero "--ghci-options=-ignore-dot-ghci -Wall" --no-build --no-load
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -O2
Configuring GHCi with the following packages: aoc
Intero 0.1.34 (GHC 8.4.3)
Type :intro and press enter for an introduction of the standard commands.
Intero-Service-Port: 60700
Prelude>
-
Expected behaviour :
-
OS: windows & linux &
-
Plugin (ghc, stack, intero and haskero) version and VSCode version used :
$ wsl stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.4.3
$ wsl stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
$ wsl stack exec intero -- --version
Intero 0.1.34
Haskero version 1.3.1
- Steps to reproduce:
-
On a Windows machine with WSL, install
stack
under WSL -
Initialize a
stack
project (stack new repro, prefix with
wslif running from PowerShell/CMD). Open the folder with VS Code, and run
stack init(again, prefix with
wsl` if running from PS/CMD). -
Make sure
intero
is available on WSL:stack build --copy-compiler-tool intero
(prefix withwsl
if running from PowerShell/CMD). -
Open a Haskell source file, e.g.
Setup.hs
in the project root. -
View the Output pane (Ctrl+Shift+u), where the message above will show in a few seconds.