-
Notifications
You must be signed in to change notification settings - Fork 841
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
stack repl subpackage
compile time cwd is different from stack build subpackage
one
#5421
Comments
@jneira I see that the situations
I didn't investigate it further (yet) but probably Stack needs to take this problem into account. As for the |
@jneira it looks like in
|
Many thanks for take care of that and share your investigation.
I think so. |
This PR adds a `hie.yaml` to the project and also works around the following HLS bug: haskell/haskell-language-server#481 That issue is actually related to stack, but seems like the cabal integration is suffering from the same in our case. There are quite a few relative-path related issues open in HLS anyway. This commit uses the `makeRelativeToProject` function from file-embed ([As suggested by phadej under another issue](commercialhaskell/stack#5421 (comment))) in order to resolve the relative paths in a way that's independent of the build system, working around this long-standing HLS bug. * Add a hie.yaml to the project * Work around HLS bug while embedding files This commit works around the following HLS bug: haskell/haskell-language-server#481 That issue is actually related to stack, but seems like the cabal integration is suffering from the same in our case. There are quite a few relative-path related issue open HLS anyway. This commit uses the `makeRelativeToProject` function from file-embed in order to resolve the relative paths in a way that's independent of the build system, working around this long-standing HLS bug.
General summary/comments (optional)
The current working dir at compile time is different between
stack build
andstack repl
. It likely makes template haskell io computations relying in cwd fail, cause the relative file or directory usually does not exist.This in turn makes that code not usable in a ide (hls, ghcide) that uses
hie-bios
to manage ghc session, ashie-bios
usesstack repl
underneath for stack projects.(original issue haskell/haskell-language-server#481)
Steps to reproduce
and in the main package an executable with
stack run
and observe cwd is/path/to/main/package/subpackage
stack repl subpackage
orstack repl
and observe cwd evaluation gives us/path/to/main/package
Expected
Both paths should be equal.
Actual
stack build
uses the subpackage path andstack repl
the main package oneStack version
Method of installation
The text was updated successfully, but these errors were encountered: