-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cabal fails to find project on windows #29
Comments
This is a weird problem. I cannot reproduce this on Linux: everything works fine. It seems to be Windows specific and cabal new-build specific.
I remember wondering about this exact weirdness back when I first tried to add cabal new-build support, and I was on Windows back then. I guess this problem didn't magically fix itself. |
Wait, when outside of a project |
I met the same problem on MacOS. ghc-simple output hints that it's running outside of the current project folder and trying to build a fake-package. No modules from my project loaded. |
OK. I did some tests:
based on above 3 points, I guess ghc-simple start 'cabel new-reple' under the fake-package folder, not my project folder. So questions are:
|
OK. Dig more. I found a workaround. Just pick 'bare' type for the workspace and ghci will pick the dependencies from the .ghc.environment.-- file under your project and load your modules successfully. |
This is the behavior of Which is weird, since I do set |
OK. So the problem is when ghc-simple trying to start a session, the working directory is not my project directory where the active source file of the workspace located. |
AFAICT the problem is that vscode launches cabal with a cwd that has a lowercase drive letter.
|
But I'm on MacOS and also had this problem. |
Status
The following workaround might help with some cases of this issue:
Steps to reproduce
Open a Haskell file in VS code, where the workspace is cabal new.
The cabal instance started by vscode-ghc-simple reports:
Hinting that cabal is being run in the wrong folder. However, running
cd
(which prints out the current working directory) using the sameoptions
as cabal is run with shows the exact same path that I get when I runcd
myself fromcmd
inside of the project folder, and running cabal new-repl from there works fine.Workspace
Create a project using cabal init, use the cabal 2.4 style init when prompted. Use the src/ source directoy.
The text was updated successfully, but these errors were encountered: