Skip to content
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

ghci-dap fails if stack's global resolver is newer than current project's #4

Open
cloudcrypt opened this issue Apr 22, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@cloudcrypt
Copy link

Scenario:

STACK_ROOT\global-project\stack.yaml contains resolver: lts-15.9

current_project_directory\stack.yaml contains resolver: lts-14.27

ghci-dap is installed by stack globally, installing ghci-dap.exe in the bin folder.

Issue:
Occurs whenever --with-ghc=ghci-dap is used

[DAP][INFO] start ghci-dap-0.0.14.0.
GHCi, version 8.8.3: https://www.haskell.org/ghc/  :? for help

<interactive>:1:1: error:
    Failed to load interface for `GHC.Base'
    There are files missing in the `base-4.12.0.0' package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.

I tested this by creating a new stack project, using resolver: lts-15.9, and the issue did not occur.

(OS: Windows 10)

@phoityne
Copy link
Owner

haskell-debug-adapter does not switch exes dynamicaly.
Could you install haskell-debug-adapter in the stack project folder ?
It will switch global exe files to suitable version from snapshots.

 stack_project> stack install haskell-dap ghci-dap haskell-debug-adapter

Regards.

@cloudcrypt
Copy link
Author

haskell-debug-adapter does not switch exes dynamicaly.
Could you install haskell-debug-adapter in the stack project folder ?
It will switch global exe files to suitable version from snapshots.

 stack_project> stack install haskell-dap ghci-dap haskell-debug-adapter

Regards.

This does work, it copies the suitable version from the snapshots into the global bin directory.

So is this the way then, that when switching between projects that use different resolvers, one has to run stack install haskell-dap ghci-dap haskell-debug-adapter in the current directory before debugging, every time one switches projects? And if so, any way this type of thing can be automatic, perhaps in the VSCode extension?

@phoityne
Copy link
Owner

Could you set full path to the ghci-dap with "--with-ghc" option in the launch.json ?

--with-ghc=C:\\Users\\phoityne\\AppData\\Roaming\\stack\\snapshots\\xxxxxxxx\\bin\\ghci-dap

You can use suitable ghci-dap for each project.

@cloudcrypt
Copy link
Author

Yeah, that can certainly work. Might there be any way to make this more automatic though?

@phoityne phoityne added the enhancement New feature or request label Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants