New BIOS does not work on windows
vf58bwk4 opened this issue · 13 comments
Status
- A workaround is available
- A fix is written
- A fix is released
- The fixed version is on the marketplace.
- Version of vscode-ghc-simple: >= 2.0 && <= 2.2
- Version of VSCode: 1.54.3
- Version of Haskell-related tools:
- Stack: 2.5.1
Steps to reproduce
- Get this repo: https://github.com/vf58bwk4/two-apps.git with two-component project example
- Open project folder in VSCode
- Open any .hs file
- Open View->Output, under GHC tab
- There is no output from "stack repl" command, so there are no hints in editor windows
If I replace hie.yaml with next file
cradle: { stack: { component: "two-exe:exe:app-one"} }
it works, but works correctly only for app/one/AppOne.hs module.
All things, type signature hints and haddocks worked correctly up to version 0.1.24 of the extension.
No output is really weird. Here's what I got:
I have stack 2.5.1.1
, and I got an error message like:
ghci | GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help
ghci | <command line>: cannot satisfy -package two-exe-0.1.0.0
ghci | (use -v for more information)
This seems to be a bug in stack: commercialhaskell/stack#2790. A workaround is to manually stack build
first. That fixed it for me.
There also seems to be a typo in hie.yaml
:
- path: "./app/two"
component: "two-exe:exe:app-one"
That probably should have been two-exe:exe:app-two
.
After fixing the two, things work just fine. This is weird. I guess I'll try to dig a bit further.
Sorry, but it still doesn't work for me. As soon as I insert - path: <any>
in hie.yaml it breaks and there is no output from GHCi.
Perhaps, problem somewhere in hie.yaml processing under Windows. Because I'm under Windows :)
Unfortunately, it also doesn't work without hie.yaml in multi-component project. Here is the print from GHC output:
Starting for c:\local\hsworld\two-exe\app\one\AppOne.hs, key = {"type":"detect-stack","uri":"file:///c%3A/local/hsworld/two-exe"}
Starting GHCi with: ["stack","repl","two-exe:lib","two-exe:exe:app-one","two-exe:exe:app-two","two-exe:test:two-exe-test"]
(Under cwd c:\local\hsworld\two-exe)
-> :set prompt ""
|> :set prompt-cont ""
ghci | �[0m�[0m
ghci | �[0m* * * * * * * �[0m
ghci | �[0mThe main module to load is ambiguous. Candidates are: �[0m
ghci | �[0m1. Package two-exe' component two-exe:exe:app-one with main-is file: C:\local\hsworld\two-exe\app\one\AppOne.hs�[0m ghci | �[0m2. Package
two-exe' component two-exe:exe:app-two with main-is file: C:\local\hsworld\two-exe\app\two\AppTwo.hs�[0m
ghci | �[0m3. Package `two-exe' component two-exe:test:two-exe-test with main-is file: C:\local\hsworld\two-exe\test\Spec.hs�[0m
ghci | �[0mYou can specify which one to pick by: �[0m
ghci | �[0m * Specifying targets to stack ghci e.g. stack ghci two-exe:exe:app-one�[0m
ghci | Specify main module to use (press enter to load none): Not loading any main modules, as no valid module selected
ghci |
ghci | �[0m * Specifying what the main is e.g. stack ghci --main-is two-exe:exe:app-one�[0m
ghci | �[0m * Choosing from the candidate above [1..3]�[0m
ghci | �[0m * * * * * * �[0m
ghci | �[0m�[0m
ghci | �[0mtwo-exe> configure (lib + exe + test)�[0m
ghci | �[0mConfiguring two-exe-0.1.0.0...�[0m
ghci | �[0mtwo-exe> initial-build-steps (lib + exe + test)�[0m
ghci | �[0mtwo-exe> Test running disabled by --no-run-tests flag.�[0m
ghci | �[0mCompleted 2 action(s).�[0m
ghci | �[0mThe following GHC options are incompatible with GHCi and have not been passed to it: -threaded�[0m
ghci | �[0mConfiguring GHCi with the following packages: two-exe�[0m
ghci | �[0m�[0m
ghci | �[0m * * * * * * �[0m
ghci | �[0m
ghci | �[33mWarning:�[0m Multiple files use the same module name:
ghci | * �[91mPaths_two_exe�[0m found at the following paths
ghci | * �[36mC:\local\hsworld\two-exe.stack-work\dist\274b403a\build\app-one\autogen\Paths_two_exe.hs�[0m (�[96mtwo-exe:exe:app-one�[0m)
ghci | * �[36mC:\local\hsworld\two-exe.stack-work\dist\274b403a\build\app-two\autogen\Paths_two_exe.hs�[0m (�[96mtwo-exe:exe:app-two�[0m)
ghci | * �[36mC:\local\hsworld\two-exe.stack-work\dist\274b403a\build\autogen\Paths_two_exe.hs�[0m (�[96mtwo-exe:lib�[0m)
ghci | * �[36mC:\local\hsworld\two-exe.stack-work\dist\274b403a\build\two-exe-test\autogen\Paths_two_exe.hs�[0m (�[96mtwo-exe:test:two-exe-test�[0m)�[0m
ghci | �[0m * * * * * * *�[0m
ghci | �[0m�[0m
ghci | GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help
ghci | [1 of 2] Compiling Lib ( C:\local\hsworld\two-exe\src\Lib.hs, interpreted )
ghci | [2 of 2] Compiling Paths_two_exe ( C:\local\hsworld\two-exe.stack-work\dist\274b403a\build\autogen\Paths_two_exe.hs, interpreted )
ghci | Ok, two modules loaded.
ghci | Loaded GHCi configuration from C:\Users\alzhukov\AppData\Local\Temp\haskell-stack-ghci\c7a12b62\ghci-script
That's all. There is no additional output from GHCi after this last line. So, no hints, no haddock in editor window.
Seems to be a Windows-specific problem... I'll try when I get access to one.
Please, compare the output of 0.2.2 extension with one from 0.1.24. I print it here. Perhaps, there is needs to add --no-terminal, --color and --no-load flags to stack repl command?
Starting GHCi with: "stack --no-terminal --color never repl --no-load two-exe:lib two-exe:exe:app-one two-exe:exe:app-two two-exe:test:two-exe-test"
(Under cwd c:\local\hsworld\two-exe)
-> :set prompt ""
|> :set prompt-cont ""
ghci | two-exe> configure (lib + exe + test)
ghci | Configuring two-exe-0.1.0.0...
ghci | two-exe> initial-build-steps (lib + exe + test)
ghci | two-exe> Test running disabled by --no-run-tests flag.
ghci | Completed 2 action(s).
ghci | The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
ghci | Configuring GHCi with the following packages: two-exe
ghci | GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help
ghci | Prelude>
ghci | ===ghci_barrier_0.36269096971527315===
-> System.IO.hSetBuffering System.IO.stderr System.IO.NoBuffering
|> System.IO.hSetBuffering System.IO.stdout System.IO.NoBuffering
|> :set -fno-diagnostics-show-caret -fdiagnostics-color=never -ferror-spans
|> :set -fdefer-type-errors -fdefer-typed-holes -fdefer-out-of-scope-variables
|> :seti -fno-defer-type-errors -fno-defer-typed-holes -fno-defer-out-of-scope-variables
|> :set -haddock
|> :set -fno-hide-source-paths
|> :set -Wno-error=missing-home-modules
ghci |
ghci | ===ghci_barrier_0.4481352577160831===
-> :show paths
ghci | current working directory:
ghci | c:\local\hsworld\two-exe
ghci | module import search paths:
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build
ghci | C:\local\hsworld\two-exe\src
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\autogen
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\global-autogen
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\app-one
ghci | C:\local\hsworld\two-exe\app\one
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\app-one\autogen
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\app-one\app-one-tmp
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\app-two
ghci | C:\local\hsworld\two-exe\app\two
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\app-two\autogen
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\app-two\app-two-tmp
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\two-exe-test
ghci | C:\local\hsworld\two-exe\test
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\two-exe-test\autogen
ghci | C:\local\hsworld\two-exe\.stack-work\dist\274b403a\build\two-exe-test\two-exe-test-tmp
ghci |
ghci | ===ghci_barrier_0.49206724045202965===
Error detecting base path: Error: Invalid path value: c:\local\hsworld\two-exe
Will fallback to document's workspace folder
-> :set +c
|> :load "*c:\local\hsworld\two-exe\app\one\AppOne.hs"
ghci | [1 of 2] Compiling Lib ( C:\local\hsworld\two-exe\src\Lib.hs, interpreted )
ghci | [2 of 2] Compiling AppOne ( C:\local\hsworld\two-exe\app\one\AppOne.hs, interpreted )
ghci | Ok, two modules loaded.
ghci | Collecting type info for 2 module(s) ...
ghci |
ghci | ===ghci_barrier_0.13538148156791507===
-> :show modules
ghci | AppOne ( C:\local\hsworld\two-exe\app\one\AppOne.hs, interpreted )
ghci | Lib ( C:\local\hsworld\two-exe\src\Lib.hs, interpreted )
ghci |
ghci | ===ghci_barrier_0.17386108069744544===
-> :module
ghci |
ghci | ===ghci_barrier_0.3862591296412139===
-> :info main
ghci |
ghci | :1:1-4: error: Not in scope: `main'
ghci |
ghci | ===ghci_barrier_0.14380269250920996===
-> :m *AppOne
ghci |
ghci | ===ghci_barrier_0.22524553518488144===
-> :m *AppOne
ghci |
ghci | ===ghci_barrier_0.3388625736230042===
-> :all-types
ghci | c:\local\hsworld\two-exe\app\one\AppOne.hs:(6,1)-(6,4): GHC.Types.IO ()
ghci | c:\local\hsworld\two-exe\app\one\AppOne.hs:(7,3)-(7,7): [GHC.Types.Char] -> GHC.Types.IO ()
ghci | c:\local\hsworld\two-exe\app\one\AppOne.hs:(7,9)-(7,21): [GHC.Types.Char]
ghci | c:\local\hsworld\two-exe\app\one\AppOne.hs:(7,3)-(7,21): GHC.Types.IO ()
ghci | c:\local\hsworld\two-exe\app\one\AppOne.hs:(6,8)-(7,21): GHC.Types.IO ()
ghci | C:\local\hsworld\two-exe\src\Lib.hs:(6,1)-(6,8): GHC.Types.IO ()
ghci | C:\local\hsworld\two-exe\src\Lib.hs:(6,12)-(6,19): GHC.Base.String -> GHC.Types.IO ()
ghci | C:\local\hsworld\two-exe\src\Lib.hs:(6,21)-(6,30): [GHC.Types.Char]
ghci | C:\local\hsworld\two-exe\src\Lib.hs:(6,12)-(6,30): GHC.Types.IO ()
ghci |
ghci | ===ghci_barrier_0.5426407931312569===
-> :doc main
ghci | ghc.exe: Can't find any documentation for AppOne.
ghci | This is probably because the module was loaded without '-haddock',
ghci | but it's also possible that the module contains no documentation.
ghci |
ghci | Try running ':set -haddock' and :load the file again.
ghci |
ghci | ===ghci_barrier_0.9989376235448408===
Hi, I realized that after implementing vgs-bios (that's hie.yaml
support for you), I forgot to pass --no-terminal --color never
to Stack.
Do you mind trying a development build to see if it's fixed? See here https://github.com/dramforever/vscode-ghc-simple/actions/runs/701445217#artifacts
To install, download the artifact extension-package
, unzip it, and install the resulting .vsix
file using the Extensions: Install from VSIX
VSCode command.
Yes, I've tried. There is no changes (except for a prettier GHCi output), unfortunately. Maybe you need to add --no-load flag also, as it was in 0.1.24? At least without nie.yaml mode will work correct.
That's really weird... I guess you'll need to use v0.1 for the time being. As said I'll try it next time I get access to a Windows machine
This is just a stab in the dark, because this is a way too inefficient method of debugging, but I tried adding --no-load
. Here is the build: https://github.com/dramforever/vscode-ghc-simple/actions/runs/701608101
Thank you! Now it works fine without hie.yaml
. But still doesn't work when it presented.
I'm also running this on Windows and can confirm that this latest build does not seem to make it work with path
specified. Currently I can only make it work by referring only to a component in hie.yaml
.
I think haskell-language-server
seems to read hie.yaml
fine, so I'm not sure the platform is relevant in terms of capabilities.
vscode-ghc-simple doesn't use hie-bios to read hie.yaml
(to avoid depending on binaries), so this could very well be a bug in vscode-ghc-simple.
Fix released as v0.2.3. Should be able to see it soon. If problem persists feel free to post another issue or reopen this