haskell - Where is the source of `GHC.Paths.*` value came from? -
i running stack
version 1.1.2 x86_64 hpack-0.14.1
$ stack exec ghc run outside project, using implicit global project config using resolver: lts-5.10 implicit global project's config file: /home/wisut/.stack/global-project/stack.yaml /home/wisut/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc
but when using stack ghci
ghc.paths
return wrong path
$ stack ghci run outside project, using implicit global project config using resolver: lts-5.10 implicit global project's config file: /home/wisut/.stack/global-project/stack.yaml error parsing targets: specified targets matched no packages. perhaps need run 'stack init'? warning: build failed, optimistically launching ghci anyway configuring ghci following packages: ghci, version 7.10.3: http://www.haskell.org/ghc/ :? ok, modules loaded: none. prelude> ghc.paths.ghc "/usr/bin/ghc-7.10.3"
i running arch linux ghc 8.0.1 therefor there no ghc-7 avaliable outside stack
[wisut@earth ~]$ ghc /usr/bin/ghc [wisut@earth ~]$ ghc --version glorious glasgow haskell compilation system, version 8.0.1 [wisut@earth ~]$ ls -al /usr/bin/ghc lrwxrwxrwx 1 root root 9 may 24 18:28 /usr/bin/ghc -> ghc-8.0.1
looking @ ghc.paths source, have no idea value from. env vars?
{-# language cpp #-} module ghc.paths ( ghc, ghc_pkg, libdir, docdir ) libdir, docdir, ghc, ghc_pkg :: filepath libdir = ghc_paths_libdir docdir = ghc_paths_docdir ghc = ghc_paths_ghc ghc_pkg = ghc_paths_ghc_pkg
running stack exec env
didn't see anything.
$ stack exec env | grep -i ghc run outside project, using implicit global project config ghc_package_path=/home/wisut/.stack/global-project/.stack-work/installx86_64-linux/lts-5.10/7.10.3/pkgdb:/home/wisut/.stack/snapshots/x86_64-linux/lts-5.10/7.10.3/pkgdb:/home/wisut/.stack/programs/x86_64-linux/ghc-7.10.3/lib/ghc-7.10.3/package.conf.d path=/home/wisut/.stack/global-project/.stack-work/install/x86_64-linux/lts-5.10/7.10.3/bin:/home/wisut/.stack/snapshots/x86_64-linux/lts-5.10/7.10.3/bin:/home/wisut/.stack/programs/x86_64-linux/ghc-7.10.3/bin:/home/wisut/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
how can fix wrong value? how to config stack
make ghc.paths
return correct one?
upd tried running stack
--no-system-ghc
, didn't make difference. tried remove ~/.cabal
, ~/.stack
folders. had stack setup
, , after stack
re-installed compiler doesn't give me wrong path, doesn't give me any path, output of command empty. have nothing special in of setup.hs
too.
you right, ghc_
variables cpp definitions coming custom setup.hs
:
let buildinfo = emptybuildinfo{ cppoptions = ["-dghc_paths_ghc_pkg=" ++ show c_ghc_pkg, "-dghc_paths_ghc=" ++ show c_ghc, "-dghc_paths_libdir=" ++ show libdir, "-dghc_paths_docdir=" ++ show docdir ] }
about problem wrong path, try run stack --no-system-ghc ghci
. if still shows "/usr/bin/ghc-7.10.3"
ghc paths, suspect had ghc there when compiled ghc-paths
ghc-7.10.3, , stack
quite in not rebuilding stuff, old version of ghc-paths
still there. don't know way rebuild package in snapshot, other whiping ~/.stack
, starting over; might idea. if changed global ghc stuff.
there related issue: stop using system-ghc silently.
Comments
Post a Comment