The current working dir at compile time is different between stack build
and stack 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, as hie-bios
uses stack repl
underneath for stack projects.
(original issue haskell/haskell-language-server#481)
import System.Directory import Language.Haskell.TH import Language.Haskell.TH.Syntax cwd :: FilePath cwd = $$(runIO getCurrentDirectory >>= \d-> fmap TExp (lift (d :: FilePath)))
and in the main package an executable with
stack run
and observe cwd is /path/to/main/package/subpackage
stack repl subpackage
or stack repl
and observe cwd evaluation gives us /path/to/main/package
Both paths should be equal.
Actualstack build
uses the subpackage path and stack repl
the main package one
$ stack --version
Version 2.5.1 x86_64 hpack-0.33.0
Method of installation
Vlix, michaelpj, AlistairB and fendor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4